From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: "dirk.brandewie@gmail.com" <dirk.brandewie@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "cbouatmailru@gmail.com" <cbouatmailru@gmail.com>,
김동근 <dg77.kim@samsung.com>, 박경민 <kyungmin.park@samsung.com>,
"Jason.Wortham@maxim-ic.com" <Jason.Wortham@maxim-ic.com>,
"Bruce Robertson" <bruce.e.robertson@intel.com>
Subject: Re: [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL
Date: Mon, 12 Dec 2011 02:18:17 +0000 (GMT) [thread overview]
Message-ID: <26423792.479621323656296884.JavaMail.weblogic@epml26> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1530 bytes --]
> From: Bruce Robertson <bruce.e.robertson@intel.com>
>
> The bottom three bits of the register are don't care bits. The LSB
> value is 625 uV. Adjust the returned values appropriately
>
> Signed-off-by: Bruce Robertson <bruce.e.robertson@intel.com>
> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> ---
> drivers/power/max17042_battery.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
> index 001eca1..80a6ee7 100644
> --- a/drivers/power/max17042_battery.c
> +++ b/drivers/power/max17042_battery.c
> @@ -148,11 +148,15 @@ static int max17042_get_property(struct power_supply *psy,
> break;
> case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> val->intval = max17042_read_reg(chip->client,
> - MAX17042_VCELL) * 83; /* 1000 / 12 = 83 */
> + MAX17042_VCELL);
> + val->intval >>= 3;
> + val->intval *= 625; /* Units of LSB = 625 uV */
> break;
> case POWER_SUPPLY_PROP_VOLTAGE_AVG:
> val->intval = max17042_read_reg(chip->client,
> - MAX17042_AvgVCELL) * 83;
> + MAX17042_AvgVCELL);
> + val->intval >>= 3;
> + val->intval *= 625; /* Units of LSB = 625 uV */
> break;
> case POWER_SUPPLY_PROP_CAPACITY:
> val->intval = max17042_read_reg(chip->client,
> --
> 1.7.7.3
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next reply other threads:[~2011-12-12 2:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 2:18 MyungJoo Ham [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-12-09 18:08 [PATCH v2 0/6] MAX17042 add support for maxim POR procedure dirk.brandewie
2011-12-09 18:08 ` [PATCH v2 5/6] max17042: Fix value scaling for VCELL and avgVCELL dirk.brandewie
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=26423792.479621323656296884.JavaMail.weblogic@epml26 \
--to=myungjoo.ham@samsung.com \
--cc=Jason.Wortham@maxim-ic.com \
--cc=bruce.e.robertson@intel.com \
--cc=cbouatmailru@gmail.com \
--cc=dg77.kim@samsung.com \
--cc=dirk.brandewie@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@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