DISCONTINUED (October 2022): the maintenance for this repository has been discontinued. Please refer to https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio for the up-to-date drivers repository. This repository contains Linux Kernel (v3.10, v3.14, v3.18, v4.9, v4.14, v4.19) including STMicroelectronics MEMS IIO sensor support
According to the IIO ABI documentation the temperature output units are standardized:
Units after application of scale and offset are milli degrees Celsius.
Applying the following patch solves the problem.
Subject: [PATCH 1/1] Fix temperature scaling issue
According to the iio ABI documentation the units of the temperature
is mili degrees Celsius.
---
drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c b/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c
index 07e8e2d77f5f..9939c65a1e51 100644
--- a/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c
+++ b/drivers/iio/imu/st_ism330dhcx/st_ism330dhcx_core.c
@@ -781,7 +781,7 @@ static int st_ism330dhcx_read_raw(struct iio_dev *iio_dev,
case IIO_CHAN_INFO_SCALE:
switch (ch->type) {
case IIO_TEMP:
- *val = 1;
+ *val = 1000;
*val2 = ST_ISM330DHCX_TEMP_GAIN;
ret = IIO_VAL_FRACTIONAL;
break;
According to the IIO ABI documentation the temperature output units are standardized:
Applying the following patch solves the problem.
Edit: Currently the units are degrees C