power: supply: cpcap-battery: Fix handling of lowered charger voltage
authorTony Lindgren <tony@atomide.com>
Wed, 16 Oct 2019 22:41:21 +0000 (15:41 -0700)
committerSebastian Reichel <sre@kernel.org>
Sun, 20 Oct 2019 18:26:20 +0000 (20:26 +0200)
commit8b0134cc14b9d4dba4477489c11f7c634c382e3e
tree172da5df295f51dc9252e0f24cf5745a174a9c68
parent50fc99f83f102c60a9429f451594019a6a978103
power: supply: cpcap-battery: Fix handling of lowered charger voltage

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.

Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cpcap-battery.c