From d558b31af5a106d594a959bbc5222b32d45e25b9 Mon Sep 17 00:00:00 2001 From: Tom Chang Date: Mon, 5 Feb 2024 15:04:09 +0800 Subject: [PATCH] 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 --- drivers/espi/espi_npcx.c | 10 +++++----- drivers/espi/host_subs_npcx.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/espi/espi_npcx.c b/drivers/espi/espi_npcx.c index 6a8a83a13c33..fc6712575c3f 100644 --- a/drivers/espi/espi_npcx.c +++ b/drivers/espi/espi_npcx.c @@ -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); } diff --git a/drivers/espi/host_subs_npcx.c b/drivers/espi/host_subs_npcx.c index b9187f4ecd62..41810666604a 100644 --- a/drivers/espi/host_subs_npcx.c +++ b/drivers/espi/host_subs_npcx.c @@ -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;