it8xxx2: espi/kbc: read kbc event type before read input buffer
Host might send command or data immediately after EC read the KBC input buffer (IBF gets cleared). This change make sure EC won't get wrong event type in IBF ISR. Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
This commit is contained in:
parent
177bdff61b
commit
3f6be01484
1 changed files with 2 additions and 2 deletions
|
@ -378,14 +378,14 @@ static void kbc_it8xxx2_ibf_isr(const struct device *dev)
|
|||
|
||||
/* KBC Input Buffer Full event */
|
||||
kbc_evt->evt = HOST_KBC_EVT_IBF;
|
||||
/* The data in KBC Input Buffer */
|
||||
kbc_evt->data = kbc_reg->KBHIDIR;
|
||||
/*
|
||||
* Indicates if the host sent a command or data.
|
||||
* 0 = data
|
||||
* 1 = Command.
|
||||
*/
|
||||
kbc_evt->type = !!(kbc_reg->KBHISR & KBC_KBHISR_A2_ADDR);
|
||||
/* The data in KBC Input Buffer */
|
||||
kbc_evt->data = kbc_reg->KBHIDIR;
|
||||
|
||||
espi_send_callbacks(&data->callbacks, dev, evt);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue