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

From: Andy Shevchenko

Date: Tue Apr 28 2026 - 12:12:31 EST


On Tue, Apr 28, 2026 at 04:53:49PM +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.
>
> Although this is a change in the ABI, the current scale is objectively
> incorrect. A raw reading of 5000 (25°C) is currently reported as 25000°C,
> making the driver unusable with standard IIO tools. Given the magnitude
> of the error (factor of 1000) and the fact that the driver is relatively
> recent, fixing it to match the hardware specification is necessary.

Seems the analysis is wrong (as per Jonathan's comment in v1). What are the
user space tools you referring to?

--
With Best Regards,
Andy Shevchenko