Re: [RFC] [PATCH] Adding Intel Moorestown PMIC Battery Driver

From: Anton Vorontsov
Date: Fri Jan 15 2010 - 08:12:37 EST


On Fri, Jan 15, 2010 at 05:31:55PM +0530, Mahalingam, Nithish wrote:
[...]
> >> + unsigned int batt_charge_now; /* in mAS */
> >> + unsigned int batt_prev_charge_full; /* in mAS */
> >> + unsigned int batt_charge_rate; /* in units per second */
> >
> > Per include/linux/power_supply.h and
> > Documentation/power/power_supply_class.txt
> >
> > * All voltages, currents, charges, energies, time and temperatures in uV,
> > * uA, uAh, uWh, seconds and tenths of degree Celsius unless otherwise
> > * stated. It's driver's job to convert its raw values to units in which
> > * this class operates.
>
> I just now checked the hardware spec and it is indeed mAh. I will correct
> the comment appropriately.

Note, if the hardware reports the values in mAh (milli), the driver
still have to convert them to uAh (micro) before reporting the values
to userspace.

[...]
> > I think you can use threaded irq for this.
> >
> > See documentation for request_threaded_irq() in kernel/irq/manage.c.
> > And as an example of usage see drivers/mfd/wm8350-irq.c.
>
> Haa that is useful information... completely missed to read about this
> feature.

No wonder, it's just a new feature, not many know about it. ;-)

Once again, thanks for the driver!

--
Anton Vorontsov
email: cbouatmailru@xxxxxxxxx
irc://irc.freenode.net/bd2
--
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/