summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2020-12-07 18:53:34 +0100
committerCommit Bot <commit-bot@chromium.org>2020-12-08 08:51:58 +0000
commitf03d488b98e67abc4dc337dc17cf30ca5f0c06a7 (patch)
tree1b7aa26842ed4002cd687058bbc013f65d4dc23e /power
parente8f63281b4d90127ff18f36262fabdc66aeee2d2 (diff)
downloadchrome-ec-f03d488b98e67abc4dc337dc17cf30ca5f0c06a7.tar.gz
power/host_sleep: Fix notifying about power state transitions
CL:2321874 moves sleep_set_notify() and sleep_notify_transition() under CONFIG_POWER_SLEEP_FAILURE_DETECTION ifdef and introduces their no-op counterparts if CONFIG_POWER_SLEEP_FAILURE_DETECTION is not defined. Before that CL aforementioned functions were outside ifdef. Commit message also mentions that CL is only moving code, not performing any logical changes. Therefore this CL is moving sleep_set_notify() and sleep_notify_transition() outside ifdef and removes their no-on counterparts to eliminate logical changes introduced in CL:2321874 Issue was found when running EC ToT on octopus (casta). When AP was going to S0ix EC reported that fact, but PD was not changing DRP state to 'toggle off'. BUG=b:162083524, b:161775827 BRANCH=none TEST=Compile and flash firmware on octopus (tested on casta). Go to ChromeOS Developer Console and issue 'powerd_dbus_suspend' Check EC console if PD stack is reporting state transition and make sure that DRP is set to 'toggling off' Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I6ba4187c8549ee6d9e3b19543d67c49520927cb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2575064 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'power')
-rw-r--r--power/host_sleep.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/power/host_sleep.c b/power/host_sleep.c
index 54a308d6c3..4bf10e2749 100644
--- a/power/host_sleep.c
+++ b/power/host_sleep.c
@@ -83,7 +83,6 @@ void power_set_host_sleep_state(enum host_sleep_event state)
host_sleep_state = state;
}
-#ifdef CONFIG_POWER_SLEEP_FAILURE_DETECTION
/* Flag to notify listeners about suspend/resume events. */
enum sleep_notify_type sleep_notify = SLEEP_NOTIFY_NONE;
@@ -105,6 +104,8 @@ void sleep_notify_transition(int check_state, int hook_id)
sleep_set_notify(SLEEP_NOTIFY_NONE);
}
+#ifdef CONFIG_POWER_SLEEP_FAILURE_DETECTION
+
static uint16_t sleep_signal_timeout;
static uint32_t sleep_signal_transitions;
static void (*sleep_timeout_callback)(void);
@@ -190,14 +191,6 @@ void sleep_reset_tracking(void)
#else /* !CONFIG_POWER_SLEEP_FAILURE_DETECTION */
/* No action */
-void sleep_set_notify(enum sleep_notify_type notify)
-{
-}
-
-void sleep_notify_transition(int check_state, int hook_id)
-{
-}
-
void sleep_suspend_transition(void)
{
}