Re: [PATCH] iio: temperature: max30208: fix wrong scale value

From: Andy Shevchenko

Date: Tue Apr 28 2026 - 07:10:08 EST


On Tue, Apr 28, 2026 at 09:54:15AM +0100, Salah Triki wrote:
> The driver currently returns a scale of 5 for IIO_CHAN_INFO_SCALE, which
> leads to incorrect temperature readings.
>
> According to the MAX30208 datasheet, the temperature resolution is 0.005°C
> per LSB. Using IIO_VAL_FRACTIONAL with 5/1000 correctly represents this
> 16-bit resolution.
>
> Fix the scale value to ensure user space tools report the temperature
> correctly in Celsius.

> Fixes: 9ee95ae4cffd ("iio: temperature: Add driver support for Maxim
> MAX30208")

The tags should go with 1 tag per one (single) line. Do not wrap them.

> Signed-off-by: Salah Triki <salah.triki@xxxxxxxxx>

...

> case IIO_CHAN_INFO_SCALE:
> *val = 5;
> - return IIO_VAL_INT;
> + *val2 = 1000;
> + return IIO_VAL_FRACTIONAL;

Isn't it an ABI change?

--
With Best Regards,
Andy Shevchenko