[PATCH] hwmon: (scpi) Add slope and offset to SCP sensor readings

Carlo Caione carlo at caione.org
Wed Mar 1 10:45:50 PST 2017


On Wed, Mar 1, 2017 at 6:56 PM, Guenter Roeck <linux at roeck-us.net> wrote:
> On Wed, Mar 01, 2017 at 04:57:00PM +0000, Punit Agrawal wrote:

>> Another way to fix this would be to add optional properties to the scpi
>> sensors binding and use them instead. This could then be used to fixup
>> values reported to both thermal and hwmon.
>>
>
> Yes, this would be much more appropriate.

What about something like:

sensor-coefficients = <x1 y1 z1>,
                                  <x2 y2 z2>,
                                  ...;

Where in general `x` is the sensor-id, `y` the slope and `z` the
offset for the sensor reading.
So the reported reading to hwmon (and thermal for temperature) for
sensor with id `x1` is `y1 * val + z1`, the same for sensor with id x2
and so on for all the sensors in the array.

-- 
Carlo Caione



More information about the linux-amlogic mailing list