diff options
-rw-r--r-- | baseboard/zork/baseboard.c | 20 | ||||
-rw-r--r-- | baseboard/zork/baseboard.h | 1 | ||||
-rw-r--r-- | board/morphius/gpio.inc | 3 | ||||
-rw-r--r-- | board/trembyle/gpio.inc | 3 |
4 files changed, 25 insertions, 2 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index f2fe31891e..05fe765345 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -337,6 +337,9 @@ void baseboard_tcpc_init(void) /* Enable BC 1.2 interrupts */ gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_ODL); gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_ODL); + + /* Enable HPD interrupts */ + ioex_enable_interrupt(IOEX_HDMI_CONN_HPD_3V3_DB); } DECLARE_HOOK(HOOK_INIT, baseboard_tcpc_init, HOOK_PRIO_INIT_I2C + 1); @@ -1161,3 +1164,20 @@ void board_hibernate(void) msleep(300); } } + +static void hdmi_hpd_handler(void) +{ + int hpd = 0; + + /* Pass HPD through from DB OPT1 HDMI connector to AP's DP1. */ + ioex_get_level(IOEX_HDMI_CONN_HPD_3V3_DB, &hpd); + gpio_set_level(GPIO_DP1_HPD, hpd); + ccprints("HDMI HPD %d", hpd); +} +DECLARE_DEFERRED(hdmi_hpd_handler); + +void hdmi_hpd_interrupt(enum ioex_signal signal) +{ + /* Debounce for 2 msec. */ + hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); +} diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h index 269e012672..b186ee92bc 100644 --- a/baseboard/zork/baseboard.h +++ b/baseboard/zork/baseboard.h @@ -320,6 +320,7 @@ void board_reset_pd_mcu(void); void tcpc_alert_event(enum gpio_signal signal); void bc12_interrupt(enum gpio_signal signal); void ppc_interrupt(enum gpio_signal signal); +void hdmi_hpd_interrupt(enum ioex_signal signal); int board_is_convertible(void); void board_update_sensor_config_from_sku(void); diff --git a/board/morphius/gpio.inc b/board/morphius/gpio.inc index 268623373a..34999f69bc 100644 --- a/board/morphius/gpio.inc +++ b/board/morphius/gpio.inc @@ -56,6 +56,8 @@ GPIO(EC_PS2_RESET, PIN(3, 2), GPIO_OUT_LOW) /* Trackpoint reset pin */ GPIO(LED_FULL_L, PIN(6, 0), GPIO_OUT_HIGH) GPIO(LED_CHRG_L, PIN(C, 0), GPIO_OUT_HIGH) +IOEX_INT(HDMI_CONN_HPD_3V3_DB, EXPIN(USBC_PORT_C1, 1, 0), GPIO_INT_BOTH, hdmi_hpd_interrupt) + IOEX(USB_A0_RETIMER_EN, EXPIN(USBC_PORT_C0, 0, 0), GPIO_OUT_LOW) /* A0 Retimer Enable */ IOEX(USB_A0_RETIMER_RST, EXPIN(USBC_PORT_C0, 0, 1), GPIO_OUT_LOW) /* A0 Retimer Reset */ IOEX(USB_C0_FAULT_ODL, EXPIN(USBC_PORT_C0, 0, 3), GPIO_ODR_HIGH) /* C0 Fault to SOC */ @@ -73,7 +75,6 @@ IOEX(USB_A1_RETIMER_RST_DB, EXPIN(USBC_PORT_C1, 0, 1), GPIO_OUT_LOW) /* A1 Retim IOEX(USB_C1_HPD_IN_DB, EXPIN(USBC_PORT_C1, 0, 2), GPIO_OUT_LOW) /* C1 HPD */ IOEX(MST_HPD_OUT, EXPIN(USBC_PORT_C1, 0, 3), GPIO_INPUT) /* HPD from MST Hub */ IOEX(USB_C1_TCPC_FASTSW_CTL_EN, EXPIN(USBC_PORT_C1, 0, 4), GPIO_OUT_LOW) /* C1 FastSwitch Control */ -IOEX(HDMI_CONN_HPD_3V3_DB, EXPIN(USBC_PORT_C1, 1, 0), GPIO_INPUT) /* HDMI HPD */ IOEX(USB_C1_MUX_RST_DB, EXPIN(USBC_PORT_C1, 1, 1), GPIO_OUT_LOW) /* C1 Mux Reset */ IOEX(USB_C1_SBU_FAULT_DB_ODL, EXPIN(USBC_PORT_C1, 1, 2), GPIO_INPUT) /* C1 SBU Fault */ IOEX(USB_C1_PPC_EN_L, EXPIN(USBC_PORT_C1, 1, 3), GPIO_OUT_LOW) /* C1 PPC Enable */ diff --git a/board/trembyle/gpio.inc b/board/trembyle/gpio.inc index ad8ae7c738..bcbcbcb0ae 100644 --- a/board/trembyle/gpio.inc +++ b/board/trembyle/gpio.inc @@ -54,6 +54,8 @@ GPIO(DP2_HPD, PIN(C, 1), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */ GPIO(LED_FULL_L, PIN(6, 0), GPIO_OUT_HIGH) GPIO(LED_CHRG_L, PIN(C, 0), GPIO_OUT_HIGH) +IOEX_INT(HDMI_CONN_HPD_3V3_DB, EXPIN(USBC_PORT_C1, 1, 0), GPIO_INT_BOTH, hdmi_hpd_interrupt) + IOEX(USB_A0_RETIMER_EN, EXPIN(USBC_PORT_C0, 0, 0), GPIO_OUT_LOW) /* A0 Retimer Enable */ IOEX(USB_A0_RETIMER_RST, EXPIN(USBC_PORT_C0, 0, 1), GPIO_OUT_LOW) /* A0 Retimer Reset */ IOEX(USB_C0_FAULT_ODL, EXPIN(USBC_PORT_C0, 0, 3), GPIO_ODR_HIGH) /* C0 Fault to SOC */ @@ -71,7 +73,6 @@ IOEX(USB_A1_RETIMER_RST_DB, EXPIN(USBC_PORT_C1, 0, 1), GPIO_OUT_LOW) /* A1 Retim IOEX(USB_C1_HPD_IN_DB, EXPIN(USBC_PORT_C1, 0, 2), GPIO_OUT_LOW) /* C1 HPD */ IOEX(MST_HPD_OUT, EXPIN(USBC_PORT_C1, 0, 3), GPIO_INPUT) /* HPD from MST Hub */ IOEX(USB_C1_TCPC_FASTSW_CTL_EN, EXPIN(USBC_PORT_C1, 0, 4), GPIO_OUT_LOW) /* C1 FastSwitch Control */ -IOEX(HDMI_CONN_HPD_3V3_DB, EXPIN(USBC_PORT_C1, 1, 0), GPIO_INPUT) /* HDMI HPD */ IOEX(USB_C1_MUX_RST_DB, EXPIN(USBC_PORT_C1, 1, 1), GPIO_OUT_LOW) /* C1 Mux Reset */ IOEX(USB_C1_SBU_FAULT_DB_ODL, EXPIN(USBC_PORT_C1, 1, 2), GPIO_INPUT) /* C1 SBU Fault */ IOEX(USB_C1_PPC_EN_L, EXPIN(USBC_PORT_C1, 1, 3), GPIO_OUT_LOW) /* C1 PPC Enable */ |