summaryrefslogtreecommitdiff
path: root/driver/accelgyro_icm426xx.h
diff options
context:
space:
mode:
authorJean-Baptiste Maneyrol <jmaneyrol@invensense.com>2021-02-08 16:59:06 +0000
committerCommit Bot <commit-bot@chromium.org>2021-02-25 20:17:53 +0000
commit71d6b16eff18aab1f7c592a75e5489a4f14b8790 (patch)
treee309a6915f7b3375f5db7a8ea4780d914e0f9a7f /driver/accelgyro_icm426xx.h
parentae50227d0d5b9c135e474bbfd3bb8cce6efef71f (diff)
downloadchrome-ec-71d6b16eff18aab1f7c592a75e5489a4f14b8790.tar.gz
driver: icm426xx: discard first data instead of sleeping
Sleeping when turning a sensor on/off is problematic when the other sensor is running. Replace sleeping by discarding first events until sensor is stabilized. BUG=chromium:1175757 BRANCH=hatch,nami,kukui,dedede,grunt,zork,octopus,volteer TEST=turn sensor on/off when the other is running using cros-ec iio devices Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I61801970b12f9fbdcc2cd96cb4df1edae5ed521f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2682715 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'driver/accelgyro_icm426xx.h')
-rw-r--r--driver/accelgyro_icm426xx.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/driver/accelgyro_icm426xx.h b/driver/accelgyro_icm426xx.h
index c281e352b1..bcda1174b2 100644
--- a/driver/accelgyro_icm426xx.h
+++ b/driver/accelgyro_icm426xx.h
@@ -32,6 +32,14 @@
#define ICM426XX_GYRO_FS_MIN_VAL 125
#define ICM426XX_GYRO_FS_MAX_VAL 2000
+/* accel stabilization time in us */
+#define ICM426XX_ACCEL_START_TIME 20000
+#define ICM426XX_ACCEL_STOP_TIME 0
+
+/* gyro stabilization time in us */
+#define ICM426XX_GYRO_START_TIME 60000
+#define ICM426XX_GYRO_STOP_TIME 150000
+
/* Reg value from Accel FS in G */
#define ICM426XX_ACCEL_FS_TO_REG(_fs) ((_fs) < 2 ? 3 : \
(_fs) > 16 ? 0 : \