lkml.org 
[lkml]   [2014]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] USB: Gadget: fsl driver pullup fix
Date
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>
---
Changes from previous version:
* Removed re-factored code, Will send another patch for re-factoring
duplicated code
* Changed Description

drivers/usb/gadget/fsl_udc_core.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 35cb972..49d66779 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),
--
1.8.4.1



\
 
 \ /
  Last update: 2014-03-20 17:22    [W:0.047 / U:3.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site