]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
iio: imu: st_lsm6dsx: add support to LSM6DSRX
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 24 Oct 2019 15:42:33 +0000 (17:42 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 27 Oct 2019 16:38:06 +0000 (16:38 +0000)
Add support to STM LSM6DSRX 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dsrx.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/st_lsm6dsx/Kconfig
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c

index b425a356d99e7f8c2eedb4e4bf2b397020507717..28f59d09208afb9a37b4cda93bd887c5d38f98fe 100644 (file)
@@ -12,7 +12,8 @@ config IIO_ST_LSM6DSX
          Say yes here to build support for STMicroelectronics LSM6DSx imu
          sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm,
          ism330dlc, lsm6dso, lsm6dsox, asm330lhh, lsm6dsr, lsm6ds3tr-c,
-         ism330dhcx, lsm6ds0 and the accelerometer/gyroscope of lsm9ds1.
+         ism330dhcx, lsm6dsrx, lsm6ds0 and the accelerometer/gyroscope
+         of lsm9ds1.
 
          To compile this driver as a module, choose M here: the module
          will be called st_lsm6dsx.
index f660359ccb4d5a74d6c3ed369d5700fb3e643580..37e499fe6bcf9e59c5e9d50def59091d6c50df5f 100644 (file)
@@ -27,6 +27,7 @@
 #define ST_ISM330DHCX_DEV_NAME "ism330dhcx"
 #define ST_LSM9DS1_DEV_NAME    "lsm9ds1-imu"
 #define ST_LSM6DS0_DEV_NAME    "lsm6ds0"
+#define ST_LSM6DSRX_DEV_NAME   "lsm6dsrx"
 
 enum st_lsm6dsx_hw_id {
        ST_LSM6DS3_ID,
@@ -42,6 +43,7 @@ enum st_lsm6dsx_hw_id {
        ST_ISM330DHCX_ID,
        ST_LSM9DS1_ID,
        ST_LSM6DS0_ID,
+       ST_LSM6DSRX_ID,
        ST_LSM6DSX_MAX_ID,
 };
 
index ffeb2596b97b37f10037b6a2134368010c296a56..31cd90d2c60ec75ab2165be33ee409020331f347 100644 (file)
  * (e.g. Gx, Gy, Gz, Ax, Ay, Az), then data are repeated depending on the
  * value of the decimation factor and ODR set for each FIFO data set.
  *
- * LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/ISM330DHCX: The FIFO buffer can be
- * configured to store data from gyroscope and accelerometer. Each sample
- * is queued with a tag (1B) indicating data source (gyroscope, accelerometer,
- * hw timer).
+ * LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/LSM6DSRX/ISM330DHCX:
+ * The FIFO buffer can be configured to store data from gyroscope and
+ * accelerometer. Each sample is queued with a tag (1B) indicating data
+ * source (gyroscope, accelerometer, hw timer).
  *
  * FIFO supported modes:
  *  - BYPASS: FIFO disabled
index f9c83aa2c9b7a52163016c4dd5a8671170e5c8ae..1f28a7733fc07e2afc9a04b83f5499048700a2a9 100644 (file)
@@ -1084,6 +1084,9 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
                        }, {
                                .hw_id = ST_ISM330DHCX_ID,
                                .name = ST_ISM330DHCX_DEV_NAME,
+                       }, {
+                               .hw_id = ST_LSM6DSRX_ID,
+                               .name = ST_LSM6DSRX_DEV_NAME,
                        },
                },
                .channels = {
index e57744affbd0f6a6d9d19bfb2c5c5970692909e7..cd47ec1fedcb92aeb0dc9b88adb8f8b7dd123a8f 100644 (file)
@@ -91,6 +91,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
                .compatible = "st,lsm6ds0",
                .data = (void *)ST_LSM6DS0_ID,
        },
+       {
+               .compatible = "st,lsm6dsrx",
+               .data = (void *)ST_LSM6DSRX_ID,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
@@ -109,6 +113,7 @@ static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
        { ST_ISM330DHCX_DEV_NAME, ST_ISM330DHCX_ID },
        { ST_LSM9DS1_DEV_NAME, ST_LSM9DS1_ID },
        { ST_LSM6DS0_DEV_NAME, ST_LSM6DS0_ID },
+       { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID },
        {},
 };
 MODULE_DEVICE_TABLE(i2c, st_lsm6dsx_i2c_id_table);
index 933d4f9f6a4a7a0bb79ee929b4272351bc0899a3..67ff36eac24769e3488155f8b25550f62f5e1788 100644 (file)
@@ -91,6 +91,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
                .compatible = "st,lsm6ds0",
                .data = (void *)ST_LSM6DS0_ID,
        },
+       {
+               .compatible = "st,lsm6dsrx",
+               .data = (void *)ST_LSM6DSRX_ID,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
@@ -109,6 +113,7 @@ static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
        { ST_ISM330DHCX_DEV_NAME, ST_ISM330DHCX_ID },
        { ST_LSM9DS1_DEV_NAME, ST_LSM9DS1_ID },
        { ST_LSM6DS0_DEV_NAME, ST_LSM6DS0_ID },
+       { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID },
        {},
 };
 MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);