From: Paul Fertser <fercerpav@gmail.com>
To: Li Yang <leoli@freescale.com>, Felipe Balbi <balbi@ti.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Paul Fertser <fercerpav@gmail.com>
Subject: [PATCH] usb: gadget: fsl: check vbus presence on probe
Date: Thu, 24 Apr 2014 12:54:13 +0400 [thread overview]
Message-ID: <1398329653-29968-1-git-send-email-fercerpav@gmail.com> (raw)
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
next reply other threads:[~2014-04-24 9:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 8:54 Paul Fertser [this message]
2014-04-30 16:06 ` Felipe Balbi
2014-04-30 19:27 ` Paul Fertser
2014-04-30 20:12 ` Felipe Balbi
2014-05-01 14:27 ` suresh.gupta
2014-05-08 14:30 ` suresh.gupta
2014-05-08 15:38 ` Paul Fertser
2014-05-08 18:42 ` suresh.gupta
2014-05-08 20:14 ` Paul Fertser
2014-05-09 9:07 ` suresh.gupta
2014-05-09 11:18 ` Paul Fertser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398329653-29968-1-git-send-email-fercerpav@gmail.com \
--to=fercerpav@gmail.com \
--cc=balbi@ti.com \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome