OSDN Git Service

iio: imu: mpu6050: Fix FIFO layout for ICM20602
authorSteve Moskovchenko <stevemo@skydio.com>
Wed, 3 Apr 2019 06:28:56 +0000 (23:28 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Apr 2019 10:45:01 +0000 (11:45 +0100)
commit1615fe41a1959a2ee2814ba62736b2bb54e9802a
tree5dda1d4e1f704d76c1e3aab8c64311f86fe65099
parent0db8aa49a97e7f40852a64fd35abcc1292a7c365
iio: imu: mpu6050: Fix FIFO layout for ICM20602

The MPU6050 driver has recently gained support for the
ICM20602 IMU, which is very similar to MPU6xxx. However,
the ICM20602's FIFO data specifically includes temperature
readings, which were not present on MPU6xxx parts. As a
result, the driver will under-read the ICM20602's FIFO
register, causing the same (partial) sample to be returned
for all reads, until the FIFO overflows.

Fix this by adding a table of scan elements specifically
for the ICM20602, which takes the extra temperature data
into consideration.

While we're at it, fix the temperature offset and scaling
on ICM20602, since it uses different scale/offset constants
than the rest of the MPU6xxx devices.

Signed-off-by: Steve Moskovchenko <stevemo@skydio.com>
Fixes: 22904bdff978 ("iio: imu: mpu6050: Add support for the ICM 20602 IMU")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c