summaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu
diff options
context:
space:
mode:
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>2022-01-10 18:24:32 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-01-23 18:03:35 +0000
commit26b2ec2e9a27f881998b830fd5158f8a30de82a1 (patch)
tree8c661384116c266d6d1af1b5e8403463351b7d0c /drivers/iio/imu
parent2553340bd208cc2e54a9e6a27d948a2b51dbf3a1 (diff)
downloadlinux-26b2ec2e9a27f881998b830fd5158f8a30de82a1.tar.bz2
iio: st_sensors: don't always auto-enable I2C and SPI interface drivers
This patch makes I2C and SPI interface drivers for STMicroelectronics sensor chips individually selectable via Kconfig. The default is kept unchanged - I2C and SPI interface drivers are still selected by default if the corresponding bus support is available. However, the patch makes it possible to explicitly disable drivers that are not needed for a particular target. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220110152432.3799227-1-nikita.yoush@cogentembedded.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu')
-rw-r--r--drivers/iio/imu/st_lsm9ds0/Kconfig28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/iio/imu/st_lsm9ds0/Kconfig b/drivers/iio/imu/st_lsm9ds0/Kconfig
index 53b7017014f8..d29558edee60 100644
--- a/drivers/iio/imu/st_lsm9ds0/Kconfig
+++ b/drivers/iio/imu/st_lsm9ds0/Kconfig
@@ -5,8 +5,6 @@ config IIO_ST_LSM9DS0
depends on (I2C || SPI_MASTER) && SYSFS
depends on !SENSORS_LIS3_I2C
depends on !SENSORS_LIS3_SPI
- select IIO_ST_LSM9DS0_I2C if I2C
- select IIO_ST_LSM9DS0_SPI if SPI_MASTER
select IIO_ST_ACCEL_3AXIS
select IIO_ST_MAGN_3AXIS
@@ -17,12 +15,30 @@ config IIO_ST_LSM9DS0
To compile this driver as a module, choose M here: the module
will be called st_lsm9ds0.
+ Also need to enable at least one of I2C and SPI interface drivers
+
config IIO_ST_LSM9DS0_I2C
- tristate
- depends on IIO_ST_LSM9DS0
+ tristate "STMicroelectronics LSM9DS0 IMU I2C interface"
+ depends on I2C && IIO_ST_LSM9DS0
+ default I2C && IIO_ST_LSM9DS0
+ select IIO_ST_ACCEL_I2C_3AXIS
+ select IIO_ST_MAGN_I2C_3AXIS
select REGMAP_I2C
+ help
+ Build support for STMicroelectronics LSM9DS0 IMU I2C interface.
+
+ To compile this driver as a module, choose M here. The module
+ will be called st_lsm9ds0_i2c.
config IIO_ST_LSM9DS0_SPI
- tristate
- depends on IIO_ST_LSM9DS0
+ tristate "STMicroelectronics LSM9DS0 IMU SPI interface"
+ depends on SPI_MASTER && IIO_ST_LSM9DS0
+ default SPI_MASTER && IIO_ST_LSM9DS0
+ select IIO_ST_ACCEL_SPI_3AXIS
+ select IIO_ST_MAGN_SPI_3AXIS
select REGMAP_SPI
+ help
+ Build support for STMicroelectronics LSM9DS0 IMU I2C interface.
+
+ To compile this driver as a module, choose M here. The module
+ will be called st_lsm9ds0_spi.