power: supply: sbs-battery: correct capacity mode selection bits
authorMichael Heinemann <posted@heine.so>
Fri, 7 Jul 2017 14:23:54 +0000 (16:23 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 24 Jul 2017 12:08:52 +0000 (14:08 +0200)
The capacity mode bit is bit 15. Currently it is written as
default initialized enum and never shifted. This leads to
a behaviour where the BATTERY_MODE is not correctly
recognized and set again.

This commit initializes the enum accordingly.

Signed-off-by: Michael Heinemann <committed@heine.so>
Tested-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/sbs-battery.c

index f7059459f0fbfc7e9008e29baa90155104c6e915..e8065af085bd3c5db934289a797c50e20c5a1b1c 100644 (file)
@@ -60,8 +60,8 @@ enum {
 #define BATTERY_MODE_OFFSET            0x03
 #define BATTERY_MODE_MASK              0x8000
 enum sbs_battery_mode {
-       BATTERY_MODE_AMPS,
-       BATTERY_MODE_WATTS
+       BATTERY_MODE_AMPS = 0,
+       BATTERY_MODE_WATTS = 0x8000
 };
 
 /* manufacturer access defines */