Re: [PATCH v3 4/4] docs: iio: adxl345: update math and examples for scaling

From: David Lechner

Date: Sat Feb 14 2026 - 12:11:49 EST


On 2/8/26 9:05 AM, Taha Ed-Dafili wrote:
> Update the documentation to reflect the addition of event scaling
> and correct existing technical errors in scale values.
>
> key changes:
> - Fix the 62.5 g/LSB typo to 62.5 mg/LSB and add SI unit conversion.
> - Correct decimal precision of in_accel_scale and
> in_accel_scale_available to match actual SI unit (m/s^2)
> values reported by the driver.
> - Add sysfs example showing how to read and interpret the
> newly implemented event scale factor.
>
> Suggested-by: Jonathan Cameron <jic23@xxxxxxxxxx>
> Signed-off-by: Taha Ed-Dafili <0rayn.dev@xxxxxxxxx>
> ---
> Documentation/iio/adxl345.rst | 41 +++++++++++++++++++++++------------
> 1 file changed, 27 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst
> index 3ca6a78feb5b..321565699817 100644
> --- a/Documentation/iio/adxl345.rst
> +++ b/Documentation/iio/adxl345.rst
> @@ -13,7 +13,12 @@ This driver supports Analog Device's ADXL345/375 on SPI/I2C bus.
> * `ADXL375 <https://www.analog.com/ADXL375>`_
>
> The ADXL345 is a general-purpose, low-power, 3-axis accelerometer with selectable
> -measurement ranges. The ADXL345 supports the ±2 g, ±4 g, ±8 g, and ±16 g ranges.
> +measurement ranges. The ADXL345 supports the following ranges:
> +
> +- ±2g (approx. ±19.61 m/s^2)
> +- ±4g (approx. ±39.23 m/s^2)
> +- ±8g (approx. ±78.45 m/s^2)
> +- ±16g (approx. ±156.91 m/s^2)
>
> 2. Device Attributes
> ====================
> @@ -98,23 +103,23 @@ listed.
> +---------------------------------------------+---------------------------------------------+
> | in_accel_gesture_singletap_timeout | Single tap duration in [us] |
> +---------------------------------------------+---------------------------------------------+
> -| in_accel_gesture_singletap_value | Single tap threshold value in 62.5/LSB |
> +| in_accel_gesture_singletap_value | Single tap threshold value |
> +---------------------------------------------+---------------------------------------------+
> | in_accel_mag_falling_period | Inactivity time in seconds |
> +---------------------------------------------+---------------------------------------------+
> -| in_accel_mag_falling_value | Inactivity threshold value in 62.5/LSB |
> +| in_accel_mag_falling_value | Inactivity threshold value |
> +---------------------------------------------+---------------------------------------------+
> | in_accel_mag_adaptive_rising_en | Enable AC coupled activity on X axis |
> +---------------------------------------------+---------------------------------------------+
> | in_accel_mag_adaptive_falling_period | AC coupled inactivity time in seconds |
> +---------------------------------------------+---------------------------------------------+
> -| in_accel_mag_adaptive_falling_value | AC coupled inactivity threshold in 62.5/LSB |
> +| in_accel_mag_adaptive_falling_value | AC coupled inactivity threshold |
> +---------------------------------------------+---------------------------------------------+
> -| in_accel_mag_adaptive_rising_value | AC coupled activity threshold in 62.5/LSB |
> +| in_accel_mag_adaptive_rising_value | AC coupled activity threshold |
> +---------------------------------------------+---------------------------------------------+
> | in_accel_mag_rising_en | Enable activity detection on X axis |
> +---------------------------------------------+---------------------------------------------+
> -| in_accel_mag_rising_value | Activity threshold value in 62.5/LSB |
> +| in_accel_mag_rising_value | Activity threshold value |
> +---------------------------------------------+---------------------------------------------+
> | in_accel_x_gesture_singletap_en | Enable single tap detection on X axis |
> +---------------------------------------------+---------------------------------------------+
> @@ -126,6 +131,10 @@ listed.
> +---------------------------------------------+---------------------------------------------+
> | in_accel_z_gesture_singletap_en | Enable single tap detection on Z axis |
> +---------------------------------------------+---------------------------------------------+
> +| in_accel_gesture_scale | Tap threshold scale (0.612915 m/s^2). |
> ++---------------------------------------------+---------------------------------------------+
> +| in_accel_mag_scale | Activity threshold scale (0.612915 m/s^2). |
> ++---------------------------------------------+---------------------------------------------+

It looks like the others are in alphabetical order (or , so would
be nice to insert the new ones in the appropriate order.

(in_accel_mag_falling is also out of order, so that could be part
of the precursor cleanup patch)

Also, missing in_accel_mag_adaptive_scale (it was added in
the driver changes.)