diff options
author | Crestez Dan Leonard <leonard.crestez@intel.com> | 2016-04-19 08:02:11 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-04-23 17:47:18 -0400 |
commit | 41c128cb25cee72be66397fae8ceb8dc0c2c6984 (patch) | |
tree | 565790d53c48d521f970c7ed6c32fe1784f7a3de | |
parent | f21122593d99c7e051891da1b148c771b7d56e07 (diff) |
iio: st_gyro: Add lsm9ds0-gyro support
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>
-rw-r--r-- | Documentation/devicetree/bindings/iio/st-sensors.txt | 1 | ||||
-rw-r--r-- | drivers/iio/gyro/Kconfig | 2 | ||||
-rw-r--r-- | drivers/iio/gyro/st_gyro.h | 1 | ||||
-rw-r--r-- | drivers/iio/gyro/st_gyro_core.c | 1 | ||||
-rw-r--r-- | drivers/iio/gyro/st_gyro_i2c.c | 5 | ||||
-rw-r--r-- | drivers/iio/gyro/st_gyro_spi.c | 1 |
6 files changed, 10 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt index 637e283f4a8b..5844cf72862d 100644 --- a/Documentation/devicetree/bindings/iio/st-sensors.txt +++ b/Documentation/devicetree/bindings/iio/st-sensors.txt | |||
@@ -51,6 +51,7 @@ Gyroscopes: | |||
51 | - st,l3gd20-gyro | 51 | - st,l3gd20-gyro |
52 | - st,l3g4is-gyro | 52 | - st,l3g4is-gyro |
53 | - st,lsm330-gyro | 53 | - st,lsm330-gyro |
54 | - st,lsm9ds0-gyro | ||
54 | 55 | ||
55 | Magnetometers: | 56 | Magnetometers: |
56 | - st,lsm303agr-magn | 57 | - st,lsm303agr-magn |
diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig index e816d29d6a62..205a84420ae9 100644 --- a/drivers/iio/gyro/Kconfig +++ b/drivers/iio/gyro/Kconfig | |||
@@ -93,7 +93,7 @@ config IIO_ST_GYRO_3AXIS | |||
93 | select IIO_TRIGGERED_BUFFER if (IIO_BUFFER) | 93 | select IIO_TRIGGERED_BUFFER if (IIO_BUFFER) |
94 | help | 94 | help |
95 | Say yes here to build support for STMicroelectronics gyroscopes: | 95 | Say yes here to build support for STMicroelectronics gyroscopes: |
96 | L3G4200D, LSM330DL, L3GD20, LSM330DLC, L3G4IS, LSM330. | 96 | L3G4200D, LSM330DL, L3GD20, LSM330DLC, L3G4IS, LSM330, LSM9DS0. |
97 | 97 | ||
98 | This driver can also be built as a module. If so, these modules | 98 | This driver can also be built as a module. If so, these modules |
99 | will be created: | 99 | will be created: |
diff --git a/drivers/iio/gyro/st_gyro.h b/drivers/iio/gyro/st_gyro.h index 5353d6328c54..a5c5c4e29add 100644 --- a/drivers/iio/gyro/st_gyro.h +++ b/drivers/iio/gyro/st_gyro.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define L3GD20_GYRO_DEV_NAME "l3gd20" | 21 | #define L3GD20_GYRO_DEV_NAME "l3gd20" |
22 | #define L3G4IS_GYRO_DEV_NAME "l3g4is_ui" | 22 | #define L3G4IS_GYRO_DEV_NAME "l3g4is_ui" |
23 | #define LSM330_GYRO_DEV_NAME "lsm330_gyro" | 23 | #define LSM330_GYRO_DEV_NAME "lsm330_gyro" |
24 | #define LSM9DS0_GYRO_DEV_NAME "lsm9ds0_gyro" | ||
24 | 25 | ||
25 | /** | 26 | /** |
26 | * struct st_sensors_platform_data - gyro platform data | 27 | * struct st_sensors_platform_data - gyro platform data |
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c index be9057e89dc3..52a3c87c375c 100644 --- a/drivers/iio/gyro/st_gyro_core.c +++ b/drivers/iio/gyro/st_gyro_core.c | |||
@@ -204,6 +204,7 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = { | |||
204 | [2] = LSM330DLC_GYRO_DEV_NAME, | 204 | [2] = LSM330DLC_GYRO_DEV_NAME, |
205 | [3] = L3G4IS_GYRO_DEV_NAME, | 205 | [3] = L3G4IS_GYRO_DEV_NAME, |
206 | [4] = LSM330_GYRO_DEV_NAME, | 206 | [4] = LSM330_GYRO_DEV_NAME, |
207 | [5] = LSM9DS0_GYRO_DEV_NAME, | ||
207 | }, | 208 | }, |
208 | .ch = (struct iio_chan_spec *)st_gyro_16bit_channels, | 209 | .ch = (struct iio_chan_spec *)st_gyro_16bit_channels, |
209 | .odr = { | 210 | .odr = { |
diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c index 6848451f817a..40056b821036 100644 --- a/drivers/iio/gyro/st_gyro_i2c.c +++ b/drivers/iio/gyro/st_gyro_i2c.c | |||
@@ -48,6 +48,10 @@ static const struct of_device_id st_gyro_of_match[] = { | |||
48 | .compatible = "st,lsm330-gyro", | 48 | .compatible = "st,lsm330-gyro", |
49 | .data = LSM330_GYRO_DEV_NAME, | 49 | .data = LSM330_GYRO_DEV_NAME, |
50 | }, | 50 | }, |
51 | { | ||
52 | .compatible = "st,lsm9ds0-gyro", | ||
53 | .data = LSM9DS0_GYRO_DEV_NAME, | ||
54 | }, | ||
51 | {}, | 55 | {}, |
52 | }; | 56 | }; |
53 | MODULE_DEVICE_TABLE(of, st_gyro_of_match); | 57 | MODULE_DEVICE_TABLE(of, st_gyro_of_match); |
@@ -93,6 +97,7 @@ static const struct i2c_device_id st_gyro_id_table[] = { | |||
93 | { L3GD20_GYRO_DEV_NAME }, | 97 | { L3GD20_GYRO_DEV_NAME }, |
94 | { L3G4IS_GYRO_DEV_NAME }, | 98 | { L3G4IS_GYRO_DEV_NAME }, |
95 | { LSM330_GYRO_DEV_NAME }, | 99 | { LSM330_GYRO_DEV_NAME }, |
100 | { LSM9DS0_GYRO_DEV_NAME }, | ||
96 | {}, | 101 | {}, |
97 | }; | 102 | }; |
98 | MODULE_DEVICE_TABLE(i2c, st_gyro_id_table); | 103 | MODULE_DEVICE_TABLE(i2c, st_gyro_id_table); |
diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c index d2b7a5fa344c..fbf2faed501c 100644 --- a/drivers/iio/gyro/st_gyro_spi.c +++ b/drivers/iio/gyro/st_gyro_spi.c | |||
@@ -54,6 +54,7 @@ static const struct spi_device_id st_gyro_id_table[] = { | |||
54 | { L3GD20_GYRO_DEV_NAME }, | 54 | { L3GD20_GYRO_DEV_NAME }, |
55 | { L3G4IS_GYRO_DEV_NAME }, | 55 | { L3G4IS_GYRO_DEV_NAME }, |
56 | { LSM330_GYRO_DEV_NAME }, | 56 | { LSM330_GYRO_DEV_NAME }, |
57 | { LSM9DS0_GYRO_DEV_NAME }, | ||
57 | {}, | 58 | {}, |
58 | }; | 59 | }; |
59 | MODULE_DEVICE_TABLE(spi, st_gyro_id_table); | 60 | MODULE_DEVICE_TABLE(spi, st_gyro_id_table); |