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)
committerSebastian Reichel <sre@kernel.org>
Mon, 15 Apr 2019 20:52:14 +0000 (22:52 +0200)
commitc68b901ac4fa969db8917b6a9f9b40524a690d20
tree329f0151fee4ae8334ee3a02fd1029ccb8e0fc40
parent1a9aadc86ad45f5281ea633c244b6b770dc85b5b
power: supply: cpcap-battery: Fix signed counter sample register

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>
drivers/power/supply/cpcap-battery.c