summaryrefslogtreecommitdiff
path: root/driver/sensorhub_lsm6dsm.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-01-17 14:37:25 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-01-19 04:20:20 -0800
commit97b4595647cba30423c243cc4b70034f9ef942f2 (patch)
tree730ecb86d95856a59e82136081ffb1d92908611f /driver/sensorhub_lsm6dsm.c
parent3460c8658c13c639d8d5e3b9de2648757245664d (diff)
downloadchrome-ec-97b4595647cba30423c243cc4b70034f9ef942f2.tar.gz
LSM6: Follow ODR change procedure from application notes
There are a few ways the current driver differs from the application notes for the LSM6DS3, notably: - FIFO disable is done before any ODR registers are set - FIFO ODR is set before any FIFO decimations BUG=b:122912601 BRANCH=octopus TEST=used "ectool" to change ODR values on phaser360, ensured "accelinfo on" output looked sane with the exception of points which will be discarded next CL Change-Id: I39fdcc67d0b34382a348dc2442785a847a4bc68d Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1419123 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/sensorhub_lsm6dsm.c')
-rw-r--r--driver/sensorhub_lsm6dsm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/driver/sensorhub_lsm6dsm.c b/driver/sensorhub_lsm6dsm.c
index 04776b0557..c9989b8c0b 100644
--- a/driver/sensorhub_lsm6dsm.c
+++ b/driver/sensorhub_lsm6dsm.c
@@ -200,7 +200,14 @@ int sensorhub_set_ext_data_rate(const struct motion_sensor_t *s,
xl_rate = st_get_data_rate(s);
*ret_rate = MIN(rate, xl_rate);
#ifdef CONFIG_ACCEL_FIFO
- ret = accelgyro_config_fifo(s);
+ ret = accelgyro_fifo_disable(s);
+ if (ret != EC_SUCCESS)
+ return ret;
+ /*
+ * NOTE: the ODR on the pass-through sensor does not currently change.
+ * If it does, that step needs to be performed here
+ */
+ ret = accelgyro_fifo_enable(s);
#endif
return ret;
}