summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-08-30 22:12:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-11 13:50:56 -0700
commit3b1847d81053d211febc98604f4a3101c389f1ac (patch)
tree330c82a8b3502c16cf9335dec110c482a534b586
parentb3cd77eca5b39f6e19add397a7ddf01125c0134e (diff)
downloadchrome-ec-3b1847d81053d211febc98604f4a3101c389f1ac.tar.gz
motion: Fix a bug in accelrate
Allow accelrate to suspend a sensor, even if the AP is using it. For debugging only. BRANCH=smaug TEST=before accelrate 0 0 would not suspend the accelerometer in SO, the AP is using it. BUG=b:23570481 Change-Id: Iea4f616d0a0d1b4a0b0fa2bc942d05b2a2425926 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/296210 Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--common/motion_sense.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 21066c7f40..0e32f6c97c 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -1053,10 +1053,12 @@ static int command_accel_data_rate(int argc, char **argv)
}
/*
+ * Take ownership of the sensor and
* Write new data rate, if it returns invalid arg, then
* return a parameter error.
*/
config_id = motion_sense_get_ec_config();
+ sensor->config[SENSOR_CONFIG_AP].odr = 0;
sensor->config[config_id].odr =
data | (round ? ROUND_UP_FLAG : 0);
ret = motion_sense_set_data_rate(sensor);