summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-08-30 12:57:14 +0800
committerCommit Bot <commit-bot@chromium.org>2019-10-08 07:43:03 +0000
commit4231e6997e4a75764c7d4fc6b96f4cc090ee026c (patch)
treed672cf6b1c278511fbb89b8835be4cc54072dc9a
parentf483ce792c4b15f9f49264d44e449b3628b13df7 (diff)
downloadchrome-ec-4231e6997e4a75764c7d4fc6b96f4cc090ee026c.tar.gz
jacuzzi: disable PP1800 when chipset off
To improve G3 power consumption, a pin EN_PP1800_S5_L is added in board rev 1 and should be turned on before pmic on, and turned off after pmic off. BUG=b:138180455,b:141592177 TEST=verify jacuzzi rev 1 is bootable with this change BRANCH=master Change-Id: Iacd9b0fab97d775f15faa9b2df491940871bc7ff Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1773031 Reviewed-by: Yilun Lin <yllin@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/jacuzzi/board.c29
-rw-r--r--board/jacuzzi/gpio.inc2
-rw-r--r--power/mt8183.c2
3 files changed, 32 insertions, 1 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c
index 78973eba95..d9e66c63b4 100644
--- a/board/jacuzzi/board.c
+++ b/board/jacuzzi/board.c
@@ -256,13 +256,42 @@ static void board_chipset_startup(void)
}
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
+static void disable_pp1800_s5_deferred(void);
+DECLARE_DEFERRED(disable_pp1800_s5_deferred);
+
+static void disable_pp1800_s5_deferred(void)
+{
+ if (power_get_state() == POWER_G3)
+ gpio_set_level(GPIO_EN_PP1800_S5_L, 1);
+ else if (power_get_state() == POWER_S5G3 ||
+ power_get_state() == POWER_S3S5 ||
+ power_get_state() == POWER_S5)
+ /* pmic is still on, wait a few seconds and try again */
+ hook_call_deferred(&disable_pp1800_s5_deferred_data,
+ SECOND);
+}
+
/* Called on AP S3 -> S5 transition */
static void board_chipset_shutdown(void)
{
gpio_set_level(GPIO_EN_USBA_5V, 0);
+ if (board_get_version() >= 1)
+ /*
+ * use deferred to make sure pp1800_s5 is turned off after pmic
+ * off.
+ */
+ hook_call_deferred(&disable_pp1800_s5_deferred_data,
+ SECOND);
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
+void board_chipset_pre_init(void)
+{
+ if (board_get_version() >= 1)
+ gpio_set_level(GPIO_EN_PP1800_S5_L, 0);
+}
+DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, board_chipset_pre_init, HOOK_PRIO_DEFAULT);
+
int board_get_charger_i2c(void)
{
/* TODO(b:138415463): confirm the bus allocation for future builds */
diff --git a/board/jacuzzi/gpio.inc b/board/jacuzzi/gpio.inc
index 84c828841b..432a2ebf8e 100644
--- a/board/jacuzzi/gpio.inc
+++ b/board/jacuzzi/gpio.inc
@@ -38,7 +38,6 @@ GPIO_INT(BC12_EC_INT_ODL, PIN(C, 9), GPIO_INT_FALLING,
GPIO(KB_INT_ODL, PIN(A, 8), GPIO_INPUT)
GPIO(ALS_RGB_INT_ODL, PIN(C, 10), GPIO_INPUT)
GPIO(TABLET_MODE_L, PIN(B, 11), GPIO_INPUT)
-GPIO(LID_ACCEL_INT_ODL, PIN(A, 14), GPIO_INPUT)
/* Reset pins */
GPIO(AP_SYS_RST_L, PIN(C, 11), GPIO_OUT_LOW)
@@ -77,6 +76,7 @@ GPIO(EC_INT_L, PIN(C, 7), GPIO_ODR_HIGH) /* EC_AP_INT_ODL */
GPIO(EC_BOARD_ID_EN_L, PIN(C, 15), GPIO_ODR_HIGH) /* EC_BOARD_ID_EN_ODL */
GPIO(USB_C0_HPD_OD, PIN(F, 1), GPIO_ODR_LOW)
GPIO(BOOTBLOCK_EN_L, PIN(C, 1), GPIO_ODR_HIGH)
+GPIO(EN_PP1800_S5_L, PIN(A, 14), GPIO_OUT_HIGH)
/*
* TODO(b:138352732): On IT88801 expander, To be readded once IT8801 driver and
diff --git a/power/mt8183.c b/power/mt8183.c
index 683e6d274e..892cc6d718 100644
--- a/power/mt8183.c
+++ b/power/mt8183.c
@@ -299,6 +299,8 @@ enum power_state power_handle_state(enum power_state state)
return POWER_S5;
case POWER_S5S3:
+ hook_notify(HOOK_CHIPSET_PRE_INIT);
+
/*
* Release power button in case it was pressed by force shutdown
* sequence.