power: supply: axp20x_battery: properly report current when discharging
stable inclusion from stable-v5.10.111 commit b42b6d0ec358432ef13d1e3ca4d33cd837af6f8a category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5GL1Z Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b42b6d0ec358432ef13d1e3ca4d33cd837af6f8a -------------------------------- [ Upstream commit d4f408cd ] 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: NEvgeny Boger <boger@wirenboard.com> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com>
Showing
想要评论请 注册 或 登录