]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: imu: st_lsm6dsx: add event spec parameter to iio_chan_spec initializer
authorFrancesco Lavra <flavra@baylibre.com>
Mon, 1 Dec 2025 10:00:17 +0000 (11:00 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:41:09 +0000 (11:41 +0000)
commit317c9bef82ebe369fd1dac428eac505b5b6ff531
tree5b88a5e121e19cc0131c2f72b425a81d87a5d983
parent855119fa0a58a0aa1d40fe9c7c5da437167ba9ba
iio: imu: st_lsm6dsx: add event spec parameter to iio_chan_spec initializer

In preparation for adding support for more event sources, add to the
ST_LSM6DSX_CHANNEL_ACC() iio_chan_spec initializer macro an iio_event_spec
array argument, so that this macro can be used with different arrays by
sensors that support different event sources; change the st_lsm6dsx_event
struct declaration to an array (renamed as st_lsm6dsx_ev_motion) so that it
can be passed to the macro (and opportunistically move it from the header
file where it does not belong to the C file where it is used).
In addition, remove from this macro the channel type parameter and
hard-code IIO_ACCEL in the macro definition, since all callers use
IIO_ACCEL as channel type argument.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
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