summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Zhong <zyw@rock-chips.com>2015-04-02 18:14:17 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-02 22:53:03 +0000
commitf3deb2118788774255651661aa4aec2307661ac5 (patch)
treee8d013c1c63aa33e882222a97b5e39572ee38e1d
parent4d0aad889476e3012f970fffa5305d5c9386cc47 (diff)
downloadchrome-ec-f3deb2118788774255651661aa4aec2307661ac5.tar.gz
motion: do not enter S3 if it is already in S5
If sensor->active is S5, do not enter S3, since the sensor has been shut down. BUG=chrome-os-partner:38627 TEST=Gsensor works well BRANCH=firmware-veyron-6588.B Change-Id: I35ab82b8e197b3bc8f8a4d3ae7d8c3b70c17e385 Signed-off-by: Chris Zhong <zyw@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/263628 Tested-by: 小华 王 <anndy_wang@asus.com> Tested-by: BoChao Jhan <james_chao@asus.com> Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Alexandru Stan <amstan@chromium.org> Commit-Queue: Alexandru Stan <amstan@chromium.org>
-rw-r--r--common/motion_sense.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 5e61b8fcec..f303853e72 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -97,6 +97,11 @@ static void motion_sense_suspend(void)
for (i = 0; i < motion_sensor_count; i++) {
sensor = &motion_sensors[i];
+
+ /* if it is in s5, don't enter suspend */
+ if (sensor->active == SENSOR_ACTIVE_S5)
+ continue;
+
sensor->active = SENSOR_ACTIVE_S3;
/* Saving power if the sensor is not active in S3 */