summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorMulin Chao <mlchao@nuvoton.com>2019-01-14 18:02:56 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-16 01:46:51 -0800
commit0ac674092fe63018442acd05500003e6d92872ad (patch)
tree3c8838dfa03ba81d25070da258e1e4a8e69667d0 /chip
parente72e82db71624a1ef02725d384ae06a138585a01 (diff)
downloadchrome-ec-0ac674092fe63018442acd05500003e6d92872ad.tar.gz
npcx: shi: enable sleep bit in suspend hook function.
In order to make sure ec can enter deep sleep even if there's a CS drop at S5, the shi driver turns off it's interrupt in suspend hook function in case the sleep bit, SLEEP_MASK_SPI, is disabled in shi's ISR. However, in some cases, CS dropped before ec was informed by hook function. It will make ec cannot enter deep sleep at S5. This CL allows ec enter deep idle at S5. It will enable sleep bit, directly in suspend hook function even if CS drops before ec was informed. BRANCH=none BUG=b:118844551 TEST=No build errors for npcx7 series. Change-Id: I61719fad74bfd85006b6c90dd46b69cb103dcfa9 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/1410792 Reviewed-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'chip')
-rw-r--r--chip/npcx/shi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/chip/npcx/shi.c b/chip/npcx/shi.c
index 1c0f1cb38a..464ad9db5f 100644
--- a/chip/npcx/shi.c
+++ b/chip/npcx/shi.c
@@ -972,6 +972,12 @@ static void shi_disable(void)
* SHI_SDI SHI_SDO SHI_CS# SHI_SCLK are selected to GPIO
*/
CLEAR_BIT(NPCX_DEVALT(ALT_GROUP_C), NPCX_DEVALTC_SHI_SL);
+
+ /*
+ * Allow deep sleep again in case CS dropped before ec was
+ * informed in hook function and turn off SHI's interrupt in time.
+ */
+ enable_sleep(SLEEP_MASK_SPI);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, shi_disable, HOOK_PRIO_DEFAULT);
DECLARE_HOOK(HOOK_SYSJUMP, shi_disable, HOOK_PRIO_DEFAULT);