Commit 685cc61b authored by Douglas Fischer's avatar Douglas Fischer Committed by Jonathan Cameron

iio: imu: Add mpu9255 support to mpu6050 driver

Added support for the mpu9255 IMU to the mpu6050 driver. The
register map is the same as the other chips; the only driver
difference is the compatible string and the WHOAMI register
value.
Signed-off-by: default avatarDouglas Fischer <fischerdouglasc@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 02112260
...@@ -8,6 +8,7 @@ Required properties: ...@@ -8,6 +8,7 @@ Required properties:
"invensense,mpu6500" "invensense,mpu6500"
"invensense,mpu9150" "invensense,mpu9150"
"invensense,mpu9250" "invensense,mpu9250"
"invensense,mpu9255"
"invensense,icm20608" "invensense,icm20608"
- reg : the I2C address of the sensor - reg : the I2C address of the sensor
- interrupt-parent : should be the phandle for the interrupt controller - interrupt-parent : should be the phandle for the interrupt controller
......
...@@ -120,6 +120,12 @@ static const struct inv_mpu6050_hw hw_info[] = { ...@@ -120,6 +120,12 @@ static const struct inv_mpu6050_hw hw_info[] = {
.reg = &reg_set_6500, .reg = &reg_set_6500,
.config = &chip_config_6050, .config = &chip_config_6050,
}, },
{
.whoami = INV_MPU9255_WHOAMI_VALUE,
.name = "MPU9255",
.reg = &reg_set_6500,
.config = &chip_config_6050,
},
{ {
.whoami = INV_ICM20608_WHOAMI_VALUE, .whoami = INV_ICM20608_WHOAMI_VALUE,
.name = "ICM20608", .name = "ICM20608",
......
...@@ -179,6 +179,7 @@ static const struct i2c_device_id inv_mpu_id[] = { ...@@ -179,6 +179,7 @@ static const struct i2c_device_id inv_mpu_id[] = {
{"mpu6500", INV_MPU6500}, {"mpu6500", INV_MPU6500},
{"mpu9150", INV_MPU9150}, {"mpu9150", INV_MPU9150},
{"mpu9250", INV_MPU9250}, {"mpu9250", INV_MPU9250},
{"mpu9255", INV_MPU9255},
{"icm20608", INV_ICM20608}, {"icm20608", INV_ICM20608},
{} {}
}; };
...@@ -202,6 +203,10 @@ static const struct of_device_id inv_of_match[] = { ...@@ -202,6 +203,10 @@ static const struct of_device_id inv_of_match[] = {
.compatible = "invensense,mpu9250", .compatible = "invensense,mpu9250",
.data = (void *)INV_MPU9250 .data = (void *)INV_MPU9250
}, },
{
.compatible = "invensense,mpu9255",
.data = (void *)INV_MPU9255
},
{ {
.compatible = "invensense,icm20608", .compatible = "invensense,icm20608",
.data = (void *)INV_ICM20608 .data = (void *)INV_ICM20608
......
...@@ -74,6 +74,7 @@ enum inv_devices { ...@@ -74,6 +74,7 @@ enum inv_devices {
INV_MPU6000, INV_MPU6000,
INV_MPU9150, INV_MPU9150,
INV_MPU9250, INV_MPU9250,
INV_MPU9255,
INV_ICM20608, INV_ICM20608,
INV_NUM_PARTS INV_NUM_PARTS
}; };
...@@ -232,6 +233,7 @@ struct inv_mpu6050_state { ...@@ -232,6 +233,7 @@ struct inv_mpu6050_state {
#define INV_MPU6500_WHOAMI_VALUE 0x70 #define INV_MPU6500_WHOAMI_VALUE 0x70
#define INV_MPU9150_WHOAMI_VALUE 0x68 #define INV_MPU9150_WHOAMI_VALUE 0x68
#define INV_MPU9250_WHOAMI_VALUE 0x71 #define INV_MPU9250_WHOAMI_VALUE 0x71
#define INV_MPU9255_WHOAMI_VALUE 0x73
#define INV_ICM20608_WHOAMI_VALUE 0xAF #define INV_ICM20608_WHOAMI_VALUE 0xAF
/* scan element definition */ /* scan element definition */
......
...@@ -83,6 +83,7 @@ static const struct spi_device_id inv_mpu_id[] = { ...@@ -83,6 +83,7 @@ static const struct spi_device_id inv_mpu_id[] = {
{"mpu6500", INV_MPU6500}, {"mpu6500", INV_MPU6500},
{"mpu9150", INV_MPU9150}, {"mpu9150", INV_MPU9150},
{"mpu9250", INV_MPU9250}, {"mpu9250", INV_MPU9250},
{"mpu9255", INV_MPU9255},
{"icm20608", INV_ICM20608}, {"icm20608", INV_ICM20608},
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment