diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-10-13 16:27:43 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-15 18:08:25 -0700 |
commit | 50b1a9de02ab8149a43099abd0c68bcac0a420eb (patch) | |
tree | c9206af5cb1bf07d91dbe4459de769d92efb4182 | |
parent | 0174b9a21d0764bf32243cf23a3f138bf44e5938 (diff) | |
download | chrome-ec-50b1a9de02ab8149a43099abd0c68bcac0a420eb.tar.gz |
driver: bmm150: Use Bosch recommend repetition
To minimize noise, instead of using recommend preset from the
documentation, use specific repetition value.
BRANCH=smaug
BUG=chrome-os-partner:45436
TEST=Check the noise is somewhat reduced, still not great.
Change-Id: I0ed3409dd907fa1e393d1eb77b6f23ff03763e53
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/305588
Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r-- | driver/mag_bmm150.c | 4 | ||||
-rw-r--r-- | driver/mag_bmm150.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/driver/mag_bmm150.c b/driver/mag_bmm150.c index b5658f2ba3..6f81ea407a 100644 --- a/driver/mag_bmm150.c +++ b/driver/mag_bmm150.c @@ -118,8 +118,8 @@ int bmm150_init(const struct motion_sensor_t *s) /* Set the repetition in "Regular Preset" */ - raw_mag_write8(s->addr, BMM150_REPXY, BMM150_REP(REGULAR, XY)); - raw_mag_write8(s->addr, BMM150_REPZ, BMM150_REP(REGULAR, Z)); + raw_mag_write8(s->addr, BMM150_REPXY, BMM150_REP(SPECIAL, XY)); + raw_mag_write8(s->addr, BMM150_REPZ, BMM150_REP(SPECIAL, Z)); ret = raw_mag_read8(s->addr, BMM150_REPXY, &val); CPRINTS("repxy: 0x%02x", val); ret = raw_mag_read8(s->addr, BMM150_REPZ, &val); diff --git a/driver/mag_bmm150.h b/driver/mag_bmm150.h index 4a6af7ee0d..a76c68cf3d 100644 --- a/driver/mag_bmm150.h +++ b/driver/mag_bmm150.h @@ -40,11 +40,13 @@ #define BMM150_REGULAR_nXY 9 #define BMM150_ENHANCED_nXY 15 #define BMM150_HIGH_ACCURACY_nXY 47 +#define BMM150_SPECIAL_nXY 75 #define BMM150_REPZ 0x52 #define BMM150_LOW_POWER_nZ 3 #define BMM150_REGULAR_nZ 15 #define BMM150_ENHANCED_nZ 27 #define BMM150_HIGH_ACCURACY_nZ 83 +#define BMM150_SPECIAL_nZ 27 #define BMM150_REP(_preset, _axis) CONCAT4(BMM150_, _preset, _n, _axis) |