iio: st_sensors: Add lsm9ds0 IMU support
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 14 Apr 2021 19:54:53 +0000 (22:54 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 May 2021 12:54:22 +0000 (13:54 +0100)
commit6731ca3999ffa4c878a661b980759300dfb0237e
tree90ad3abb31a4380f369254584d17db918af0d2de
parentd61881ef7f08aef02d9bfc8c66f4c89c59cdf112
iio: st_sensors: Add lsm9ds0 IMU support

We can utilize separate drivers for accelerometer and magnetometer,
so here is the glue driver to enable LSM9DS0 IMU support.

The idea was suggested by Crestez Dan Leonard in [1]. The proposed change
was sent as RFC due to race condition concerns, which are indeed possible.

In order to amend the initial change, I went further by providing a specific
multi-instantiate probe driver that reuses existing accelerometer and
magnetometer.

[1]: https://lore.kernel.org/patchwork/patch/670353/

Suggested-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Cc: mr.lahorde@laposte.net
Cc: Matija Podravec <matija_podravec@fastmail.fm>
Cc: Sergey Borishchenko <borischenko.sergey@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/st_accel_core.c
drivers/iio/imu/Kconfig
drivers/iio/imu/Makefile
drivers/iio/imu/st_lsm9ds0/Kconfig [new file with mode: 0644]
drivers/iio/imu/st_lsm9ds0/Makefile [new file with mode: 0644]
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h [new file with mode: 0644]
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c [new file with mode: 0644]
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c [new file with mode: 0644]
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c [new file with mode: 0644]
drivers/iio/magnetometer/st_magn_core.c
include/linux/iio/common/st_sensors.h