iio:imu:mpu6050: icm20608 initial support
authorGregor Boirie <gregor.boirie@parrot.com>
Thu, 30 Jun 2016 17:06:34 +0000 (19:06 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 3 Jul 2016 11:39:57 +0000 (12:39 +0100)
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>
drivers/iio/imu/inv_mpu6050/Kconfig
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c

index f756fee..5483b2e 100644 (file)
@@ -13,8 +13,8 @@ config INV_MPU6050_I2C
        select INV_MPU6050_IIO
        select REGMAP_I2C
        help
-         This driver supports the Invensense MPU6050/6500/9150 motion tracking
-         devices over I2C.
+         This driver supports the Invensense MPU6050/6500/9150 and ICM20608
+         motion tracking devices over I2C.
          This driver can be built as a module. The module will be called
          inv-mpu6050-i2c.
 
@@ -24,7 +24,7 @@ config INV_MPU6050_SPI
        select INV_MPU6050_IIO
        select REGMAP_SPI
        help
-         This driver supports the Invensense MPU6000/6500/9150 motion tracking
-         devices over SPI.
+         This driver supports the Invensense MPU6050/6500/9150 and ICM20608
+         motion tracking devices over SPI.
          This driver can be built as a module. The module will be called
          inv-mpu6050-spi.
index ee40dae..b9fcbf1 100644 (file)
@@ -113,6 +113,12 @@ static const struct inv_mpu6050_hw hw_info[] = {
                .reg = &reg_set_6050,
                .config = &chip_config_6050,
        },
+       {
+               .whoami = INV_ICM20608_WHOAMI_VALUE,
+               .name = "ICM20608",
+               .reg = &reg_set_6500,
+               .config = &chip_config_6050,
+       },
 };
 
 int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask)
index e1fd7fa..19580d1 100644 (file)
@@ -170,6 +170,7 @@ static const struct i2c_device_id inv_mpu_id[] = {
        {"mpu6050", INV_MPU6050},
        {"mpu6500", INV_MPU6500},
        {"mpu9150", INV_MPU9150},
+       {"icm20608", INV_ICM20608},
        {}
 };
 
index 3bf8544..f0e8c5d 100644 (file)
@@ -70,6 +70,7 @@ enum inv_devices {
        INV_MPU6500,
        INV_MPU6000,
        INV_MPU9150,
+       INV_ICM20608,
        INV_NUM_PARTS
 };
 
@@ -225,6 +226,7 @@ struct inv_mpu6050_state {
 #define INV_MPU6050_WHOAMI_VALUE               0x68
 #define INV_MPU6500_WHOAMI_VALUE               0x70
 #define INV_MPU9150_WHOAMI_VALUE               0x68
+#define INV_ICM20608_WHOAMI_VALUE              0xAF
 
 /* scan element definition */
 enum inv_mpu6050_scan {
index 190a4a5..6e6476d 100644 (file)
@@ -82,6 +82,7 @@ static const struct spi_device_id inv_mpu_id[] = {
        {"mpu6000", INV_MPU6000},
        {"mpu6500", INV_MPU6500},
        {"mpu9150", INV_MPU9150},
+       {"icm20608", INV_ICM20608},
        {}
 };