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>
This commit is contained in:
Patryk Duda 2020-12-07 18:53:34 +01:00 committed by Commit Bot
parent e8f63281b4
commit f03d488b98
1 changed files with 2 additions and 9 deletions

View File

@ -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)
{
}