Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: accel: adxl345: Expose IIO_EV_INFO_VALUE for double tap

The ADXL345 uses a single hardware register (ADXL345_REG_THRESH_TAP) to
store the threshold for both single tap and double tap events.

Currently, the driver only exposes the IIO_EV_INFO_VALUE attribute for
the single tap event.

However, the IIO ABI dictates that if an event is supported, its
associated configuration attributes should be exposed to userspace. This
applies even if writing to one channel property alters the value of
another due to shared underlying hardware state.

Add IIO_EV_INFO_VALUE to the double tap event specification to ensure
full ABI compliance.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Taha Ed-Dafili and committed by
Jonathan Cameron
da29db0b 2a76a626

+3 -1
+3 -1
drivers/iio/accel/adxl345_core.c
··· 235 235 /* double tap */ 236 236 .type = IIO_EV_TYPE_GESTURE, 237 237 .dir = IIO_EV_DIR_DOUBLETAP, 238 - .mask_shared_by_type = BIT(IIO_EV_INFO_ENABLE) | 238 + .mask_shared_by_type = 239 + BIT(IIO_EV_INFO_ENABLE) | 240 + BIT(IIO_EV_INFO_VALUE) | 239 241 BIT(IIO_EV_INFO_RESET_TIMEOUT) | 240 242 BIT(IIO_EV_INFO_TAP2_MIN_DELAY), 241 243 },