Skip to content

Commit

Permalink
drivers: espi: ite: Receive vwire level without checking the valid bit
Browse files Browse the repository at this point in the history
Valid bit on ‘0’, the corresponding virtual wire will retain its
previous value and it not be updated for this virtual wire packet.

Virtual wire value will be reset as default by eSPI reset.

Signed-off-by: JiaJun Yim <[email protected]>
  • Loading branch information
yimjiajun committed Aug 8, 2024
1 parent c44abdf commit 421686b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/espi/espi_it8xxx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,18 +723,12 @@ static int espi_it8xxx2_receive_vwire(const struct device *dev,
(struct espi_vw_regs *)config->base_espi_vw;
uint8_t vw_index = vw_channel_list[signal].vw_index;
uint8_t level_mask = vw_channel_list[signal].level_mask;
uint8_t valid_mask = vw_channel_list[signal].valid_mask;

if (signal > ARRAY_SIZE(vw_channel_list)) {
return -EIO;
}

if (vw_reg->VW_INDEX[vw_index] & valid_mask) {
*level = !!(vw_reg->VW_INDEX[vw_index] & level_mask);
} else {
/* Not valid */
*level = 0;
}
*level = !!(vw_reg->VW_INDEX[vw_index] & level_mask);

return 0;
}
Expand Down

0 comments on commit 421686b

Please sign in to comment.