]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
usb: gadget: tegra: handle y cable properly
authorRakesh Bodla <rbodla@nvidia.com>
Thu, 3 Apr 2014 09:15:14 +0000 (14:45 +0530)
committerMrutyunjay Sawant <msawant@nvidia.com>
Thu, 10 Apr 2014 13:53:09 +0000 (06:53 -0700)
For Y cable vbus will be present so gadget
driver thinks it as normal cable. Adding
condition to distinguish between Y and
device cable. Here, if transceiver is present,
turning ON phy will be decided by OTG driver.

Bug 1490687

Change-Id: Ic1d7667fb28d5a9211f88af585f40316dc126148
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/391783
(cherry picked from commit 47d0105d9eb9ec99006974fbc24942a208050ae7)
Reviewed-on: http://git-master/r/393430
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/usb/gadget/tegra_udc.c

index 14ae891873ac6daa5ffa1f8a3d3e9e68059d1563..693ed4d53fea5987878a6958ab191ccebb7e4adb 100644 (file)
@@ -2627,7 +2627,8 @@ static int tegra_udc_start(struct usb_gadget *g,
        spin_unlock_irqrestore(&udc->lock, flags);
 
        /* Enable DR IRQ reg and Set usbcmd reg  Run bit */
-       if (vbus_enabled(udc))
+       if (vbus_enabled(udc) && !(udc->transceiver
+                       && udc->transceiver->state != OTG_STATE_B_PERIPHERAL))
                tegra_vbus_session(&udc->gadget, 1);
 
        printk(KERN_INFO "%s: bind to driver %s\n",