]> git.karo-electronics.de Git - linux-beck.git/commitdiff
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 f756feecfa4ca966e381e2d7a79e1de38014ea4e..5483b2ea754dd37c624fbe513b5bf721266cf88b 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 ee40dae5ab58e5f937be5a2b3444c0e8de215168..b9fcbf18aa99e53f4fb2b0ec62949ef983f9b0e0 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 e1fd7fa53e3ba1eda97b78cb862c4a6a20bb8f83..19580d1db597a5bc33ce3f9350900edc0d1aa0af 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 3bf8544ccc9f999f7546317261cd6cad89b9cb97..f0e8c5dd9fae25915e7cf0d4885d5d7b9b0e821d 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 190a4a51c830055bfd7ce039162cb20efe210799..6e6476dfa188ed79bdace630f492ce866aacefe9 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},
        {}
 };