From df0c0b2b33df8a3594ec7c6503f9577d8bc578c4 Mon Sep 17 00:00:00 2001 From: Archana Patni Date: Thu, 23 Feb 2017 10:40:47 +0530 Subject: Poppy: Enter/exit from S0ix based on host commands from kernel This patch enables the entry/exit model for S0ix based on host commands. The kernel will send host events on kernel freeze/thaw exit; EC will initiate the S0ix entry based on host command and exit via another host command from kernel. BRANCH=none BUG=b:36630881 TEST=Build/flash EC and check 'echo freeze > /sys/power/state' command in OS shell. Verify EC goes to S0ix state, and on wake it comes back to S0 state. Change-Id: I22405021aead8488a5a1f166400cbde76faac59b Signed-off-by: Subramony Sesha Signed-off-by: Archana Patni Reviewed-on: https://chromium-review.googlesource.com/446219 Commit-Ready: Archana Patni Tested-by: Archana Patni Reviewed-by: Furquan Shaikh --- board/poppy/board.c | 1 - board/poppy/board.h | 3 ++- board/poppy/gpio.inc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/poppy/board.c b/board/poppy/board.c index 7b0ca64c5b..b6afe92153 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -205,7 +205,6 @@ void base_detect_interrupt(enum gpio_signal signal) /* power signal list. Must match order of enum power_signal. */ const struct power_signal_info power_signal_list[] = { - {GPIO_PCH_SLP_S0_L, 1, "SLP_S0_DEASSERTED"}, #ifdef CONFIG_ESPI_VW_SIGNALS {VW_SLP_S3_L, 1, "SLP_S3_DEASSERTED"}, {VW_SLP_S4_L, 1, "SLP_S4_DEASSERTED"}, diff --git a/board/poppy/board.h b/board/poppy/board.h index a52f560c7e..c70d2c3fa6 100644 --- a/board/poppy/board.h +++ b/board/poppy/board.h @@ -87,6 +87,8 @@ #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON #define CONFIG_POWER_SIGNAL_INTERRUPT_STORM_DETECT_THRESHOLD 30 +#define CONFIG_POWER_S0IX +#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE /* Sensor */ #define CONFIG_ALS @@ -179,7 +181,6 @@ #include "registers.h" enum power_signal { - X86_SLP_S0_DEASSERTED, X86_SLP_S3_DEASSERTED, X86_SLP_S4_DEASSERTED, X86_SLP_SUS_DEASSERTED, diff --git a/board/poppy/gpio.inc b/board/poppy/gpio.inc index 673a3a66af..1e5034edd3 100644 --- a/board/poppy/gpio.inc +++ b/board/poppy/gpio.inc @@ -10,7 +10,6 @@ GPIO_INT(USB_C0_PD_INT_ODL, PIN(3, 7), GPIO_INT_FALLING, tcpc_alert_event) GPIO_INT(USB_C1_PD_INT_ODL, PIN(C, 5), GPIO_INT_FALLING, tcpc_alert_event) -GPIO_INT(PCH_SLP_S0_L, PIN(7, 5), GPIO_INT_BOTH, power_signal_interrupt) /* Use VW signals instead of GPIOs */ #ifndef CONFIG_ESPI_VW_SIGNALS GPIO_INT(PCH_SLP_S3_L, PIN(7, 3), GPIO_INT_BOTH, power_signal_interrupt) @@ -50,6 +49,7 @@ GPIO(CCD_MODE_ODL, PIN(6, 3), GPIO_INPUT) /* Case Closed Debug Mode */ GPIO(EC_HAVEN_RESET_ODL, PIN(0, 2), GPIO_ODR_HIGH) /* H1 Reset */ GPIO(ENTERING_RW, PIN(7, 6), GPIO_OUTPUT) /* EC Entering RW */ GPIO(PMIC_INT_L, PIN(6, 0), GPIO_INPUT) /* PMIC interrupt */ +GPIO(PCH_SLP_S0_L, PIN(7, 5), GPIO_INPUT) /* Sensor interrupts, not implemented yet */ GPIO(ALS_INT_L, PIN(2, 5), GPIO_INPUT) -- cgit v1.2.1