diff options
author | Chen-Yu Tsai <wens@csie.org> | 2019-03-22 04:51:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-26 03:48:55 -0400 |
commit | e671765e521c571afec3157a7e17502d54f6a43e (patch) | |
tree | b1753d9c85874ff4d2f287e2ff42310bed590cd2 | |
parent | 1396929e8a903db80425343cacca766a18ad6409 (diff) |
usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails
Some PHYs do not support PHY_MODE_USB_HOST_SS, i.e. USB 3.0 or higher.
Fall back and try the more generic PHY_MODE_USB_HOST if it fails.
Fixes: b97a31348379 ("usb: core: comply to PHY framework")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/core/hcd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 3189181bb628..975d7c1288e3 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -2742,6 +2742,9 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
2742 | retval = usb_phy_roothub_set_mode(hcd->phy_roothub, | 2742 | retval = usb_phy_roothub_set_mode(hcd->phy_roothub, |
2743 | PHY_MODE_USB_HOST_SS); | 2743 | PHY_MODE_USB_HOST_SS); |
2744 | if (retval) | 2744 | if (retval) |
2745 | retval = usb_phy_roothub_set_mode(hcd->phy_roothub, | ||
2746 | PHY_MODE_USB_HOST); | ||
2747 | if (retval) | ||
2745 | goto err_usb_phy_roothub_power_on; | 2748 | goto err_usb_phy_roothub_power_on; |
2746 | 2749 | ||
2747 | retval = usb_phy_roothub_power_on(hcd->phy_roothub); | 2750 | retval = usb_phy_roothub_power_on(hcd->phy_roothub); |