lkml.org 
[lkml]   [2010]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] power/ds2760_battery: make charge_now and charge_full writeable
(sorry for the late follow-up)

On Tue, May 11, 2010 at 10:05:51PM +0400, Anton Vorontsov wrote:
> On Tue, May 11, 2010 at 07:28:59PM +0200, Daniel Mack wrote:
> [...]
> > > 1. Could you at least change this back to
> > > POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, so it'll be clear what
> > > exactly this prop is actually changing, and
> >
> > Do you see any other way to store the actual rated capacity (not the one
> > the battery had in its good days) inside the chip?
>
> In that case it should be indeed POWER_SUPPLY_PROP_CHARGE_FULL,
> which is full_active_uAh, which we get from di->raw[DS2760_ACTIVE_FULL]
> and di->raw[DS2760_ACTIVE_FULL + 1].
>
> We fall back to deriving it from rated_capacity if full_active
> is 0 (your case?):
>
> /* If the full_active_uAh value is not given, fall back to the rated
> * capacity. This is likely to happen when chips are not part of the
> * battery pack and is therefore not bootstrapped. */
> if (di->full_active_uAh == 0)
> di->full_active_uAh = di->rated_capacity / 1000L;
>
> So, you probably want to make DS2760_ACTIVE_FULL writable, not
> DS2760_RATED_CAPACITY.

Ah of course. And DS2760_ACTIVE_FULL is 16bit wide, so we also get rid
of the range problem.

Thanks,
Daniel


\
 
 \ /
  Last update: 2010-05-18 20:27    [W:0.090 / U:25.400 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site