/* Write the interrupt select field of the specified MSVW source. Each MSVW controls 4 virtual wires.  */
static int xec_espi_vw_intr_ctrl(const struct device *dev, uint8_t msvw_idx, uint8_t src_id, uint8_t intr_mode)
/* Write the interrupt select field of the specified MSVW source. Each MSVW controls 4 virtual wires.  */
static int xec_espi_vw_intr_ctrl(const struct device *dev, uint8_t msvw_idx, uint8_t src_id, uint8_t intr_mode)
{
	struct espi_msvw_ar_regs *regs = ESPI_XEC_MSVW_REG_BASE(dev);
	if ((msvw_idx >= ESPI_NUM_MSVW) || (src_id > 3)) {
		return -EINVAL;
	}
	uintptr_t msvw_addr = (uintptr_t)&regs->MSVW[msvw_idx];
	sys_write8(intr_mode, msvw_addr + MSVW_BI_IRQ_SEL0 + src_id);
	return 0;
}