@@ -352,6 +352,26 @@ static void espi_vw_config_input(const struct device *dev,
352352 LOG_DBG ("VWEVMS%d 0x%08X" , idx , inst -> VWEVMS [idx ]);
353353}
354354
355+ #if defined(CONFIG_ESPI_VWIRE_INDEX_33H )
356+ /* eSPI local virtual-wire 33h service functions */
357+ static void espi_vw_config_33h_input (const struct device * dev )
358+ {
359+ struct espi_reg * const inst = HAL_INSTANCE (dev );
360+ const int idx = 8 ;
361+
362+ SET_FIELD (inst -> VWEVMS [idx ], NPCX_VWEVMS_INDEX , 0x33 );
363+
364+ /* IE & WE bits are already set? */
365+ if (IS_BIT_SET (inst -> VWEVMS [idx ], NPCX_VWEVMS_IE ) &&
366+ IS_BIT_SET (inst -> VWEVMS [idx ], NPCX_VWEVMS_WE ))
367+ return ;
368+
369+ /* Set IE & WE bits in VWEVMS */
370+ inst -> VWEVMS [idx ] |= BIT (NPCX_VWEVMS_IE ) | BIT (NPCX_VWEVMS_WE ) | BIT (NPCX_VWEVMS_INDEX_EN );
371+ LOG_DBG ("33h VWEVMS%d 0x%08X" , idx , inst -> VWEVMS [idx ]);
372+ }
373+ #endif
374+
355375static void espi_vw_config_output (const struct device * dev ,
356376 const struct npcx_vw_out_config * config_out )
357377{
@@ -1239,7 +1259,10 @@ static int espi_npcx_init(const struct device *dev)
12391259 /* Configure Virtual Wire input signals */
12401260 for (i = 0 ; i < ARRAY_SIZE (vw_in_tbl ); i ++ )
12411261 espi_vw_config_input (dev , & vw_in_tbl [i ]);
1242-
1262+ #if defined(CONFIG_ESPI_VWIRE_INDEX_33H )
1263+ /* Configure Virtual Wire index 33h */
1264+ espi_vw_config_33h_input (dev );
1265+ #endif
12431266 /* Configure Virtual Wire output signals */
12441267 for (i = 0 ; i < ARRAY_SIZE (vw_out_tbl ); i ++ )
12451268 espi_vw_config_output (dev , & vw_out_tbl [i ]);
0 commit comments