/* Valid offset of SHI output buffer to write. */
static uint32_t shi_npcx_valid_obuf_offset(struct shi_reg *const inst)
/* Valid offset of SHI output buffer to write. */
static uint32_t shi_npcx_valid_obuf_offset(struct shi_reg *const inst)
{
	if (IS_ENABLED(CONFIG_EC_HOST_CMD_BACKEND_SHI_NPCX_ENHANCED_BUF_MODE)) {
		return shi_npcx_write_buf_pointer(inst) % SHI_OBUF_FULL_SIZE;
	} else {
		return (shi_npcx_read_buf_pointer(inst) + EC_SHI_OUT_PREAMBLE_LENGTH) %
		       SHI_OBUF_FULL_SIZE;
	}
}