dt-bindings: iio: imu: mpu6050: Document invensense,mpu6880
Subsystems (3)
PATCH 1/2 dt-bindings: iio: imu: mpu6050: Document invensense,mpu6880
MPU-6880 seems to be very similar to MPU-6500 / MPU-6050 and it works fine with some minor additions for the mpu6050 driver.
Add a compatible for it to the binding documentation.
---
Note: This applies only on top of the patch for the YAML conversion:
https://lore.kernel.org/linux-iio/[email protected]/
I guess that one will be applied very soon so I think this is easier :)
--- .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml +1 -0
@@ -25,6 +25,7 @@ properties: - invensense,mpu6050 - invensense,mpu6500 - invensense,mpu6515 + - invensense,mpu6880 - invensense,mpu9150 - invensense,mpu9250 - invensense,mpu9255
Signature · 1 line
2.29.2
PATCH 2/2 iio: imu: inv_mpu6050: Add support for MPU-6880
MPU-6880 seems to be very similar to MPU-6500 / MPU-6050 and it works fine with some minor additions for the mpu6050 driver.
Add the necessary defines for it and make it use the same registers as MPU-6500 but with a FIFO size of 4096.
---
I tested this on a Xiaomi Redmi 2 (or Wingtech WT88047).
Unfortunately I was not able to find a proper register description for MPU-6880. :( It seems to work fine with both 6050 or 6500 registers but I guess that it is more similar to MPU-6500. Not sure though.
I'm mainly unsure about
.accl_offset = INV_MPU6500_REG_ACCEL_OFFSET, vs .accl_offset = INV_MPU6050_REG_ACCEL_OFFSET,
Both registers read some funny values but I cannot say which one is more appropriate...
Perhaps Jean-Baptiste can shed some light on this? :)
--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 +++++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 5 +++++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 ++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 5 +++++ 4 files changed, 21 insertions(+)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +9 -0
@@ -160,6 +160,14 @@ static const struct inv_mpu6050_hw hw_info[] = { .fifo_size = 512, .temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE}, }, + { + .whoami =INV_MPU6880_WHOAMI_VALUE , + .name = "MPU6880", + .reg = ®_set_6500, + .config = &chip_config_6500, + .fifo_size = 4096, + .temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE}, + }, { .whoami =INV_MPU6000_WHOAMI_VALUE , .name = "MPU6000",
@@ -1323,6 +1331,7 @@ static int inv_check_and_setup_chip(struct inv_mpu6050_state *st)case INV_MPU6000 :case INV_MPU6500 :case INV_MPU6515 : +case INV_MPU6880 :case INV_MPU9250 :case INV_MPU9255 :/* reset signal path (required for spi connection) */
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +5 -0
@@ -177,6 +177,7 @@ static const struct i2c_device_id inv_mpu_id[] = { {"mpu6050", INV_MPU6050}, {"mpu6500", INV_MPU6500}, {"mpu6515", INV_MPU6515}, + {"mpu6880", INV_MPU6880}, {"mpu9150", INV_MPU9150}, {"mpu9250", INV_MPU9250}, {"mpu9255", INV_MPU9255},
@@ -204,6 +205,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,mpu6515", .data = (void *)INV_MPU6515 }, + { + .compatible = "invensense,mpu6880", + .data = (void *)INV_MPU6880 + }, { .compatible ="invensense,mpu9150" , .data = (void *)INV_MPU9150
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +2 -0
@@ -70,6 +70,7 @@ enum inv_devices {INV_MPU6050 ,INV_MPU6500 ,INV_MPU6515 , +INV_MPU6880 ,INV_MPU6000 ,INV_MPU9150 , INV_MPU9250,
@@ -373,6 +374,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_MPU6880_WHOAMI_VALUE 0x78#define INV_MPU9150_WHOAMI_VALUE 0x68#define INV_MPU9250_WHOAMI_VALUE 0x71#define INV_MPU9255_WHOAMI_VALUE 0x73
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +5 -0
@@ -70,6 +70,7 @@ static const struct spi_device_id inv_mpu_id[] = { {"mpu6000", INV_MPU6000}, {"mpu6500", INV_MPU6500}, {"mpu6515", INV_MPU6515}, + {"mpu6880", INV_MPU6880}, {"mpu9250", INV_MPU9250}, {"mpu9255", INV_MPU9255}, {"icm20608", INV_ICM20608},
@@ -96,6 +97,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,mpu6515", .data = (void *)INV_MPU6515 }, + { + .compatible = "invensense,mpu6880", + .data = (void *)INV_MPU6880 + }, { .compatible ="invensense,mpu9250" , .data = (void *)INV_MPU9250
Signature · 1 line
2.29.2
Re: [PATCH 2/2] iio: imu: inv_mpu6050: Add support for MPU-6880
Hello Stephan,
MPU-6880 is similar to MPU-6500. It should share the same registers map as far as I know.
Seems good to me. Please also update Kconfig to add MPU6880 in the list for I2C and for SPI.
Thanks for the patch,
JB
From: Stephan Gerhold <[email protected]>
Sent: Wednesday, December 2, 2020 11:13
To: Jonathan Cameron <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>; Peter Meerwald-Stadler <[email protected]>; Rob Herring <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Jean-Baptiste Maneyrol <[email protected]>; Stephan Gerhold <[email protected]>
Subject: [PATCH 2/2] iio: imu: inv_mpu6050: Add support for MPU-6880
CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
MPU-6880 seems to be very similar to MPU-6500 / MPU-6050 and it works fine with some minor additions for the mpu6050 driver.
Add the necessary defines for it and make it use the same registers as MPU-6500 but with a FIFO size of 4096.
---
I tested this on a Xiaomi Redmi 2 (or Wingtech WT88047).
Unfortunately I was not able to find a proper register description for MPU-6880. :( It seems to work fine with both 6050 or 6500 registers but I guess that it is more similar to MPU-6500. Not sure though.
I'm mainly unsure about
.accl_offset = INV_MPU6500_REG_ACCEL_OFFSET, vs
.accl_offset = INV_MPU6050_REG_ACCEL_OFFSET,
Both registers read some funny values but I cannot say which one is more appropriate...
Perhaps Jean-Baptiste can shed some light on this? :)
---
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 +++++++++
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 5 +++++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 ++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 5 +++++ 4 files changed, 21 insertions(+)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +0 -0
@@ -160,6 +160,14 @@ static const struct inv_mpu6050_hw hw_info[] = {
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE}, },
+ {
+ .whoami = INV_MPU6880_WHOAMI_VALUE,
+ .name = "MPU6880",
+ .reg = ®_set_6500,
+ .config = &chip_config_6500,
+ .fifo_size = 4096,
+ .temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE}, + },
{
.whoami = INV_MPU6000_WHOAMI_VALUE,
.name = "MPU6000",
@@ -1323,6 +1331,7 @@ static int inv_check_and_setup_chip(struct inv_mpu6050_state *st) case INV_MPU6000:
case INV_MPU6500:
case INV_MPU6515:
+ case INV_MPU6880:
case INV_MPU9250:
case INV_MPU9255:
/* reset signal path (required for spi connection) */
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +0 -0
@@ -177,6 +177,7 @@ static const struct i2c_device_id inv_mpu_id[] = {
{"mpu6050", INV_MPU6050},
{"mpu6500", INV_MPU6500},
{"mpu6515", INV_MPU6515},
+ {"mpu6880", INV_MPU6880},
{"mpu9150", INV_MPU9150},
{"mpu9250", INV_MPU9250},
{"mpu9255", INV_MPU9255},
@@ -204,6 +205,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,mpu6515",
.data = (void *)INV_MPU6515
},
+ {
+ .compatible = "invensense,mpu6880",
+ .data = (void *)INV_MPU6880
+ },
{
.compatible = "invensense,mpu9150",
.data = (void *)INV_MPU9150
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +0 -0
@@ -70,6 +70,7 @@ enum inv_devices {
INV_MPU6050,
INV_MPU6500,
INV_MPU6515,
+ INV_MPU6880,
INV_MPU6000,
INV_MPU9150,
INV_MPU9250,
@@ -373,6 +374,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_MPU6880_WHOAMI_VALUE 0x78 #define INV_MPU9150_WHOAMI_VALUE 0x68 #define INV_MPU9250_WHOAMI_VALUE 0x71 #define INV_MPU9255_WHOAMI_VALUE 0x73
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +0 -0
@@ -70,6 +70,7 @@ static const struct spi_device_id inv_mpu_id[] = {
{"mpu6000", INV_MPU6000},
{"mpu6500", INV_MPU6500},
{"mpu6515", INV_MPU6515},
+ {"mpu6880", INV_MPU6880},
{"mpu9250", INV_MPU9250},
{"mpu9255", INV_MPU9255},
{"icm20608", INV_ICM20608},
@@ -96,6 +97,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,mpu6515",
.data = (void *)INV_MPU6515
},
+ {
+ .compatible = "invensense,mpu6880",
+ .data = (void *)INV_MPU6880
+ },
{
.compatible = "invensense,mpu9250",
.data = (void *)INV_MPU9250
Signature · 1 line
2.29.2
Re: [PATCH 2/2] iio: imu: inv_mpu6050: Add support for MPU-6880
Quoted 6 lines · Jean-Baptiste Maneyrol
Hello Stephan,
MPU-6880 is similar to MPU-6500. It should share the same registers map as far as I know.
Seems good to me. Please also update
Kconfigto add MPU6880 in the list for I2C and for SPI.
Great, thanks! Will send a v2 with the Kconfig change.
Stephan