lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200701161713.f67htedosevy4oyp@earth.universe>
Date:   Wed, 1 Jul 2020 18:17:13 +0200
From:   Sebastian Reichel <sre@...nel.org>
To:     Ricardo Rivera-Matos <r-rivera-matos@...com>
Cc:     pali@...nel.org, robh@...nel.org, afd@...com, dmurphy@...com,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, sspatil@...roid.com
Subject: Re: [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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ