Commit 6f174fd312d50abf3e98c0c5f7adf0cf434ae705

Authored by Srinivas Pandruvada
Committed by Jonathan Cameron
1 parent d913971eca

iio: imu: inv_mpu6050: Add compatibity with MPU6500

Adding MPU6500 in target list for this driver.

Description:
Source
Document: MPU-6500 Register Map and Descriptions Revision 2.1
Section 3: Register Map

This section describes difference in terms device programmability
between MPU6050 and MPU6500.
These are different registers, which differs between MPU6050 and
MPU6500.

Addr	Name
---------------------
1E 	LP_ACCEL_ODR
6C	PWR_MGMT_2
77	XA_OFFSET_H
78	XA_OFFSET_L
7A	YA_OFFSET_H
7B	YA_OFFSET_L
7D	ZA_OFFSET_H
7E	ZA_OFFSET_L

But the current MPU6050 driver doesn't use registers which are different
except PWR_MGMT_2. The difference is support of "LP_WAKE_CTRL" at bit6-7
in MPU6050 mode. In MPU6500 they are not defined.
In current mpu6050 driver, only values used for this register are for
standby mode for gyro and accelerometer.
In both case frequency of wakeups is set to default and not using
bit 6-7.

So this driver van as well support MPU6500. In addition MPU6500 can
run MPU6050 mode by changing device trim settings.

So changing config comments to allow MPU6500 to use this driver.
When the driver is enhanced to support more functions, i2c driver
data INV_MPU6500 or "WHO_AM_I" register can be used to add additional
functionality.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

Showing 3 changed files with 4 additions and 0 deletions Side-by-side Diff

drivers/iio/imu/inv_mpu6050/Kconfig
... ... @@ -9,6 +9,8 @@
9 9 select IIO_TRIGGERED_BUFFER
10 10 help
11 11 This driver supports the Invensense MPU6050 devices.
  12 + This driver can also support MPU6500 in MPU6050 compatibility mode
  13 + and also in MPU6500 mode with some limitations.
12 14 It is a gyroscope/accelerometer combo device.
13 15 This driver can be built as a module. The module will be called
14 16 inv-mpu6050.
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
... ... @@ -764,6 +764,7 @@
764 764 */
765 765 static const struct i2c_device_id inv_mpu_id[] = {
766 766 {"mpu6050", INV_MPU6050},
  767 + {"mpu6500", INV_MPU6500},
767 768 {}
768 769 };
769 770  
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
... ... @@ -59,6 +59,7 @@
59 59 /*device enum */
60 60 enum inv_devices {
61 61 INV_MPU6050,
  62 + INV_MPU6500,
62 63 INV_NUM_PARTS
63 64 };
64 65