Re: [PATCH 2/3] power/ds2760_battery: make charge_now andcharge_full writeable

From: Daniel Mack
Date: Tue May 18 2010 - 14:24:45 EST


(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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/