From f3deb2118788774255651661aa4aec2307661ac5 Mon Sep 17 00:00:00 2001 From: Chris Zhong Date: Thu, 2 Apr 2015 18:14:17 +0800 Subject: motion: do not enter S3 if it is already in S5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://chromium-review.googlesource.com/263628 Tested-by: 小华 王 Tested-by: BoChao Jhan Reviewed-by: Alec Berg Reviewed-by: Alexandru Stan Commit-Queue: Alexandru Stan --- common/motion_sense.c | 5 +++++ 1 file changed, 5 insertions(+) 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 */ -- cgit v1.2.1