Some meson targets are using a fixed regulator about usb.
It's always returning to EALREADY, so driver doesn't init fine.
To prevent this problem, use the regulator_set_enable_if_allowed
instead of regulator_set_enable.
Fixes: 4fcba5d556b ("regulator: implement basic reference counter")
Change-Id: I39dea7b3a36dc2ba5c9c2d3487142e7e2fbe0f16
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
- int ret = regulator_set_enable(priv->vbus_supply,
+ int ret = regulator_set_enable_if_allowed(priv->vbus_supply,
(mode == USB_DR_MODE_PERIPHERAL));
if (ret)
return ret;
}
if (priv->vbus_supply) {
- ret = regulator_set_enable(priv->vbus_supply, true);
+ ret = regulator_set_enable_if_allowed(priv->vbus_supply, true);
if (ret)
return ret;
}