summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiong.huang <xiong.huang@bitland.corp-partner.google.com>2019-09-17 18:09:59 +0800
committerCommit Bot <commit-bot@chromium.org>2019-10-08 08:07:51 +0000
commit0e2cc2816089abd4fe655bcc9218b1cbe1bb3731 (patch)
tree603f12caafee52e9926cc7eec5a1234fa4e8fb27
parent159bc2bccee3ea897d4f89abe2f86d9e8c933815 (diff)
downloadchrome-ec-0e2cc2816089abd4fe655bcc9218b1cbe1bb3731.tar.gz
kodama: not provide dock keyboard power supply in S5/G3
When dock keyboard is connected to MB, MB doesn't provide power supply for dock keyboard to save system power in S5/G3. BUG=b:141157295 BRANCH=master TEST=GPIO EN_PP3300_POGO level is 0 through command 'ectool gpioget'. measure power of dock keyboard with multimeter. Change-Id: I587f39063054de83dbbeb12bd23a1113a04e61da Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1809180 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--baseboard/kukui/base_detect_kukui.c18
-rw-r--r--board/kodama/board.c3
2 files changed, 16 insertions, 5 deletions
diff --git a/baseboard/kukui/base_detect_kukui.c b/baseboard/kukui/base_detect_kukui.c
index f72988543f..12c0090a52 100644
--- a/baseboard/kukui/base_detect_kukui.c
+++ b/baseboard/kukui/base_detect_kukui.c
@@ -166,11 +166,25 @@ void pogo_adc_interrupt(enum gpio_signal signal)
base_detect_debounce_time = time_now + BASE_DETECT_DEBOUNCE_US;
}
-static void base_init(void)
+/* Called on AP S5 -> S3 transition */
+static void pogo_chipset_startup(void)
{
+ /* Enable pogo interrupt */
+ gpio_enable_interrupt(GPIO_POGO_ADC_INT_L);
+
hook_call_deferred(&base_detect_deferred_data, 0);
}
-DECLARE_HOOK(HOOK_INIT, base_init, HOOK_PRIO_INIT_ADC + 1);
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, pogo_chipset_startup, HOOK_PRIO_DEFAULT);
+
+/* Called on AP S3 -> S5 transition */
+static void pogo_chipset_shutdown(void)
+{
+ /* Disable pogo interrupt */
+ gpio_disable_interrupt(GPIO_POGO_ADC_INT_L);
+
+ enable_power_supply(0);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, pogo_chipset_shutdown, HOOK_PRIO_DEFAULT);
#ifdef VARIANT_KUKUI_POGO_DOCK
static void board_pogo_charge_init(void)
diff --git a/board/kodama/board.c b/board/kodama/board.c
index 721242c240..0650301731 100644
--- a/board/kodama/board.c
+++ b/board/kodama/board.c
@@ -224,9 +224,6 @@ static void board_init(void)
/* Enable interrupt from PMIC. */
gpio_enable_interrupt(GPIO_PMIC_EC_RESETB);
- /* Enable pogo interrupt */
- gpio_enable_interrupt(GPIO_POGO_ADC_INT_L);
-
/* Display bias settings. */
mt6370_db_set_voltages(6000, 5800, 5800);