linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Ricardo Rivera-Matos <r-rivera-matos@ti.com>
Cc: pali@kernel.org, robh@kernel.org, afd@ti.com, dmurphy@ti.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, sspatil@android.com
Subject: Re: [EXTERNAL] Re: [PATCH v14 4/4] power: supply: bq25150 introduce the bq25150
Date: Wed, 1 Jul 2020 18:17:13 +0200	[thread overview]
Message-ID: <20200701161713.f67htedosevy4oyp@earth.universe> (raw)
In-Reply-To: <b22f4eed-6baf-604e-0953-d427407c904e@ti.com>

Hi,

On Tue, Jun 30, 2020 at 11:17:30PM -0500, Ricardo Rivera-Matos wrote:
> [...]
> > > +static int bq2515x_battery_set_property(struct power_supply *psy,
> > > +		enum power_supply_property prop,
> > > +		const union power_supply_propval *val)
> > > +{
> > > +	struct bq2515x_device *bq2515x = power_supply_get_drvdata(psy);
> > > +	int ret;
> > > +
> > > +	switch (prop) {
> > > +	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
> > > +		ret = bq2515x_set_batt_reg(bq2515x, val->intval);
> > > +		break;
> > > +	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
> > > +		ret = bq2515x_set_const_charge_current(bq2515x, val->intval);
> > > +		break;
> > > +	case POWER_SUPPLY_PROP_PRECHARGE_CURRENT:
> > > +		ret = bq2515x_set_precharge_current(bq2515x, val->intval);
> > > +		break;
> > > +	default:
> > > +		return -EINVAL;
> > > +	}
> > > +
> > > +	return ret;
> > > +}
> > Expose those through the charger device. The battery device
> > can expose maximum data (e.g. POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX),
> > but should not control the charging itself.
> ACK. Just to confirm this would eliminate the need for the
> bq2515x_battery_set_property altogether as these three properties should be
> set in the charger device. There will only be a bq2515x_battery_get_property
> to report the CONSTANT_CHARGE_VOLTAGE_MAX and CONSTANT_CHARGE_CURRENT_MAX
> values captured from the devicetree.

Right.

-- Sebastian

      reply	other threads:[~2020-07-01 16:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 21:54 [PATCH v14 0/4] Add JEITA properties and introduce the bq2515x charger Ricardo Rivera-Matos
2020-06-30 21:54 ` [PATCH v14 1/4] power_supply: Add additional health properties to the header Ricardo Rivera-Matos
2020-07-01 16:39   ` Dan Murphy
2020-06-30 21:54 ` [PATCH v14 2/4] dt-bindings: power: Convert battery.txt to battery.yaml Ricardo Rivera-Matos
2020-06-30 22:32   ` Joe Perches
2020-07-01 16:22     ` Dan Murphy
2020-06-30 21:54 ` [PATCH v14 3/4] dt-bindings: power: Add the bindings for the bq2515x family of chargers Ricardo Rivera-Matos
2020-06-30 21:54 ` [PATCH v14 4/4] power: supply: bq25150 introduce the bq25150 Ricardo Rivera-Matos
2020-06-30 23:33   ` Sebastian Reichel
2020-07-01  4:17     ` [EXTERNAL] " Ricardo Rivera-Matos
2020-07-01 16:17       ` Sebastian Reichel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701161713.f67htedosevy4oyp@earth.universe \
    --to=sre@kernel.org \
    --cc=afd@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=r-rivera-matos@ti.com \
    --cc=robh@kernel.org \
    --cc=sspatil@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).