summaryrefslogtreecommitdiff
path: root/driver/mag_bmm150.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-07-25 00:08:14 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-01 02:50:41 +0000
commit8fa63762fbe0bf9f2e9a2211217eb239b494c80b (patch)
tree36fac3fcaafe8e7289d884cd70e240ddb4d34777 /driver/mag_bmm150.c
parente94152b7e895b973e1c90a9935d2d1e4a706b55f (diff)
downloadchrome-ec-8fa63762fbe0bf9f2e9a2211217eb239b494c80b.tar.gz
driver: bmi160: Fix bugs found testing SPI
SPI being much faster, need to add right sleep to wait for sensor to change state from suspend. Set the ODR before the range, an issue I did not have with i2c. Fix test used when FIFO is disabled. BRANCH=smaug BUG=chrome-os-partner:42304 TEST=Check sensors are coming and rate/range are correctly set. Change-Id: I5bf655626f1f4232478a04d1d4e1a0d443efbf0f Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/288517 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'driver/mag_bmm150.c')
-rw-r--r--driver/mag_bmm150.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/driver/mag_bmm150.c b/driver/mag_bmm150.c
index 772b147d70..4bc0d7a8e7 100644
--- a/driver/mag_bmm150.c
+++ b/driver/mag_bmm150.c
@@ -82,6 +82,7 @@ int bmm150_init(const struct motion_sensor_t *s)
/* Set the compass from Suspend to Sleep */
ret = raw_mag_write8(s->addr, BMM150_PWR_CTRL, BMM150_PWR_ON);
+ msleep(4);
/* Now we can read the device id */
ret = raw_mag_read8(s->addr, BMM150_CHIP_ID, &val);
if (ret)