summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-09-12 16:20:31 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-20 12:33:23 -0700
commit56670f5d8dfe784f9db8ad102fa2b282c50a0a12 (patch)
tree1ad7f378198a85c3b9b10b6c404b59a2734148a6 /driver
parentb98e33c95000976d689a9e5537402eafadad6507 (diff)
downloadchrome-ec-56670f5d8dfe784f9db8ad102fa2b282c50a0a12.tar.gz
driver: bmm150: fix repetiton registers
Rereading the spec, the repetition registers are massaged by the chip to produce the repetition value: for XY: 1 + 2 * REPxy, Z axis: 1 + REPz BRANCH=smaug BUG=chrome-os-partner:39900 TEST=check the registers matches the spec. Change-Id: Ic8618d70c18b4f408e3c95acdbe7fcdf6d95e39e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/299582 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/mag_bmm150.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/mag_bmm150.c b/driver/mag_bmm150.c
index 87933945fb..83f650213b 100644
--- a/driver/mag_bmm150.c
+++ b/driver/mag_bmm150.c
@@ -117,8 +117,8 @@ int bmm150_init(const struct motion_sensor_t *s)
/* Set the repetition in "Regular Preset" */
- raw_mag_write8(s->addr, BMM150_REPXY, 1 + 2 * BMM150_REP(REGULAR, XY));
- raw_mag_write8(s->addr, BMM150_REPZ, 1 + BMM150_REP(REGULAR, Z));
+ raw_mag_write8(s->addr, BMM150_REPXY, BMM150_REP(REGULAR, XY));
+ raw_mag_write8(s->addr, BMM150_REPZ, BMM150_REP(REGULAR, Z));
ret = raw_mag_read8(s->addr, BMM150_REPXY, &val);
CPRINTS("repxy: 0x%02x", val);
ret = raw_mag_read8(s->addr, BMM150_REPZ, &val);