iio: st_gyro: Add lsm9ds0-gyro support
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Tue, 19 Apr 2016 12:02:11 +0000 (15:02 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sat, 23 Apr 2016 21:47:18 +0000 (22:47 +0100)
This device has an identical interface to other supported sensors and the patch
only adds IDs.

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/devicetree/bindings/iio/st-sensors.txt
drivers/iio/gyro/Kconfig
drivers/iio/gyro/st_gyro.h
drivers/iio/gyro/st_gyro_core.c
drivers/iio/gyro/st_gyro_i2c.c
drivers/iio/gyro/st_gyro_spi.c

index 637e283f4a8b5a81a9b0585a13d967a3ea7fb32c..5844cf72862de4a543b4519387e2e0147ab4f626 100644 (file)
@@ -51,6 +51,7 @@ Gyroscopes:
 - st,l3gd20-gyro
 - st,l3g4is-gyro
 - st,lsm330-gyro
+- st,lsm9ds0-gyro
 
 Magnetometers:
 - st,lsm303agr-magn
index e816d29d6a62353540e2885156a181e9cefa6b41..205a84420ae9a7baed5b698df9c7202bdafcac82 100644 (file)
@@ -93,7 +93,7 @@ config IIO_ST_GYRO_3AXIS
        select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
        help
          Say yes here to build support for STMicroelectronics gyroscopes:
-         L3G4200D, LSM330DL, L3GD20, LSM330DLC, L3G4IS, LSM330.
+         L3G4200D, LSM330DL, L3GD20, LSM330DLC, L3G4IS, LSM330, LSM9DS0.
 
          This driver can also be built as a module. If so, these modules
          will be created:
index 5353d6328c544486db09b52cdcf2c25d5fa50598..a5c5c4e29addc38a94c4a5683f64904550ed32d2 100644 (file)
@@ -21,6 +21,7 @@
 #define L3GD20_GYRO_DEV_NAME           "l3gd20"
 #define L3G4IS_GYRO_DEV_NAME           "l3g4is_ui"
 #define LSM330_GYRO_DEV_NAME           "lsm330_gyro"
+#define LSM9DS0_GYRO_DEV_NAME          "lsm9ds0_gyro"
 
 /**
  * struct st_sensors_platform_data - gyro platform data
index be9057e89dc3d83eb92f170822c748d0ef48f79d..52a3c87c375ca62c027f66aa3de89d2c01c6fae7 100644 (file)
@@ -204,6 +204,7 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
                        [2] = LSM330DLC_GYRO_DEV_NAME,
                        [3] = L3G4IS_GYRO_DEV_NAME,
                        [4] = LSM330_GYRO_DEV_NAME,
+                       [5] = LSM9DS0_GYRO_DEV_NAME,
                },
                .ch = (struct iio_chan_spec *)st_gyro_16bit_channels,
                .odr = {
index 6848451f817a239bc853f8bd90eda7aa98935282..40056b82103640b467db0c10733555476928aaec 100644 (file)
@@ -48,6 +48,10 @@ static const struct of_device_id st_gyro_of_match[] = {
                .compatible = "st,lsm330-gyro",
                .data = LSM330_GYRO_DEV_NAME,
        },
+       {
+               .compatible = "st,lsm9ds0-gyro",
+               .data = LSM9DS0_GYRO_DEV_NAME,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_gyro_of_match);
@@ -93,6 +97,7 @@ static const struct i2c_device_id st_gyro_id_table[] = {
        { L3GD20_GYRO_DEV_NAME },
        { L3G4IS_GYRO_DEV_NAME },
        { LSM330_GYRO_DEV_NAME },
+       { LSM9DS0_GYRO_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(i2c, st_gyro_id_table);
index d2b7a5fa344c1c9f60748d0faf92a1bfa7cff56c..fbf2faed501c8628ed23d0ff0fa7590f6e091c01 100644 (file)
@@ -54,6 +54,7 @@ static const struct spi_device_id st_gyro_id_table[] = {
        { L3GD20_GYRO_DEV_NAME },
        { L3G4IS_GYRO_DEV_NAME },
        { LSM330_GYRO_DEV_NAME },
+       { LSM9DS0_GYRO_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(spi, st_gyro_id_table);