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

From: David Lechner

Date: Sat Feb 14 2026 - 12:09:43 EST


On 2/14/26 11:02 AM, David Lechner wrote:
> On 2/8/26 9:05 AM, 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.
>>
>> Suggested-by: Jonathan Cameron <jic23@xxxxxxxxxx>
>> Signed-off-by: Taha Ed-Dafili <0rayn.dev@xxxxxxxxx>
>> ---
>> drivers/iio/accel/adxl345_core.c | 28 ++++++++++++++++++++++------
>> 1 file changed, 22 insertions(+), 6 deletions(-)
>>

...

>> @@ -228,15 +230,19 @@ static const struct iio_event_spec adxl345_events[] = {
>> .type = IIO_EV_TYPE_GESTURE,
>> .dir = IIO_EV_DIR_SINGLETAP,
>> .mask_separate = BIT(IIO_EV_INFO_ENABLE),
>> - .mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) |
>> + .mask_shared_by_type =
>> + BIT(IIO_EV_INFO_VALUE) |
>> + BIT(IIO_EV_INFO_SCALE) |
>
> What is the units for gesture that we are scaling to?

After looking at the docs, I understand this now, so no need
to reply.

>
>> BIT(IIO_EV_INFO_TIMEOUT),
>> },