]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Revert "usb: musb: da8xx: Set phy in OTG mode by default"
authorBastien Curutchet <bastien.curutchet@bootlin.com>
Tue, 28 May 2024 10:20:24 +0000 (12:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 13:44:11 +0000 (15:44 +0200)
This reverts commit 7ccf62941a38701ec9a42b4a0fa2868af456e96a.

da8xx_musb_set_mode() forces OTG mode regardless the selected mode even
if the property 'dr_mode = "host"' is present in device-tree. This
causes an unrecoverable error when VBUS supply is shut down : plugged
gadgets are no longer detected once VBUS supply is back.

Reverting it allows to have a selected mode coherent with device-tree's
description. IMO, this shouldn't cause regression because OTG mode is
the default selection when 'dr_mode' property is not set.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20240528102026.40136-3-bastien.curutchet@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/da8xx.c

index 8abf3a567e30a82f0f5ed851c794907ea47b631e..1681f9fba3dafe1a00ac6617c0ec42bcb5b7c89e 100644 (file)
@@ -328,13 +328,6 @@ static int da8xx_musb_set_mode(struct musb *musb, u8 musb_mode)
        struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent);
        enum phy_mode phy_mode;
 
-       /*
-        * The PHY has some issues when it is forced in device or host mode.
-        * Unless the user request another mode, configure the PHY in OTG mode.
-        */
-       if (!musb->is_initialized)
-               return phy_set_mode(glue->phy, PHY_MODE_USB_OTG);
-
        switch (musb_mode) {
        case MUSB_HOST:         /* Force VBUS valid, ID = 0 */
                phy_mode = PHY_MODE_USB_HOST;