On Thu, Jun 9, 2022 at 1:38 AM Jakob Hauser <jahau@xxxxxxxxxxxxxx> wrote: > The raw temperature value is a number of counts from a certain starting > point. The resolution of the temperature counts is different for the YAS > variants. > > Temperature compensation for YAS532 version AC seems to be handled differently. > It uses the deviation from 20 degree Celsius [1] whereas YAS530 and older > versions of YAS532 apply solely the t value as a multiplier [2][3]. > > In funtion yas5xx_read_raw(), add case IIO_CHAN_INFO_PROCESSED. Remove scale > of temperature as this isn't applied. > > Additionally correct sign of temperature channel in iio_chan_spec. It's already > defined that way in yas5xx_get_measure() function. > > [1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c#L442 > [2] https://github.com/NovaFusion/android_kernel_samsung_golden/blob/cm-12.1/drivers/sensor/compass/yas_mag_driver-yas530.c#L881-L883 > [3] https://github.com/LineageOS/android_kernel_samsung_msm8930-common/blob/lineage-18.1/drivers/sensors/geomagnetic/yas_mag_driver-yas53x.c#L856-L858 > > Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> > Signed-off-by: Jakob Hauser <jahau@xxxxxxxxxxxxxx> Thanks, my temperatures seem more accurate after this on YAS530. Patch does not seem urgent as the temperature does not see much usage outside of the device itself. Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Yours, Linus Walleij