OSDN Git Service

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:35:37 +0000 (20:35 +0100)
commit52600d00af628c0d14a4ed9ccf7fc1dba38a666e
tree33220ca2a76f431be3c12b894795d6d15be91031
parent938de2324afb53acd20893cd8eec8ee6f80de646
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