summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-10-13 16:27:43 -0700
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-10-16 02:50:19 +0000
commit45179e9aefced99c145b6c7d8384d8a32850bc81 (patch)
tree50a6c7818a3b03e670f9c384791aaa389d269267
parentac3c962dafd8bf33f521941e128ebf0646874e2c (diff)
downloadchrome-ec-45179e9aefced99c145b6c7d8384d8a32850bc81.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> (cherry picked from commit 50b1a9de02ab8149a43099abd0c68bcac0a420eb) Reviewed-on: https://chromium-review.googlesource.com/306187
-rw-r--r--driver/mag_bmm150.c4
-rw-r--r--driver/mag_bmm150.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/driver/mag_bmm150.c b/driver/mag_bmm150.c
index 0f8bc8b102..665b86e58d 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)