@@ -544,6 +544,18 @@ static int sun4i_usb_phy_set_mode(struct phy *_phy,
return -EINVAL;
}
+ if (data->cfg->phy0_dual_route) {
+ /*
+ For SoCs with dual route the PHY mode is fully determined by
+ the selected mux route (i.e. USB controller to use).
+ As both host (EHCI/OHCI) and peripheral (MUSB) controllers uses
+ the same PHY, both drivers can try to set PHY mode.
+ We need to ignore this requests, but not report error in case
+ of valid mode values.
+ */
+ return 0;
+ }
+
if (new_mode != data->dr_mode) {
dev_info(&_phy->dev, "Changing dr_mode to %d\n", new_mode);
data->dr_mode = new_mode;
PHY0 mode is fully determined by the selected mux route. Ignore changes requests from controllers. Signed-off-by: Philippe Simons <simons.philippe@gmail.com> --- drivers/phy/allwinner/phy-sun4i-usb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)