mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 함명주 <myungjoo.ham@samsung.com>
To: Anton Vorontsov <cbouatmailru@gmail.com>,
	"dirk.brandewie@gmail.com" <dirk.brandewie@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	박경민 <kyungmin.park@samsung.com>,
	"Jason.Wortham@maxim-ic.com" <Jason.Wortham@maxim-ic.com>,
	"bruce.e.robertson@intel.com" <bruce.e.robertson@intel.com>,
	"Karol Lewandowski" <k.lewandowsk@samsung.com>
Subject: Re: Re: [PATCH 5/5] max17042: Change capacity property to use reported SOC register
Date: Wed, 14 Mar 2012 02:01:09 +0000 (GMT)	[thread overview]
Message-ID: <11735275.125381331690467424.JavaMail.weblogic@epml04> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1932 bytes --]

Anton Vorontsov<cbouatmailru@gmail.com>, 2012-03-14 03:34 (GMT+09:00)
> On Tue, Jan 24, 2012 at 09:26:08AM -0800, dirk.brandewie@gmail.com wrote:
> > From: Dirk Brandewie 
> > 
> > The SOC register (0dh) reports the state of charge before empty
> > compensation adjustments are applied.  The max value reported by this
> > register will decrease as the battery ages.
> > 
> > Use the RepSOC register (06h) to report the capacity of the
> > battery. RepSOC contains a filtered version of the battery capacity
> > after empty compensation adjustments have been applied.
> > 
> > Reported-by: Gary Keyes 
> > 
> > Signed-off-by: Dirk Brandewie 
> > ---
> >  drivers/power/max17042_battery.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
> > index 6e96b58..2194278 100644
> > --- a/drivers/power/max17042_battery.c
> > +++ b/drivers/power/max17042_battery.c
> > @@ -160,7 +160,7 @@ static int max17042_get_property(struct power_supply *psy,
> >   break;
> >   case POWER_SUPPLY_PROP_CAPACITY:
> >   val->intval = max17042_read_reg(chip->client,
> > - MAX17042_SOC) / 256;
> > + MAX17042_RepSOC) / 256;
> 
> Applied. But I don't get it: PROP_CAPACITY should report
> percents! And it looks that it reports something very
> different.

The 8 most significant bits show values in percents. The least 8 bits show 1/256 percents.

> 
> Also, if you look down the file, you'll see this:
> 
>         case POWER_SUPPLY_PROP_CHARGE_FULL:

I've just sent a patch to correct this problem: "max17042: fix CHARGE_FULL representation."



Cheers!
MyungJoo

--
MyungJoo Ham (ÇÔ¸íÁÖ), PHD
System S/W Lab, S/W Platform Team, Software Center
Samsung Electronics
Cell: +82-10-6714-2858
ÿôèº{.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¥

                 reply	other threads:[~2012-03-14  2:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=11735275.125381331690467424.JavaMail.weblogic@epml04 \
    --to=myungjoo.ham@samsung.com \
    --cc=Jason.Wortham@maxim-ic.com \
    --cc=bruce.e.robertson@intel.com \
    --cc=cbouatmailru@gmail.com \
    --cc=dirk.brandewie@gmail.com \
    --cc=k.lewandowsk@samsung.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

all inboxes | Powered by JetHome®