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>
Tue, 17 Dec 2019 19:39:56 +0000 (20:39 +0100)
commit8799fa7c7d07cb2fa5d375069a07de8f3fda33b4
treee07d049ab210c78e34a925d71ed8474bf73c19a0
parentb5b43a3dba23028b2a3ea388fe4d9d6e8ebec9ef
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