lkml.org 
[lkml]   [2013]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bq27x00_battery: Fix reporting battery temperature
On Sun, Feb 03, 2013 at 09:01:54PM +0100, Pali Rohár wrote:
> On Sunday 03 February 2013 04:44:51 Anton Vorontsov wrote:
> > On Sat, Feb 02, 2013 at 11:06:09AM +0100, Pali Rohár wrote:
> > > Reported temperature can be also negative, so cache value in
> > > non negative Kelvin degree.
> > >
> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > ---
> >
> > Applied, thanks!
>
> Now I looked at bq27x00_battery and rx51_battery drivers and I
> see that both drivers reporting temperature in different units.
> bq27x00_battery in 1/10 °C and rx51_battery in 1/100 °C. What is
> correct degree for kernel power power supply API? Maybe other
> kernel drivers have different units too... Note that my above
> patch did not changed anything units, only fixed reporting
> (possible) negative temperature.

Per Documentation/power/power_supply_class.txt and power_supply.h:

/*
* All voltages, currents, charges, energies, time and temperatures in uV,
* µA, µAh, µWh, 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.
*/

Feel free to fix the offending drivers.

Thanks,

Anton
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-02-03 22:01    [W:2.086 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site