Skip to content

Commit 87a6d5b

Browse files
elmo9999cfriedt
authored andcommitted
driver: espi_rts5912: Set STS0 only when input buffer has data
When using the eSPI peripheral channel for HOST_CMD, the STS0 bit indicates that EC is busy. To reflect this properly, STS0 should only be set when there is actual input data to process. This avoids falsely signaling a busy state when there is no data. Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
1 parent dabe815 commit 87a6d5b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/espi/espi_realtek_rts5912.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,11 @@ static void promt0_ibf_isr(const struct device *dev)
471471
.evt_details = ESPI_PERIPHERAL_EC_HOST_CMD,
472472
.evt_data = ESPI_PERIPHERAL_NODATA};
473473

474-
promt0_reg->STS |= ACPI_STS_STS0;
475-
evt.evt_data = (uint8_t)promt0_reg->IB;
474+
if (promt0_reg->STS & ACPI_STS_IBF) {
475+
promt0_reg->STS |= ACPI_STS_STS0;
476+
evt.evt_data = (uint8_t)promt0_reg->IB;
477+
}
478+
476479
espi_send_callbacks(&data->callbacks, dev, evt);
477480
}
478481

0 commit comments

Comments
 (0)