diff options
author | Zick Wei <zick.wei@quanta.corp-partner.google.com> | 2021-09-17 15:27:01 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-23 14:10:33 +0000 |
commit | e5253ca54aa540e6d0db997a9937de801b146e7d (patch) | |
tree | a821f2160810c8742a225bde0a81cddcb1066d31 | |
parent | 9c9ee9b28cda9f9bae751336e06e03accbec8f7f (diff) | |
download | chrome-ec-e5253ca54aa540e6d0db997a9937de801b146e7d.tar.gz |
nipperkin: support HDMI power control
This patch add gpio: EN_PWR_HDMI, HDMI_DATA_EN control,
set low when suspend, set high when resume.
BUG=b:193395015
BRANCH=none
TEST=check GPIO status in s0 and suspend.
Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Change-Id: I21155b5f572ed9d5a9ca01eb5dd9fc91c12b6344
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3167614
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
Commit-Queue: Rob Barnes <robbarnes@google.com>
-rw-r--r-- | board/nipperkin/board.c | 18 | ||||
-rw-r--r-- | board/nipperkin/gpio.inc | 6 |
2 files changed, 22 insertions, 2 deletions
diff --git a/board/nipperkin/board.c b/board/nipperkin/board.c index cdb3b6e642..42df3c312b 100644 --- a/board/nipperkin/board.c +++ b/board/nipperkin/board.c @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* Guybrush board-specific configuration */ +/* Nipperkin board-specific configuration */ #include "adc.h" #include "base_fw_config.h" @@ -321,3 +321,19 @@ static int board_get_temp(int idx, int *temp_k) return EC_ERROR_NOT_POWERED; return get_temp_3v3_30k9_47k_4050b(idx, temp_k); } + +/* Called on AP resume to S0 */ +static void board_chipset_resume(void) +{ + ioex_set_level(IOEX_HDMI_DATA_EN, 1); + ioex_set_level(IOEX_EN_PWR_HDMI, 1); +} +DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); + +/* Called on AP suspend */ +static void board_chipset_suspend(void) +{ + ioex_set_level(IOEX_EN_PWR_HDMI, 0); + ioex_set_level(IOEX_HDMI_DATA_EN, 0); +} +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); diff --git a/board/nipperkin/gpio.inc b/board/nipperkin/gpio.inc index 06e9fc3ccd..ec35ce6c2c 100644 --- a/board/nipperkin/gpio.inc +++ b/board/nipperkin/gpio.inc @@ -15,6 +15,10 @@ GPIO(C0_CHARGE_LED_WHITE_L, PIN(8, 0), GPIO_OUT_HIGH) GPIO(C1_CHARGE_LED_AMBER_L, PIN(6, 7), GPIO_OUT_HIGH) GPIO(C1_CHARGE_LED_WHITE_L, PIN(7, 0), GPIO_OUT_HIGH) +/* HDMI */ +IOEX(EN_PWR_HDMI, EXPIN(USBC_PORT_C0, 0, 3), GPIO_OUT_LOW) +IOEX(HDMI_DATA_EN, EXPIN(USBC_PORT_C0, 1, 4), GPIO_OUT_LOW) + /* Test Points */ GPIO(EC_GPIO56, PIN(5, 6), GPIO_INPUT | GPIO_PULL_UP) GPIO(EC_PS2_RST, PIN(6, 2), GPIO_INPUT | GPIO_PULL_UP) @@ -22,4 +26,4 @@ GPIO(EC_GPIOB0, PIN(B, 0), GPIO_INPUT | GPIO_PULL_UP) GPIO(EC_GPIO81, PIN(8, 1), GPIO_INPUT | GPIO_PULL_UP) GPIO(EC_FLPRG2, PIN(8, 6), GPIO_INPUT | GPIO_PULL_UP) GPIO(EC_PSL_GPO, PIN(D, 7), GPIO_INPUT | GPIO_PULL_UP) -GPIO(EC_PWM7, PIN(6, 0), GPIO_INPUT | GPIO_PULL_UP)
\ No newline at end of file +GPIO(EC_PWM7, PIN(6, 0), GPIO_INPUT | GPIO_PULL_UP) |