diff options
author | Gregor Boirie <gregor.boirie@parrot.com> | 2016-06-30 13:06:34 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-07-03 07:39:57 -0400 |
commit | 468c5620d094e9ead2a0b6802d3c490b4fb6ed03 (patch) | |
tree | b5bf21c86201b04204d51d4857b69a215ed3adc8 | |
parent | 152c9aa00d546dac55095f620ea068965ef06dc7 (diff) |
iio:imu:mpu6050: icm20608 initial support
Introduce support for Invense ICM20608 IMU, a 6-axis motion tracking device
that combines a 3-axis gyroscope and a 3-axis accelerometer:
http://www.invensense.com/products/motion-tracking/6-axis/icm-20608-2
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/Kconfig | 8 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 1 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 1 |
5 files changed, 14 insertions, 4 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig index f756feecfa4c..5483b2ea754d 100644 --- a/drivers/iio/imu/inv_mpu6050/Kconfig +++ b/drivers/iio/imu/inv_mpu6050/Kconfig | |||
@@ -13,8 +13,8 @@ config INV_MPU6050_I2C | |||
13 | select INV_MPU6050_IIO | 13 | select INV_MPU6050_IIO |
14 | select REGMAP_I2C | 14 | select REGMAP_I2C |
15 | help | 15 | help |
16 | This driver supports the Invensense MPU6050/6500/9150 motion tracking | 16 | This driver supports the Invensense MPU6050/6500/9150 and ICM20608 |
17 | devices over I2C. | 17 | motion tracking devices over I2C. |
18 | This driver can be built as a module. The module will be called | 18 | This driver can be built as a module. The module will be called |
19 | inv-mpu6050-i2c. | 19 | inv-mpu6050-i2c. |
20 | 20 | ||
@@ -24,7 +24,7 @@ config INV_MPU6050_SPI | |||
24 | select INV_MPU6050_IIO | 24 | select INV_MPU6050_IIO |
25 | select REGMAP_SPI | 25 | select REGMAP_SPI |
26 | help | 26 | help |
27 | This driver supports the Invensense MPU6000/6500/9150 motion tracking | 27 | This driver supports the Invensense MPU6050/6500/9150 and ICM20608 |
28 | devices over SPI. | 28 | motion tracking devices over SPI. |
29 | This driver can be built as a module. The module will be called | 29 | This driver can be built as a module. The module will be called |
30 | inv-mpu6050-spi. | 30 | inv-mpu6050-spi. |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index ee40dae5ab58..b9fcbf18aa99 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | |||
@@ -113,6 +113,12 @@ static const struct inv_mpu6050_hw hw_info[] = { | |||
113 | .reg = ®_set_6050, | 113 | .reg = ®_set_6050, |
114 | .config = &chip_config_6050, | 114 | .config = &chip_config_6050, |
115 | }, | 115 | }, |
116 | { | ||
117 | .whoami = INV_ICM20608_WHOAMI_VALUE, | ||
118 | .name = "ICM20608", | ||
119 | .reg = ®_set_6500, | ||
120 | .config = &chip_config_6050, | ||
121 | }, | ||
116 | }; | 122 | }; |
117 | 123 | ||
118 | int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask) | 124 | int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask) |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index e1fd7fa53e3b..19580d1db597 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | |||
@@ -170,6 +170,7 @@ static const struct i2c_device_id inv_mpu_id[] = { | |||
170 | {"mpu6050", INV_MPU6050}, | 170 | {"mpu6050", INV_MPU6050}, |
171 | {"mpu6500", INV_MPU6500}, | 171 | {"mpu6500", INV_MPU6500}, |
172 | {"mpu9150", INV_MPU9150}, | 172 | {"mpu9150", INV_MPU9150}, |
173 | {"icm20608", INV_ICM20608}, | ||
173 | {} | 174 | {} |
174 | }; | 175 | }; |
175 | 176 | ||
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index 3bf8544ccc9f..f0e8c5dd9fae 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | |||
@@ -70,6 +70,7 @@ enum inv_devices { | |||
70 | INV_MPU6500, | 70 | INV_MPU6500, |
71 | INV_MPU6000, | 71 | INV_MPU6000, |
72 | INV_MPU9150, | 72 | INV_MPU9150, |
73 | INV_ICM20608, | ||
73 | INV_NUM_PARTS | 74 | INV_NUM_PARTS |
74 | }; | 75 | }; |
75 | 76 | ||
@@ -225,6 +226,7 @@ struct inv_mpu6050_state { | |||
225 | #define INV_MPU6050_WHOAMI_VALUE 0x68 | 226 | #define INV_MPU6050_WHOAMI_VALUE 0x68 |
226 | #define INV_MPU6500_WHOAMI_VALUE 0x70 | 227 | #define INV_MPU6500_WHOAMI_VALUE 0x70 |
227 | #define INV_MPU9150_WHOAMI_VALUE 0x68 | 228 | #define INV_MPU9150_WHOAMI_VALUE 0x68 |
229 | #define INV_ICM20608_WHOAMI_VALUE 0xAF | ||
228 | 230 | ||
229 | /* scan element definition */ | 231 | /* scan element definition */ |
230 | enum inv_mpu6050_scan { | 232 | enum inv_mpu6050_scan { |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index 190a4a51c830..6e6476dfa188 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | |||
@@ -82,6 +82,7 @@ static const struct spi_device_id inv_mpu_id[] = { | |||
82 | {"mpu6000", INV_MPU6000}, | 82 | {"mpu6000", INV_MPU6000}, |
83 | {"mpu6500", INV_MPU6500}, | 83 | {"mpu6500", INV_MPU6500}, |
84 | {"mpu9150", INV_MPU9150}, | 84 | {"mpu9150", INV_MPU9150}, |
85 | {"icm20608", INV_ICM20608}, | ||
85 | {} | 86 | {} |
86 | }; | 87 | }; |
87 | 88 | ||