lkml.org 
[lkml]   [2020]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [EXTERNAL] Re: [PATCH v14 4/4] power: supply: bq25150 introduce the bq25150
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

\
 
 \ /
  Last update: 2020-07-01 18:18    [W:0.052 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site