Re: [PATCH v5 4/5] iio: accel: adxl345: Implement event scaling for ABI compliance

Andy Shevchenko
2026-02-24T14:58:26Z

On Tue, Feb 24, 2026 at 02:03:47PM +0000, Taha Ed-Dafili wrote:
> The ADXL345 uses a fixed threshold resolution of 62.5 mg/LSB for
> event-related registers. Previously, the driver reported raw
> values without a scale factor.
>
> Implement IIO_EV_INFO_SCALE for all event types to provide the
> conversion factor (0.612915 m/s^2) as required by the IIO ABI.
>
> Consequently, remove the obsolete comment in adxl345_read_event_value()
> which stated that the scale factor is not applied.
>
> Add explicit write rejection for IIO_EV_INFO_SCALE in
> adxl345_write_event_value() returning -EINVAL.

...

> .mask_shared_by_type =
> BIT(IIO_EV_INFO_ENABLE) |
> - BIT(IIO_EV_INFO_VALUE),
> + BIT(IIO_EV_INFO_VALUE) |
> + BIT(IIO_EV_INFO_SCALE),

Why SCALE can't be squeezed before VALUE? This change brings unneeded churn.

--
With Best Regards,
Andy Shevchenko