diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-11-22 20:55:14 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-28 15:44:19 -0800 |
commit | 126a303c69a77a7bf7317bc5778c68ed16ed326a (patch) | |
tree | 3b2ec69fc0132aeb5973b1fcfa4f6f17e226ad7e /common | |
parent | 443207913b0490e004a87151ebf51f1b96140edd (diff) | |
download | chrome-ec-126a303c69a77a7bf7317bc5778c68ed16ed326a.tar.gz |
chipset: Introduce CHIPSET_STATE_ANY_SUSPEND
There are two different types of suspend states that are supported on
x86 platforms -- S3 and S0ix. When AP enters S3, the chipset state is
identified as CHIPSET_STATE_SUSPEND. On the other hand, when AP enters
S0ix, the chipset state is identified as CHIPSET_STATE_STANDBY. There
are several components within the EC e.g. charger state machine, usb
pd task, motion sense task that take actions based on the chipset
suspend state (and checked only for CHIPSET_STATE_SUSPEND until
now). In order to ensure that different EC components do not have to
worry about checking for all the different types of suspend states
that are supported, introduce a new combination
CHIPSET_STATE_ANY_SUSPEND which is a combination of
CHIPSET_STATE_SUSPEND(S3) and CHIPSET_STATE_STANDBY(S0ix).
BUG=b:69690699
BRANCH=None
TEST=make -j buildall. Ruben verified that with this change, EC power
consumption in S0ix drops from 7.85mW to 6.59mW on Soraka.
Change-Id: I599a0ea2fe2f39132764a6068fa77c3aea02affa
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/786919
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/charge_state_v2.c | 2 | ||||
-rw-r--r-- | common/led_policy_std.c | 3 | ||||
-rw-r--r-- | common/usb_pd_protocol.c | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 4de4faf51a..014a647cce 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -959,7 +959,7 @@ wait_for_it: curr.state == ST_DISCHARGE) { /* If AP is off, we can sleep a long time */ if (chipset_in_state(CHIPSET_STATE_ANY_OFF | - CHIPSET_STATE_SUSPEND)) + CHIPSET_STATE_ANY_SUSPEND)) sleep_usec = CHARGE_POLL_PERIOD_VERY_LONG; else diff --git a/common/led_policy_std.c b/common/led_policy_std.c index 631d905754..e9fe4568a2 100644 --- a/common/led_policy_std.c +++ b/common/led_policy_std.c @@ -142,8 +142,7 @@ static void std_led_set_power(void) pwr_led_set_color(LED_OFF); else if (chipset_in_state(CHIPSET_STATE_ON)) pwr_led_set_color(LED_WHITE); - else if (chipset_in_state(CHIPSET_STATE_SUSPEND | - CHIPSET_STATE_STANDBY)) + else if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND)) pwr_led_set_color((power_second & 3) ? LED_OFF : LED_WHITE); } diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 5dd8c87b1e..ab485963ee 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1974,7 +1974,7 @@ static void pd_init_tasks(void) /* Set dual-role state based on chipset power state */ if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) drp_state = PD_DRP_FORCE_SINK; - else if (chipset_in_state(CHIPSET_STATE_SUSPEND)) + else if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND)) drp_state = PD_DRP_TOGGLE_OFF; else /* CHIPSET_STATE_ON */ drp_state = PD_DRP_TOGGLE_ON; |