drivers/espi: rts5912: handler all port 80 data until fifo is empty

The rts5912's port 80 has a FIFO. In the ISR (Interrupt Service Routine),
extract the FIFO data until the FIFO is empty, otherwise port 80 data will
be lost.

Signed-off-by: jhan bo chao <jhan_bo_chao@realtek.com>
This commit is contained in:
jhan bo chao
2025-08-25 22:04:00 +08:00
committed by Johan Hedberg
parent a7f3c1b5e3
commit c0d973d170

View File

@@ -684,6 +684,8 @@ static void espi_periph_ch_setup(const struct device *dev)
#ifdef CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80
#define P80_MAX_ITEM 16
static void espi_port80_isr(const struct device *dev)
{
const struct espi_rts5912_config *const espi_config = dev->config;
@@ -693,8 +695,13 @@ static void espi_port80_isr(const struct device *dev)
ESPI_PERIPHERAL_NODATA};
volatile struct port80_reg *const port80_reg = espi_config->port80_reg;
evt.evt_data = port80_reg->DATA;
espi_send_callbacks(&espi_data->callbacks, dev, evt);
int i = 0;
while (!(port80_reg->STS & PORT80_STS_FIFOEM) && i < P80_MAX_ITEM) {
evt.evt_data = port80_reg->DATA;
espi_send_callbacks(&espi_data->callbacks, dev, evt);
i++;
}
}
static int espi_peri_ch_port80_setup(const struct device *dev)