phy_meson_gxl_usb2_reset(priv);
}
+static int _phy_meson_gxl_usb2_set_mode(struct phy *phy, enum phy_mode mode, int submode)
+{
+ if (submode)
+ return -EOPNOTSUPP;
+
+ switch (mode) {
+ case PHY_MODE_USB_DEVICE:
+ phy_meson_gxl_usb2_set_mode(phy, USB_DR_MODE_PERIPHERAL);
+ break;
+
+ case PHY_MODE_USB_HOST:
+ case PHY_MODE_USB_OTG:
+ phy_meson_gxl_usb2_set_mode(phy, USB_DR_MODE_HOST);
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static int phy_meson_gxl_usb2_power_on(struct phy *phy)
{
struct udevice *dev = phy->dev;
val &= ~U2P_R0_POWER_ON_RESET;
regmap_write(priv->regmap, U2P_R0, val);
- phy_meson_gxl_usb2_set_mode(phy, USB_DR_MODE_HOST);
+ _phy_meson_gxl_usb2_set_mode(phy, PHY_MODE_USB_HOST, 0);
return 0;
}
struct phy_ops meson_gxl_usb2_phy_ops = {
.power_on = phy_meson_gxl_usb2_power_on,
.power_off = phy_meson_gxl_usb2_power_off,
+ .set_mode = _phy_meson_gxl_usb2_set_mode,
};
int meson_gxl_usb2_phy_probe(struct udevice *dev)