mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs
While only the first PHY supports mode switching, the remaining PHYs work in USB host mode. They should support set_mode with mode=USB_HOST instead of failing. This is especially needed now that the USB core does set_mode for all USB ports, which was added in commitb97a313483("usb: core: comply to PHY framework"). Make set_mode with mode=USB_HOST a no-op instead of failing for the non-OTG USB PHYs. Fixes:6ba43c2919("phy-sun4i-usb: Add support for phy_set_mode") Signed-off-by: Chen-Yu Tsai <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
d92f2c59cc
commit
1396929e8a
1 changed files with 4 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue