summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-12-04 07:53:00 -0800
committerGuenter Roeck <linux@roeck-us.net>2022-07-13 08:38:17 -0700
commitb2644494a4c7145a05af01bee1df8549a71efc20 (patch)
tree5bd3cddca1bc5cbf92ddc5966a51db9b9bd86a1c /tools/perf/scripts/python/export-to-postgresql.py
parentd70fa73d84337e7197336e137e221d93792844f7 (diff)
hwmon: (lm90) Add support for unsigned and signed temperatures
ADT7461 and TMP451 temperature sensors support extended temperature ranges. If standard temperature range is selected, the temperature range is unsigned and limited to 0 .. 127 degrees C. For TMP461, the standard temperature range is -128000 ... 127000 degrees C. Distinguish between the two chips by introducing a feature flag indicating if the standard temperature range is signed or unsigned. Use the same flag for MAX6646/ MAX6647 as well since those chips also support unsigned temperatures. Note that while the datasheet for ADT7461 suggests that the default temperature range is unsigned, tests with a real chip suggest that this is not the case: If the temperature offset is set to a value << 0, the temperature register does report negative values. Tests with real chips show that MAX6680/MAX6681 and SA56004 report temperatures of 128 degrees C and higher as negative temperatures. Add respective comments to the code. Also use clamp_val() and DIV_ROUND_CLOSEST where appropriate in calculations. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions