summaryrefslogtreecommitdiff
path: root/board/samus
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-06-26 16:15:37 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-15 02:07:01 +0000
commitc0f78b4c0aca20203fefbc96c7e52c709455c06b (patch)
tree847f40c9332ee97b3855200520010b8e078e045c /board/samus
parent3b55292cdb76f1acd540b89ce16a24fda863bc62 (diff)
downloadchrome-ec-c0f78b4c0aca20203fefbc96c7e52c709455c06b.tar.gz
motion: Add sample frequency per sensor
Store at which frequency each sensor should be sampled. This frequency is different from the sensor frequency: - sensor frequency: frequency at which the sensor produce information. - sensor sampling frequency: frequency at the which the EC gater information. If 2 sensors must be sampled at very different frequency, we don't want to oversample the slow one, and filling the software FIFO unnecessarily. BRANCH=smaug TEST=Unit test. Check that frequency is correct when sensor frequencies change from IIO driver. BUG=chrome-os-partner:39900 Change-Id: I4272963413f53d4ca004e26639dc7a2affd317eb Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284616 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board/samus')
-rw-r--r--board/samus/board.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/board/samus/board.c b/board/samus/board.c
index da7eeb6f32..c665f23a6d 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -309,7 +309,8 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.default_config = {
.odr = 119000,
- .range = 2
+ .range = 2,
+ .ec_rate = SUSPEND_SAMPLING_INTERVAL,
}
},
@@ -325,7 +326,8 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &lid_standard_ref,
.default_config = {
.odr = 100000,
- .range = 2
+ .range = 2,
+ .ec_rate = SUSPEND_SAMPLING_INTERVAL,
}
},
@@ -341,7 +343,8 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = NULL,
.default_config = {
.odr = 119000,
- .range = 2000
+ .range = 2000,
+ .ec_rate = SUSPEND_SAMPLING_INTERVAL,
}
},