lkml.org 
[lkml]   [2012]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjecthwmon : raw reading -> temperature conversion
Hi,

I have a question related to hwmon driver and need suggestions.

I am working on a temperature sensor driver that is hwmon driver.
- The temperature is calculated from raw sensor reading and
certain initialization parameters.
- Raw reading obtained from 2 different sensor instances under
same conditions can differ. Further, initialization parameters
are specific to each hardware instance.
- Expressions with floating point operands are used to compute
the temperature value.

In our platform there are multiple kernel level clients to the
temperature sensor driver.
Hence I am planning to present temperature to these clients
from kernel driver itself.

But looking at the hwmon linux documentation, seems the sensor
kernel drivers should report only raw readings.
The raw readings can be converted into required output,
e.g. temperature in this case, by respective user space implementation.

However because of my driver clients being in kernel space, I am
thinking of doing fixed point calculations in the sensor driver
and get the temperature corresponding to raw sensor readings.

Please let me know if this a correct approach?

If there is a better way, please suggest.

-regards,
Bitan




\
 
 \ /
  Last update: 2012-08-10 17:02    [W:0.689 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site