usb: musb: gadget: use platform callback to enable vbus
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 27 Feb 2013 00:29:40 +0000 (02:29 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 12 Mar 2013 21:45:58 +0000 (23:45 +0200)
On some platform configurations (like OMAP3+twl4030) it's the platform
code that enables VBUS, not OTG transceiver, so call vbus platform
callback instead, it then will then call the transceiver.

This fixes a use case where USB cable is plugged first and gadget
driver is loaded later after that.

drivers/usb/musb/musb_gadget.c

index f7e0248..9be7c79 100644 (file)
@@ -1965,9 +1965,8 @@ static int musb_gadget_start(struct usb_gadget *g,
                        goto err2;
                }
 
-               if ((musb->xceiv->last_event == USB_EVENT_ID)
-                                       && musb->xceiv->set_vbus)
-                       otg_set_vbus(musb->xceiv, 1);
+               if (musb->xceiv->last_event == USB_EVENT_ID)
+                       musb_platform_set_vbus(musb, 1);
 
                hcd->self.uses_pio_for_control = 1;
        }