iio: inv_mpu6050: Add explicit support for MPU9150
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Wed, 20 Apr 2016 13:15:13 +0000 (16:15 +0300)
committerJonathan Cameron <jic23@kernel.org>
Mon, 25 Apr 2016 19:19:38 +0000 (20:19 +0100)
This device is a package containing a MPU6050-like sensor and an AK8975
magnetometer. The magnetometer component is supported by the existing
ak8975 driver.

This patch also rephrases the Kconfig descriptions.

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Acked-by: Ge Gao <ggao@invensense.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 a7f557af43895bfcf3b60e1298bee529246f0d35..c05d474587d24857a5d67ffce8c0c1e8941a8c82 100644 (file)
@@ -14,10 +14,8 @@ config INV_MPU6050_I2C
        select I2C_MUX
        select REGMAP_I2C
        help
-         This driver supports the Invensense MPU6050 devices.
-         This driver can also support MPU6500 in MPU6050 compatibility mode
-         and also in MPU6500 mode with some limitations.
-         It is a gyroscope/accelerometer combo device.
+         This driver supports the Invensense MPU6050/6500/9150 motion tracking
+         devices over I2C.
          This driver can be built as a module. The module will be called
          inv-mpu6050-i2c.
 
@@ -27,7 +25,7 @@ config INV_MPU6050_SPI
        select INV_MPU6050_IIO
        select REGMAP_SPI
        help
-         This driver supports the Invensense MPU6050 devices.
-         It is a gyroscope/accelerometer combo device.
+         This driver supports the Invensense MPU6000/6500/9150 motion tracking
+         devices over SPI.
          This driver can be built as a module. The module will be called
          inv-mpu6050-spi.
index 4152f2fcf598c2f3fffe99f7981c0378467db4fa..b269b375ca341195713ac654653964bdc1992acf 100644 (file)
@@ -108,6 +108,12 @@ static const struct inv_mpu6050_hw hw_info[] = {
                .reg = &reg_set_6050,
                .config = &chip_config_6050,
        },
+       {
+               .whoami = INV_MPU9150_WHOAMI_VALUE,
+               .name = "MPU9150",
+               .reg = &reg_set_6050,
+               .config = &chip_config_6050,
+       },
 };
 
 int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask)
index bb1a7b1462f51a0c56f13062e0d8e1c6ccbf9224..1a424a6561de19c0e2b034730351156b5945345f 100644 (file)
@@ -202,6 +202,7 @@ static int inv_mpu_remove(struct i2c_client *client)
 static const struct i2c_device_id inv_mpu_id[] = {
        {"mpu6050", INV_MPU6050},
        {"mpu6500", INV_MPU6500},
+       {"mpu9150", INV_MPU9150},
        {}
 };
 
index fb45cc76e4e4493fb63e3945d20853388b3e3b19..47ca25b94a73565317596c11c2f7963de5980999 100644 (file)
@@ -68,6 +68,7 @@ enum inv_devices {
        INV_MPU6050,
        INV_MPU6500,
        INV_MPU6000,
+       INV_MPU9150,
        INV_NUM_PARTS
 };
 
@@ -222,6 +223,7 @@ struct inv_mpu6050_state {
 #define INV_MPU6000_WHOAMI_VALUE               0x68
 #define INV_MPU6050_WHOAMI_VALUE               0x68
 #define INV_MPU6500_WHOAMI_VALUE               0x70
+#define INV_MPU9150_WHOAMI_VALUE               0x68
 
 /* scan element definition */
 enum inv_mpu6050_scan {
index a0f8df2399333aeb227c6e5c8d283f92c386b71b..190a4a51c830055bfd7ce039162cb20efe210799 100644 (file)
@@ -81,6 +81,7 @@ static int inv_mpu_remove(struct spi_device *spi)
 static const struct spi_device_id inv_mpu_id[] = {
        {"mpu6000", INV_MPU6000},
        {"mpu6500", INV_MPU6500},
+       {"mpu9150", INV_MPU9150},
        {}
 };