Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155376
b: refs/heads/master
c: 89368d3
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jul 12, 2009
1 parent 155ef7a commit d6f8059
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 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: 6d84599b3c3a7bccc04ec4133220d150b92fe0f8
refs/heads/master: 89368d3d11a5b2eff83ad8e752be67f77a372bad
5 changes: 3 additions & 2 deletions trunk/drivers/usb/musb/davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
WARNING("VBUS error workaround (delay coming)\n");
} else if (is_host_enabled(musb) && drvvbus) {
musb->is_active = 1;
MUSB_HST_MODE(musb);
musb->xceiv->default_a = 1;
musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
Expand All @@ -344,7 +343,9 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
}

/* NOTE: this must complete poweron within 100 msec */
/* NOTE: this must complete poweron within 100 msec
* (OTG_TIME_A_WAIT_VRISE) but we don't check for that.
*/
davinci_source_power(musb, drvvbus, 0);
DBG(2, "VBUS %s (%s)%s, devctl %02x\n",
drvvbus ? "on" : "off",
Expand Down
25 changes: 21 additions & 4 deletions trunk/drivers/usb/musb/musb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,13 +2235,30 @@ static void musb_h_stop(struct usb_hcd *hcd)
static int musb_bus_suspend(struct usb_hcd *hcd)
{
struct musb *musb = hcd_to_musb(hcd);
u8 devctl;

if (musb->xceiv->state == OTG_STATE_A_SUSPEND)
if (!is_host_active(musb))
return 0;

if (is_host_active(musb) && musb->is_active) {
WARNING("trying to suspend as %s is_active=%i\n",
otg_state_string(musb), musb->is_active);
switch (musb->xceiv->state) {
case OTG_STATE_A_SUSPEND:
return 0;
case OTG_STATE_A_WAIT_VRISE:
/* ID could be grounded even if there's no device
* on the other end of the cable. NOTE that the
* A_WAIT_VRISE timers are messy with MUSB...
*/
devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
break;
default:
break;
}

if (musb->is_active) {
WARNING("trying to suspend as %s while active\n",
otg_state_string(musb));
return -EBUSY;
} else
return 0;
Expand Down

0 comments on commit d6f8059

Please sign in to comment.