diff --git a/power/intel_x86.c b/power/intel_x86.c index 13f2be53ac..6b87c88d83 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -100,15 +100,16 @@ static enum power_state power_wait_s5_rtc_reset(void) * The chipset_in_state(CHIPSET_STATE_STANDBY | CHIPSET_STATE_ON) * is used to detect the S0ix transiton. * - * During S0ix entry, the wake mask for lid open is enabled. + * During S0ix entry, the wake mask for lid open and tablet mode is enabled. */ -static void s0ix_lpc_enable_wake_mask_for_lid_open(void) +static void s0ix_lpc_enable_wake_mask(void) { if (chipset_in_state(CHIPSET_STATE_STANDBY | CHIPSET_STATE_ON)) { uint32_t mask; mask = lpc_get_host_event_mask(LPC_HOST_EVENT_WAKE) | - EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN); + EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) | + EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE); lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, mask); } @@ -118,16 +119,17 @@ static void s0ix_lpc_enable_wake_mask_for_lid_open(void) * In AP S0ix & S3 -> S0 transitions, * the chipset_resume hook is called. * - * During S0ix exit, the wake mask for lid open is disabled. + * During S0ix exit, the wake mask for lid open and tablet mode is disabled. * All pending events are cleared */ -static void s0ix_lpc_disable_wake_mask_for_lid_open(void) +static void s0ix_lpc_disable_wake_mask(void) { if (chipset_in_state(CHIPSET_STATE_STANDBY | CHIPSET_STATE_ON)) { uint32_t mask; mask = lpc_get_host_event_mask(LPC_HOST_EVENT_WAKE) & - ~EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN); + ~EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) & + ~EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE); lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, mask); @@ -341,7 +343,7 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) /* call hooks before standby */ hook_notify(HOOK_CHIPSET_SUSPEND); - s0ix_lpc_enable_wake_mask_for_lid_open(); + s0ix_lpc_enable_wake_mask(); /* * Enable idle task deep sleep. Allow the low power idle task @@ -353,7 +355,7 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) case POWER_S0ixS0: - s0ix_lpc_disable_wake_mask_for_lid_open(); + s0ix_lpc_disable_wake_mask(); /* Call hooks now that rails are up */ hook_notify(HOOK_CHIPSET_RESUME);