diff options
Diffstat (limited to 'zephyr/subsys/ap_pwrseq/signal_vw.c')
-rw-r--r-- | zephyr/subsys/ap_pwrseq/signal_vw.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/zephyr/subsys/ap_pwrseq/signal_vw.c b/zephyr/subsys/ap_pwrseq/signal_vw.c index de2756c137..53719a9c4f 100644 --- a/zephyr/subsys/ap_pwrseq/signal_vw.c +++ b/zephyr/subsys/ap_pwrseq/signal_vw.c @@ -40,9 +40,8 @@ DT_FOREACH_STATUS_OKAY(MY_COMPAT, INIT_ESPI_SIGNAL) */ static atomic_t signal_data; /* - * Mask of valid signals. If the bus is reset, this is cleared, - * and when a signal is updated the associated bit is set to indicate - * the signal is valid. + * Mask of valid signals. A signal is considered valid once an + * initial value has been received for it. */ static atomic_t signal_valid; @@ -62,11 +61,12 @@ static void espi_handler(const struct device *dev, event.evt_type); break; - case ESPI_BUS_RESET: - /* - * Clear the signal valid mask. - */ - atomic_clear(&signal_valid); + case ESPI_BUS_EVENT_CHANNEL_READY: + /* Virtual wire channel is not ready, clear valid flag */ + if (event.evt_details == ESPI_CHANNEL_VWIRE && + !event.evt_data) { + atomic_clear(&signal_valid); + } break; case ESPI_BUS_EVENT_VWIRE_RECEIVED: @@ -103,7 +103,7 @@ void power_signal_vw_init(void) /* Configure handler for eSPI events */ espi_init_callback(&espi_cb, espi_handler, - ESPI_BUS_RESET | + ESPI_BUS_EVENT_CHANNEL_READY | ESPI_BUS_EVENT_VWIRE_RECEIVED); espi_add_callback(espi_dev, &espi_cb); /* |