]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: imu: st_lsm6dsx: make event management functions generic
authorFrancesco Lavra <flavra@baylibre.com>
Mon, 1 Dec 2025 10:00:15 +0000 (11:00 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:10:26 +0000 (11:10 +0000)
commitc93e8f091baca406981e0468264ed8747285cae6
tree20f22fcee3412d324764362fb7df39d9ae0a9179
parentb008b1ff0ce005e998bb4c7e876ffa2d31a1e511
iio: imu: st_lsm6dsx: make event management functions generic

In preparation for adding support for more event types, use an array
indexed by event ID instead of a scalar value to store enabled events, and
refactor the functions to configure and report events so that their
implementation is not specific for wakeup events. Move the logic to update
the global event interrupt enable flag from st_lsm6dsx_event_setup() to its
calling function, so that it can take into account also event sources
different from the source being configured. While changing the signature of
the st_lsm6dsx_event_setup() function, opportunistically add the currently
unused `axis` parameter, which will be used when adding support for
enabling and disabling events on a per axis basis.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c