drivers: espi: npcx: update for espi reset level

This CL updates the event data returned by espi_reset.
Return 0 for eSPI bus in reset, and 1 for eSPI bus out-of-reset.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
This commit is contained in:
Tom Chang 2024-02-05 15:04:09 +08:00 committed by Henrik Brix Andersen
parent ccdbe0627a
commit d558b31af5
2 changed files with 6 additions and 6 deletions

View file

@ -38,7 +38,7 @@ struct espi_npcx_config {
struct espi_npcx_data {
sys_slist_t callbacks;
uint8_t plt_rst_asserted;
uint8_t espi_rst_asserted;
uint8_t espi_rst_level;
uint8_t sx_state;
#if defined(CONFIG_ESPI_OOB_CHANNEL)
struct k_sem oob_rx_lock;
@ -611,11 +611,11 @@ static void espi_vw_espi_rst_isr(const struct device *dev, struct npcx_wui *wui)
struct espi_npcx_data *const data = dev->data;
struct espi_event evt = { ESPI_BUS_RESET, 0, 0 };
data->espi_rst_asserted = !IS_BIT_SET(inst->ESPISTS,
NPCX_ESPISTS_ESPIRST_LVL);
LOG_DBG("eSPI RST asserted is %d!", data->espi_rst_asserted);
data->espi_rst_level = IS_BIT_SET(inst->ESPISTS,
NPCX_ESPISTS_ESPIRST_LVL);
LOG_DBG("eSPI RST level is %d!", data->espi_rst_level);
evt.evt_data = data->espi_rst_asserted;
evt.evt_data = data->espi_rst_level;
espi_send_callbacks(&data->callbacks, dev, evt);
}

View file

@ -147,7 +147,7 @@ struct host_sub_npcx_config {
struct host_sub_npcx_data {
sys_slist_t *callbacks; /* pointer on the espi callback list */
uint8_t plt_rst_asserted; /* current PLT_RST# status */
uint8_t espi_rst_asserted; /* current ESPI_RST# status */
uint8_t espi_rst_level; /* current ESPI_RST# status */
const struct device *host_bus_dev; /* device for eSPI/LPC bus */
#ifdef CONFIG_ESPI_NPCX_PERIPHERAL_DEBUG_PORT_80_MULTI_BYTE
struct ring_buf port80_ring_buf;