[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080508171320.GA8226@polina.dev.rtsoft.ru>
Date: Thu, 8 May 2008 21:13:20 +0400
From: Anton Vorontsov <avorontsov@...mvista.com>
To: Andres Salomon <dilinger@...ued.net>
Cc: Andrew Morton <akpm@...ux-foundation.org>, cbou@...l.ru,
linux-kernel@...r.kernel.org, dwmw2@...radead.org,
richard@...top.org
Subject: Re: [PATCH] power_supply: support CHARGE_NOW in OLPC battery
On Thu, May 08, 2008 at 01:01:02PM -0400, Andres Salomon wrote:
> Ok, CC'ing Richard as I should've done in the first place...
[...]
> > > + case POWER_SUPPLY_PROP_CHARGE_NOW:
> > > + ret = olpc_ec_cmd(EC_BAT_ACR, NULL, 0, (void
> > > *)&ec_word, 2);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + val->intval = be16_to_cpu(ec_word);
> >
> > But you didn't convert it to the uAh, I think you should.
>
>
> We have logic in userspace that converts ACR to a useful number; for
> our purposes, we'd just like to read the raw ACR values.
No. The purpose of power supply class is to report values in common
units. Not some random value that userspace then should guess how to
compute.
> Perhaps CHARGE_NOW is the wrong thing to be using, if we can't get
> uAh and CHARGE_* requires that unit.
I don't think that converting X * uAh or uAh / Y to uAh is impossible.
I'd suggest you to convert the ACR value to uAh using fractions, see
ds2760_battery.c. Even if the final value losing precision a bit, it is
still useful to do CHARGE_NOW.
Of course, additionally you can create your own private attribute
which reports raw value, if this is anyhow useful.
--
Anton Vorontsov
email: cbouatmailru@...il.com
irc://irc.freenode.net/bd2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists