@@ -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:
---
Hunk 2 makes the USB core call phy_set_mode with PHY_MODE_USB_HOST
instead of PHY_MODE_USB_HOST_SS. Not sure why PHY_MODE_USB_HOST_SS was
used here, but I believe only a small set of hardware actually support
SuperSpeed, so it might be better to use the more encompasing
PHY_MODE_USB_HOST. That or the core code would have to check which speed
class the port is for and pass in the appropriate mode. The Allwinner
PHYs do not support SuperSpeed.
@@ -2740,7 +2740,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
return retval;
retval = usb_phy_roothub_set_mode(hcd->phy_roothub,
- PHY_MODE_USB_HOST_SS);
+ PHY_MODE_USB_HOST);
if (retval)
goto err_usb_phy_roothub_power_on;