lkml.org 
[lkml]   [2014]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: gadget: fsl: check vbus presence on probe
Date
If VBUS is already present during the driver initialisation, the
corresponding IRQ never fires, so there is no way the gadget can get
enumerated.

This patch is real-life tested on an i.MX25 board with VBUS constantly
hooked up.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
drivers/usb/gadget/fsl_udc_core.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index a2f26cd..b4b1516 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2501,6 +2501,11 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
if (ret)
goto err_del_udc;

+ /* Now let it settle a bit and sense VBUS */
+ msleep_interruptible(1);
+ if (fsl_readl(&dr_regs->otgsc) & OTGSC_STS_B_SESSION_VALID)
+ udc_controller->vbus_active = 1;
+
create_proc_file();
return 0;

--
1.7.10


\
 
 \ /
  Last update: 2014-04-24 12:41    [W:0.069 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site