Skip to content

scpi-sensors: Fix SCP sensor readings scale

Guenter Roeck linux-amlogic linux-arm-kernel linux-hwmon 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest0 of 2 patches 0 repliesNew
  2. v11 of 2 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] scpi-sensors: Fix SCP sensor readings scale
Quoted 22 lines · Carlo Caione
Quoted 21 lines · Carlo Caione

From: Carlo Caione <[email protected]>

The implementation details for SCPI seems to suggest that the sensor readings must be reported by SCP using a well defined scale (millidegree Celsius for temperature, millivolts for voltage, milliamperes for current, microwatts for power and microjoules for energy).

This is also important for the interaction with other subsystems: for example both the thermal sub-system and the hwmon sysfs interface expect the temperature expressed in millidegree Celsius.

Unfortunately since this behaviour is dependent on the firmware implementation there are cases where the sensor readings are reported using a different scale. For example in the Amlogic SoCs the temperature is reported in degree and not millidegree Celsius.

In this patchset we introduce a new DT property scpi,sensors-scale that is used by the scpi-hwmon driver to convert the sensor readings to the expected scale.

Quoted 8 lines
Quoted 5 lines

v2:
- Added data validation (scale != 0)
- s/unsigned int/u32/ for the array
- Switched to array initialiser notation
- Introduced scpi_scale_reading()

gentle ping

Waiting for Rob to provide feedback on the devicetree property.

Guenter