[PATCH v4 0/4] iio: accel: adxl345: Implement event scaling and ABI compliance

From: Taha Ed-Dafili

Date: Sat Feb 21 2026 - 09:13:12 EST


This series addresses ADXL345 driver non-compliance with the IIO ABI for
event thresholds.

Currently, the driver exposes raw values for thresholds
(e.g., tap, activity) without providing the necessary scale factor to
convert them to SI units (m/s^2), as mandated by the ABI.

This series implements `IIO_EV_INFO_SCALE` in the IIO core and applies it
to the ADXL345 driver, ensuring that userspace can correctly interpret
threshold values. It also cleans up existing documentation errors and
typos.

Changes in v4:
- Patch 3: Fix missing IIO_EV_INFO_SCALE handling for MAG/MAG_ADAPTIVE
events by moving the check to the top of adxl345_read_event_value().
- Patch 3: Explicitly reject writes to IIO_EV_INFO_SCALE with -EINVAL.
- Patch 3: Fix bitmask ordering and whitespace alignment in event spec
arrays.
- Patch 4: Update documentation table with the exact sysfs scale
attributes generated by the IIO core.
- Patch 4: Sort the entire event attribute table alphabetically
(David Lechner).

Changes in v3:
- Patch 1: Revert "axis" to "axes" in documentation.
- Patch 2: Reword commit message to "Implement support for".
- Patch 4: Remove repetitive scale values from every table row.
- Patch 4: Fix typo in commit message.

Changes in v2:
- Add core infrastructure for IIO_EV_INFO_SCALE.
- Implement event scaling (0.612915 m/s^2) for ADXL345.
- Fix technical math and decimal errors in documentation.
- Clean up grammar and pluralization in .rst file.

I would like to thank Jonathan Cameron for catching the missing MAG scale
handling via static analysis, David Lechner for the alphabetical and
bitmask ordering feedback, and Andy Shevchenko and Randy Dunlap for
catching the whitespace inconsistencies.

Taha Ed-Dafili (4):
docs: iio: adxl345: fix typos and grammar
iio: core: Add IIO_EV_INFO_SCALE to event info
iio: accel: adxl345: Implement event scaling for ABI compliance
docs: iio: adxl345: update math and examples for scaling

Documentation/iio/adxl345.rst | 79 ++++++++++++++++++++------------
drivers/iio/accel/adxl345_core.c | 37 ++++++++++-----
drivers/iio/industrialio-event.c | 1 +
include/linux/iio/types.h | 1 +
4 files changed, 78 insertions(+), 40 deletions(-)

--
2.47.3