diff options
author | Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> | 2020-09-29 10:21:37 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-30 07:49:55 +0000 |
commit | 9e7a0e936e66731ad73893b1304eebbca8a1e206 (patch) | |
tree | c0ecc7e20db3a8bcd0e5bdafb51e8df3b37e8a44 /board/woomax/board.c | |
parent | 8190cfa178872296d8720f69c337a30f9737225d (diff) | |
download | chrome-ec-9e7a0e936e66731ad73893b1304eebbca8a1e206.tar.gz |
woomax: Use HPD to disable pi3hdx1204 in S0
BUG=b:169300359
BRANCH=zork
TEST=check power consumption
Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>
Change-Id: Ie1736313d004783ac2dc6bfd41591afa05c4edbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2437573
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'board/woomax/board.c')
-rw-r--r-- | board/woomax/board.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/board/woomax/board.c b/board/woomax/board.c index f439bddda1..2a88f43bf4 100644 --- a/board/woomax/board.c +++ b/board/woomax/board.c @@ -213,6 +213,7 @@ static void board_chipset_resume(void) { int rv; int retry; + int hpd = gpio_get_level(GPIO_DP1_HPD_EC_IN); ioex_set_level(IOEX_USB_A0_RETIMER_EN, 1); ioex_set_level(IOEX_HDMI_DATA_EN_DB, 1); @@ -237,7 +238,7 @@ static void board_chipset_resume(void) msleep(PI3HDX1204_POWER_ON_DELAY_MS); pi3hdx1204_enable(I2C_PORT_TCPC1, PI3HDX1204_I2C_ADDR_FLAGS, - 1); + hpd); } } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); @@ -341,6 +342,10 @@ static void setup_fw_config(void) /* Enable Gyro interrupts */ gpio_enable_interrupt(GPIO_6AXIS_INT_L); + /* Enable DP1_HPD_EC_IN interrupt */ + if (ec_config_has_hdmi_retimer_pi3hdx1204()) + gpio_enable_interrupt(GPIO_DP1_HPD_EC_IN); + setup_mux(); } /* Use HOOK_PRIO_INIT_I2C + 2 to be after ioex_init(). */ @@ -508,3 +513,20 @@ static void keyboard_init(void) } DECLARE_HOOK(HOOK_INIT, keyboard_init, HOOK_PRIO_INIT_I2C + 1); +static void hdmi_hpd_handler(void) +{ + int hpd = gpio_get_level(GPIO_DP1_HPD_EC_IN); + + pi3hdx1204_enable(I2C_PORT_TCPC1, + PI3HDX1204_I2C_ADDR_FLAGS, + chipset_in_or_transitioning_to_state(CHIPSET_STATE_ON) + && hpd); +} +DECLARE_DEFERRED(hdmi_hpd_handler); + +void hdmi_hpd_interrupt(enum gpio_signal signal) +{ + /* Debounce 2 msec */ + hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); +} + |