]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: cpcap-battery: Fix signed counter sample register
authorTony Lindgren <tony@atomide.com>
Sun, 7 Apr 2019 18:12:50 +0000 (11:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:53:01 +0000 (11:53 +0200)
commitbec4c3b32fe65c520a0af49f79da6d7d2be20872
tree5c44dded774c5158580fbf00d24bc0a108447d62
parent6ace9bdeb06a6a2a2c564e2cf2d75ab167dcdb5a
power: supply: cpcap-battery: Fix signed counter sample register

[ Upstream commit c68b901ac4fa969db8917b6a9f9b40524a690d20 ]

The accumulator sample register is signed 32-bits wide register on
droid 4. And only the earlier version of cpcap has a signed 24-bits
wide register. We're currently passing it around as unsigned, so
let's fix that and use sign_extend32() for the earlier revision.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/cpcap-battery.c