Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325986
b: refs/heads/master
c: 12a19b5
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Felipe Balbi committed Aug 14, 2012
1 parent 8bc6bb1 commit 75c5a3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07a67bbb95ea7977846bd851dab5f4f2be8e488c
refs/heads/master: 12a19b5f836c1a1b838e668f9aa804d017d8c58b
6 changes: 5 additions & 1 deletion trunk/drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/dma-mapping.h>
#include <linux/pm_runtime.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/usb/musb-omap.h>

#include "musb_core.h"
Expand Down Expand Up @@ -150,6 +151,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)

if (is_on) {
if (musb->xceiv->state == OTG_STATE_A_IDLE) {
int loops = 100;
/* start the session */
devctl |= MUSB_DEVCTL_SESSION;
musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
Expand All @@ -159,9 +161,11 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
*/
while (musb_readb(musb->mregs, MUSB_DEVCTL) & 0x80) {

mdelay(5);
cpu_relax();

if (time_after(jiffies, timeout)) {
if (time_after(jiffies, timeout)
|| loops-- <= 0) {
dev_err(musb->controller,
"configured as A device timeout");
ret = -EINVAL;
Expand Down

0 comments on commit 75c5a3d

Please sign in to comment.