linux-stable/drivers/power
Evgeny Boger 724e76c087 power: supply: axp20x_battery: properly report current when discharging
[ Upstream commit d4f408cdcd ]

As stated in [1], negative current values are used for discharging
batteries.

AXP PMICs internally have two different ADC channels for shunt current
measurement: one used during charging and one during discharging.
The values reported by these ADCs are unsigned.
While the driver properly selects ADC channel to get the data from,
it doesn't apply negative sign when reporting discharging current.

[1] Documentation/ABI/testing/sysfs-class-power

Signed-off-by: Evgeny Boger <boger@wirenboard.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-20 09:08:26 +02:00
..
avs PM / AVS: SmartReflex: NULL check before some freeing functions is not needed 2019-12-05 15:37:14 +01:00
reset power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe 2022-04-20 09:08:16 +02:00
supply power: supply: axp20x_battery: properly report current when discharging 2022-04-20 09:08:26 +02:00
Kconfig
Makefile