linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sbs-battery: correct capacity mode selection bits
@ 2017-07-07 14:23 Michael Heinemann
  2017-07-11  2:32 ` Phil Reid
  2017-07-24 18:56 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Heinemann @ 2017-07-07 14:23 UTC (permalink / raw)
  To: linux-pm

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>
---
  drivers/power/supply/sbs-battery.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/supply/sbs-battery.c 
b/drivers/power/supply/sbs-battery.c
index 8bb2eb3..498e9af 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-24 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 14:23 [PATCH] sbs-battery: correct capacity mode selection bits Michael Heinemann
2017-07-11  2:32 ` Phil Reid
2017-07-24 18:56 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).