diff options
author | Suresh Gupta <suresh.gupta@freescale.com> | 2014-03-21 11:08:12 (GMT) |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-04-17 15:25:07 (GMT) |
commit | 252455c40316009cc791f00338ee2e367d2d2739 (patch) | |
tree | 3798317e5ce218a1f53c4d55e1594c533856e633 /drivers/usb | |
parent | 97839ca4b06ab27790700ad7da6be9a75fc0cc1d (diff) | |
download | linux-252455c40316009cc791f00338ee2e367d2d2739.tar.xz |
usb: gadget: fsl driver pullup fix
This fix the fsl usb gadget driver in a way that the usb device
will be only "pulled up" on requests only when vbus is powered
Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index dcd0b07..a2f26cd 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -1219,6 +1219,10 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on) struct fsl_udc *udc; udc = container_of(gadget, struct fsl_udc, gadget); + + if (!udc->vbus_active) + return -EOPNOTSUPP; + udc->softconnect = (is_on != 0); if (can_pullup(udc)) fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP), |