diff options
author | Jonathan Brandmeyer <jbrandmeyer@chromium.org> | 2018-06-07 11:04:20 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-28 12:47:06 -0700 |
commit | 616e73051406c6aac806a6abd17018149376e2aa (patch) | |
tree | 015cc0754c916ea58ced8626c8ce20e4bb7ec4fe /common/motion_sense.c | |
parent | b6f2187bb736cdbebc369de54aa749cd1775e719 (diff) | |
download | chrome-ec-616e73051406c6aac806a6abd17018149376e2aa.tar.gz |
motion_sense: Provide option to defer resume actions.
See also crrev.com/c/433338. Grunt requires a delay on startup to
account for the slew rate on the sensor power rails. Similar to the
delay option for suspend actions, also provide a delay option for resume
actions.
BUG=b:79159777, b:35550738
TEST=KX022 init on S5->S3->S0 succeeds on both grunt clamshell and grunt
convertible SKUs.
BRANCH=none
Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Change-Id: I061c4c148c5c31c09b8d0c1d40aef1ba1e3d344b
Reviewed-on: https://chromium-review.googlesource.com/1091211
Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r-- | common/motion_sense.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index 6929bb5710..1fe3aeb064 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -589,7 +589,7 @@ static void motion_sense_suspend(void) * brief stop in S3. */ hook_call_deferred(&motion_sense_switch_sensor_rate_data, - CONFIG_MOTION_SENSE_SUSPEND_DELAY_US); + CONFIG_MOTION_SENSE_SUSPEND_DELAY_US); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, motion_sense_suspend, MOTION_SENSE_HOOK_PRIO); @@ -597,7 +597,8 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, motion_sense_suspend, static void motion_sense_resume(void) { sensor_active = SENSOR_ACTIVE_S0; - motion_sense_switch_sensor_rate(); + hook_call_deferred(&motion_sense_switch_sensor_rate_data, + CONFIG_MOTION_SENSE_RESUME_DELAY_US); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, motion_sense_resume, MOTION_SENSE_HOOK_PRIO); |