linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Heinemann <posted@heine.so>
To: linux-pm@vger.kernel.org
Subject: [PATCH] sbs-battery: correct capacity mode selection bits
Date: Fri, 07 Jul 2017 16:23:54 +0200	[thread overview]
Message-ID: <1a1c52f56a9e530ae2d0bf825e67f6a6@heine.so> (raw)

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

             reply	other threads:[~2017-07-07 14:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 14:23 Michael Heinemann [this message]
2017-07-11  2:32 ` [PATCH] sbs-battery: correct capacity mode selection bits Phil Reid
2017-07-24 18:56 ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1a1c52f56a9e530ae2d0bf825e67f6a6@heine.so \
    --to=posted@heine.so \
    --cc=linux-pm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).