phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs
[platform/kernel/linux-rpi.git] / drivers / phy / allwinner / phy-sun4i-usb.c
index 5163097..4bbd9ed 100644 (file)
@@ -485,8 +485,11 @@ static int sun4i_usb_phy_set_mode(struct phy *_phy,
        struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy);
        int new_mode;
 
-       if (phy->index != 0)
+       if (phy->index != 0) {
+               if (mode == PHY_MODE_USB_HOST)
+                       return 0;
                return -EINVAL;
+       }
 
        switch (mode) {
        case PHY_MODE_USB_HOST: