Re: [PATCH] iio: proximity: hx9023s: fix scan_type endianness

From: Andy Shevchenko
Date: Wed Jul 23 2025 - 10:14:01 EST


On Tue, Jul 22, 2025 at 06:08:37PM -0500, David Lechner wrote:
> On 7/22/25 6:07 PM, David Lechner wrote:
> > Change the scan_type endianness from IIO_BE to IIO_LE. This matches
> > the call to cpu_to_le16() in hx9023s_trigger_handler() that formats
> > the data before pushing it to the IIO buffer.

> It is odd to have data already in CPU-endian and convert it to LE
> before pushing to buffers. So I'm a bit tempted to do this instead
> since it probably isn't likely anyone is using this on a big-endian
> system:

I can say that first of all, we need to consult with the datasheet for the
actual HW endianess. And second, I do not believe that CPU endianess may be
used, I can't imagine when this (discrete?) component can be integrated in such
a way. That said, I think your second approach even worse.

--
With Best Regards,
Andy Shevchenko