iio: imu: inv_mpu6050: new timestamp mechanism
authorJean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Mon, 28 May 2018 13:22:04 +0000 (15:22 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 10 Jun 2018 10:52:30 +0000 (11:52 +0100)
commit4bcc19f1b218983be841a319a3a506f2e446c6b5
treecc6fac3c9fea51379e2286b3451beffb717dbcb3
parent17f0361936a5bdeb4958813b1c5542fdc91de925
iio: imu: inv_mpu6050: new timestamp mechanism

Check validity of interrupt timestamps by computing time between
2 interrupts. If it matches the chip frequency modulo 4%, it is
used as the data timestamp and also for estimating the chip
frequency measured from the system. Otherwise timestamp is
computed using the estimated chip frequency.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
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