From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: Philip Rakity <prakity@marvell.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "Anton Vorontsov" <cbouatmailru@gmail.com>,
박경민 <kyungmin.park@samsung.com>
Subject: Re: [PATCH] power: max17042: do not lose accuracy calculating current_now
Date: Tue, 16 Aug 2011 06:12:57 +0000 (GMT) [thread overview]
Message-ID: <26076760.93301313475177035.JavaMail.weblogic@epml13> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1260 bytes --]
Philip Rakity<prakity@marvell.com> Date : 2011-08-13 13:19 (GMT+09:00)
>
> PROP_CURRENT_NOW value is first divided then multiplied up
> causing a lose of accuracy. Use the same method as
> PROP_CURRENT_AVG to do the calculation.
>
> Signed-off-by: Philip Rakity
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> ---
> drivers/power/max17042_battery.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
> index 4245806..7b7762a 100644
> --- a/drivers/power/max17042_battery.c
> +++ b/drivers/power/max17042_battery.c
> @@ -153,8 +153,7 @@ static int max17042_get_property(struct power_supply *psy,
> val->intval++;
> val->intval *= -1;
> }
> - val->intval >>= 4;
> - val->intval *= 1000000 * 25 / chip->pdata->r_sns;
> + val->intval *= 1562500 / chip->pdata->r_sns;
> } else {
> return -EINVAL;
> }
> --
> 1.7.0.4
>
>
>
MyungJoo Ham (ÇÔ¸íÁÖ)
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033ÿôèº{.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-08-16 6:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 6:12 MyungJoo Ham [this message]
2011-08-19 16:50 ` [PATCH] power: max17042: do not lose accuracy calculating current_now Anton Vorontsov
-- strict thread matches above, loose matches on Subject: below --
2011-08-13 4:19 Philip Rakity
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=26076760.93301313475177035.JavaMail.weblogic@epml13 \
--to=myungjoo.ham@samsung.com \
--cc=cbouatmailru@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prakity@marvell.com \
/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