diff options
-rw-r--r-- | baseboard/zork/variant_trembyle.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/baseboard/zork/variant_trembyle.c b/baseboard/zork/variant_trembyle.c index 1284ec5801..1f833c6dde 100644 --- a/baseboard/zork/variant_trembyle.c +++ b/baseboard/zork/variant_trembyle.c @@ -133,7 +133,10 @@ static void mst_hpd_handler(void) { int hpd = 0; - /* Pass HPD through from DB OPT3 MST hub to AP's DP1. */ + /* + * Ensure level on GPIO_DP1_HPD matches IOEX_MST_HPD_OUT, in case + * we got out of sync. + */ ioex_get_level(IOEX_MST_HPD_OUT, &hpd); gpio_set_level(GPIO_DP1_HPD, hpd); ccprints("MST HPD %d", hpd); @@ -142,7 +145,14 @@ DECLARE_DEFERRED(mst_hpd_handler); void mst_hpd_interrupt(enum ioex_signal signal) { - /* Debounce for 2 msec. */ + /* + * Goal is to pass HPD through from DB OPT3 MST hub to AP's DP1. + * Immediately invert GPIO_DP1_HPD, to pass through the edge on + * IOEX_MST_HPD_OUT. Then check level after 2 msec debounce. + */ + int hpd = !gpio_get_level(GPIO_DP1_HPD); + + gpio_set_level(GPIO_DP1_HPD, hpd); hook_call_deferred(&mst_hpd_handler_data, (2 * MSEC)); } |