Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: imu: inv_mpu6050: Add support for MPU-6880

MPU-6880 seems to be very similar to MPU-6500 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.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20201202104656.5119-2-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Stephan Gerhold and committed by
Jonathan Cameron
4df68509 af73caa7

+25 -4
+4 -4
drivers/iio/imu/inv_mpu6050/Kconfig
··· 16 16 select REGMAP_I2C 17 17 help 18 18 This driver supports the Invensense MPU6050/9150, 19 - MPU6500/6515/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690 and 20 - IAM20680 motion tracking devices over I2C. 19 + MPU6500/6515/6880/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690 20 + and IAM20680 motion tracking devices over I2C. 21 21 This driver can be built as a module. The module will be called 22 22 inv-mpu6050-i2c. 23 23 ··· 28 28 select REGMAP_SPI 29 29 help 30 30 This driver supports the Invensense MPU6000, 31 - MPU6500/6515/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690 and 32 - IAM20680 motion tracking devices over SPI. 31 + MPU6500/6515/6880/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690 32 + and IAM20680 motion tracking devices over SPI. 33 33 This driver can be built as a module. The module will be called 34 34 inv-mpu6050-spi.
+9
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
··· 161 161 .temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE}, 162 162 }, 163 163 { 164 + .whoami = INV_MPU6880_WHOAMI_VALUE, 165 + .name = "MPU6880", 166 + .reg = &reg_set_6500, 167 + .config = &chip_config_6500, 168 + .fifo_size = 4096, 169 + .temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE}, 170 + }, 171 + { 164 172 .whoami = INV_MPU6000_WHOAMI_VALUE, 165 173 .name = "MPU6000", 166 174 .reg = &reg_set_6050, ··· 1331 1323 case INV_MPU6000: 1332 1324 case INV_MPU6500: 1333 1325 case INV_MPU6515: 1326 + case INV_MPU6880: 1334 1327 case INV_MPU9250: 1335 1328 case INV_MPU9255: 1336 1329 /* reset signal path (required for spi connection) */
+5
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
··· 177 177 {"mpu6050", INV_MPU6050}, 178 178 {"mpu6500", INV_MPU6500}, 179 179 {"mpu6515", INV_MPU6515}, 180 + {"mpu6880", INV_MPU6880}, 180 181 {"mpu9150", INV_MPU9150}, 181 182 {"mpu9250", INV_MPU9250}, 182 183 {"mpu9255", INV_MPU9255}, ··· 204 203 { 205 204 .compatible = "invensense,mpu6515", 206 205 .data = (void *)INV_MPU6515 206 + }, 207 + { 208 + .compatible = "invensense,mpu6880", 209 + .data = (void *)INV_MPU6880 207 210 }, 208 211 { 209 212 .compatible = "invensense,mpu9150",
+2
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
··· 70 70 INV_MPU6050, 71 71 INV_MPU6500, 72 72 INV_MPU6515, 73 + INV_MPU6880, 73 74 INV_MPU6000, 74 75 INV_MPU9150, 75 76 INV_MPU9250, ··· 374 373 #define INV_MPU6000_WHOAMI_VALUE 0x68 375 374 #define INV_MPU6050_WHOAMI_VALUE 0x68 376 375 #define INV_MPU6500_WHOAMI_VALUE 0x70 376 + #define INV_MPU6880_WHOAMI_VALUE 0x78 377 377 #define INV_MPU9150_WHOAMI_VALUE 0x68 378 378 #define INV_MPU9250_WHOAMI_VALUE 0x71 379 379 #define INV_MPU9255_WHOAMI_VALUE 0x73
+5
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
··· 70 70 {"mpu6000", INV_MPU6000}, 71 71 {"mpu6500", INV_MPU6500}, 72 72 {"mpu6515", INV_MPU6515}, 73 + {"mpu6880", INV_MPU6880}, 73 74 {"mpu9250", INV_MPU9250}, 74 75 {"mpu9255", INV_MPU9255}, 75 76 {"icm20608", INV_ICM20608}, ··· 96 95 { 97 96 .compatible = "invensense,mpu6515", 98 97 .data = (void *)INV_MPU6515 98 + }, 99 + { 100 + .compatible = "invensense,mpu6880", 101 + .data = (void *)INV_MPU6880 99 102 }, 100 103 { 101 104 .compatible = "invensense,mpu9250",