/* Cache MODE and HIEN register values to avoid having to read it before modifying register bits.  */
static int max3421e_mode_setup(const struct device *dev)
/* Cache MODE and HIEN register values to avoid having to read it before modifying register bits.  */
static int max3421e_mode_setup(const struct device *dev)
{
	const uint8_t mode = MAX3421E_DPPULLDN | MAX3421E_DMPULLDN |
			     MAX3421E_DELAYISO | MAX3421E_HOST;
	struct max3421e_data *priv = uhc_get_private(dev);
	uint8_t tmp;
	int ret;
	ret = max3421e_write_byte(dev, MAX3421E_REG_MODE, mode);
	if (ret) {
		return ret;
	}
	ret = max3421e_read(dev, MAX3421E_REG_MODE, &tmp, sizeof(tmp));
	if (ret) {
		return ret;
	}
	if (tmp != mode) {
		LOG_ERR("Failed to verify MODE register 0x%02x vs 0x%02x",
			mode, tmp);
		return -EIO;
	}
	priv->mode = mode;
	return 0;
}