diff options
author | David Huang <david.huang@quanta.corp-partner.google.com> | 2020-12-18 13:29:15 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-27 05:29:21 +0000 |
commit | 3f4deea779f36b50037cc650c5f204f73aba998b (patch) | |
tree | 458b29edd4247dcaa4609e0c71e4a7d3c994542d | |
parent | 6f7b1ea2dddd9809dbb4c5602e2ef0b37eb81307 (diff) | |
download | chrome-ec-3f4deea779f36b50037cc650c5f204f73aba998b.tar.gz |
icm426xx: reset data rate when init
When icm426xx init, reset data rate to enable sensor.
Conflicts:
driver/accelgyro_icm426xx.c: readd saved_data variable.
BUG=chromium:1160266
BRANCH=main
TEST=Check ectool motionsense get data after shutdown and power on.
Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com>
Change-Id: I0a1042eaf6dbdb132c4bb50975eae3c6f0cfad00
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597131
Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
(cherry picked from commit 65bc9015e5e2c7f73ed93ad652498a3cf67ed9fd)
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3128752
Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
-rw-r--r-- | driver/accelgyro_icm426xx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/driver/accelgyro_icm426xx.c b/driver/accelgyro_icm426xx.c index 488f2a940b..fccd03a46d 100644 --- a/driver/accelgyro_icm426xx.c +++ b/driver/accelgyro_icm426xx.c @@ -810,6 +810,7 @@ static int icm426xx_init_config(const struct motion_sensor_t *s) static int icm426xx_init(const struct motion_sensor_t *s) { + struct accelgyro_saved_data_t *saved_data = ICM_GET_SAVED_DATA(s); struct icm_drv_data_t *st = ICM_GET_DATA(s); int mask, val; int ret; @@ -862,6 +863,8 @@ static int icm426xx_init(const struct motion_sensor_t *s) #endif } + saved_data->odr = 0; + /* set sensor filter */ switch (s->type) { case MOTIONSENSE_TYPE_ACCEL: |