From: Mike Looijmans <mike.looijmans@topic.nl>
To: sre@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
dbaryshkov@gmail.com, dwmw2@infradead.org,
Mike Looijmans <mike.looijmans@topic.nl>
Subject: [PATCH] ltc2941-battery-gauge: Fix typo in conversion formula (58 instead of 85)
Date: Wed, 11 Feb 2015 12:36:51 +0100 [thread overview]
Message-ID: <1423654611-10906-1-git-send-email-mike.looijmans@topic.nl> (raw)
The driver reported 30% less than actually measured. This turned out to
be caused by a simple typo in the formula to calculate the LSB quantity.
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---
drivers/power/ltc2941-battery-gauge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/ltc2941-battery-gauge.c b/drivers/power/ltc2941-battery-gauge.c
index e4a9c87..784ff0b 100644
--- a/drivers/power/ltc2941-battery-gauge.c
+++ b/drivers/power/ltc2941-battery-gauge.c
@@ -439,7 +439,7 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
} else {
if (prescaler_exp > LTC2941_MAX_PRESCALER_EXP)
prescaler_exp = LTC2941_MAX_PRESCALER_EXP;
- info->Qlsb = ((58 * 50000) / r_sense) /
+ info->Qlsb = ((85 * 50000) / r_sense) /
(128 / (1 << prescaler_exp));
}
--
1.9.1
next reply other threads:[~2015-02-11 11:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 11:36 Mike Looijmans [this message]
2015-02-25 21:55 ` [PATCH] ltc2941-battery-gauge: Fix typo in conversion formula (58 instead of 85) 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=1423654611-10906-1-git-send-email-mike.looijmans@topic.nl \
--to=mike.looijmans@topic.nl \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@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