diff options
author | Anton Staaf <robotboy@chromium.org> | 2016-02-01 09:13:40 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-02-03 17:16:31 -0800 |
commit | f6f06c95d673c8912e2ddabe00a0606c20823b04 (patch) | |
tree | 73dedc82ebe70af8c22a4784ba6d78476c19c581 | |
parent | bc404c94b4ab1e6a62e607fd7ef034aa31d6388e (diff) | |
download | chrome-ec-f6f06c95d673c8912e2ddabe00a0606c20823b04.tar.gz |
NPCX: Move control of PD GPIO hibernation state to board
Use board_set_gpio_hibernate_state to configure the PD GPIO's to support
charging while hibernating.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: I7b960967670c07f4861a59345bc23c97d3f61cc0
Reviewed-on: https://chromium-review.googlesource.com/325443
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
-rw-r--r-- | board/wheatley/board.c | 10 | ||||
-rw-r--r-- | chip/npcx/system.c | 15 |
2 files changed, 9 insertions, 16 deletions
diff --git a/board/wheatley/board.c b/board/wheatley/board.c index bf62ad847c..e8166903c1 100644 --- a/board/wheatley/board.c +++ b/board/wheatley/board.c @@ -395,7 +395,15 @@ void board_set_gpio_hibernate_state(void) * In hibernate, this pin connected to GND. Set it to output * low to eliminate the current caused by internal pull-up. */ - {GPIO_PLATFORM_EC_PROCHOT, GPIO_OUTPUT | GPIO_LOW} + {GPIO_PLATFORM_EC_PROCHOT, GPIO_OUTPUT | GPIO_LOW}, + /* + * Leave USB-C charging enabled in hibernate, in order to + * allow wake-on-plug. 5V enable must be pulled low. + */ + {GPIO_USB_C0_5V_EN, GPIO_INPUT | GPIO_PULL_DOWN}, + {GPIO_USB_C0_CHARGE_EN_L, GPIO_OUTPUT | GPIO_LOW}, + {GPIO_USB_C1_5V_EN, GPIO_INPUT | GPIO_PULL_DOWN}, + {GPIO_USB_C1_CHARGE_EN_L, GPIO_OUTPUT | GPIO_LOW}, }; /* Change GPIOs' state in hibernate for better power consumption */ diff --git a/chip/npcx/system.c b/chip/npcx/system.c index 8e01f9955c..55c248d602 100644 --- a/chip/npcx/system.c +++ b/chip/npcx/system.c @@ -327,21 +327,6 @@ void system_set_gpios_and_wakeup_inputs_hibernate(void) for (i = 0; i < hibernate_wake_pins_used; i++) gpio_reset(hibernate_wake_pins[i]); -#ifdef CONFIG_USB_PD_PORT_COUNT - /* - * Leave USB-C charging enabled in hibernate, in order to - * allow wake-on-plug. 5V enable must be pulled low. - */ -#if CONFIG_USB_PD_PORT_COUNT > 0 - gpio_set_flags(GPIO_USB_C0_5V_EN, GPIO_PULL_DOWN | GPIO_INPUT); - gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 0); -#endif -#if CONFIG_USB_PD_PORT_COUNT > 1 - gpio_set_flags(GPIO_USB_C1_5V_EN, GPIO_PULL_DOWN | GPIO_INPUT); - gpio_set_level(GPIO_USB_C1_CHARGE_EN_L, 0); -#endif -#endif /* CONFIG_USB_PD_PORT_COUNT */ - /* board-level function to set GPIOs state in hibernate */ if (board_set_gpio_hibernate_state) board_set_gpio_hibernate_state(); |