Re: [PATCH 1/2] power: supply: cpcap-battery: Fix handling of lowered charger voltage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> With cpcap-charger now using 4.2V instead of 4.35V, we never reach
> POWER_SUPPLY_CAPACITY_LEVEL_FULL unless we handle the lowered charge
> voltage.
> 
> Let's do this by implementing POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
> and assume anything at that level or higher is a full battery.
> 
> Let's also make it configurable for users who may still want to
> reconfigure it, and notify the charger if supported by the charger.

> +static int cpcap_battery_set_property(struct power_supply *psy,
> +				      enum power_supply_property psp,
> +				      const union power_supply_propval *val)
> +{
> +	struct cpcap_battery_ddata *ddata = power_supply_get_drvdata(psy);
> +
> +	switch (psp) {
> +	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
> +		if (val->intval < ddata->config.info.voltage_min_design)
> +			return -EINVAL;

Is minimum design applicable here? I believe that's the lowest voltage
battery is discharged to...

I guess we can use it if there's no more suitable limit?

> +		ddata->config.bat.constant_charge_voltage_max_uv = val->intval;
> +
> +		return cpcap_battery_update_charger(ddata, val->intval);
> +	break;

Delete the break.

Acked-by: Pavel Machek <pavel@xxxxxx>
	  								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux