Skip to content

Commit

Permalink
drivers: espi: npcx: update for espi reset level
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
TomChang19 authored and henrikbrixandersen committed Feb 7, 2024
1 parent ccdbe06 commit d558b31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions drivers/espi/espi_npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/espi/host_subs_npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d558b31

Please sign in to comment.