aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hub.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-08-11 03:36:51 -0400
committerJiri Kosina <jkosina@suse.cz>2010-08-11 03:36:51 -0400
commit6396fc3b3ff3f6b942992b653a62df11dcef9bea (patch)
treedb3c7cbe833b43c653adc99f70941431c5ff7c4e /drivers/usb/host/ohci-hub.c
parent4785879e4d340e24e54f6de2ccfc42728b912808 (diff)
parent3d30701b58970425e1d45994d6cb82f828924fdd (diff)
Merge branch 'master' into for-next
Conflicts: fs/exofs/inode.c
Diffstat (limited to 'drivers/usb/host/ohci-hub.c')
-rw-r--r--drivers/usb/host/ohci-hub.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 65cac8cc8921..cddcda95b579 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -284,7 +284,7 @@ static int ohci_bus_suspend (struct usb_hcd *hcd)
284 284
285 spin_lock_irq (&ohci->lock); 285 spin_lock_irq (&ohci->lock);
286 286
287 if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) 287 if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
288 rc = -ESHUTDOWN; 288 rc = -ESHUTDOWN;
289 else 289 else
290 rc = ohci_rh_suspend (ohci, 0); 290 rc = ohci_rh_suspend (ohci, 0);
@@ -302,7 +302,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
302 302
303 spin_lock_irq (&ohci->lock); 303 spin_lock_irq (&ohci->lock);
304 304
305 if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) 305 if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
306 rc = -ESHUTDOWN; 306 rc = -ESHUTDOWN;
307 else 307 else
308 rc = ohci_rh_resume (ohci); 308 rc = ohci_rh_resume (ohci);
@@ -355,6 +355,11 @@ static void ohci_finish_controller_resume(struct usb_hcd *hcd)
355 ohci_readl(ohci, &ohci->regs->intrenable); 355 ohci_readl(ohci, &ohci->regs->intrenable);
356 msleep(20); 356 msleep(20);
357 } 357 }
358
359 /* Does the root hub have a port wakeup pending? */
360 if (ohci_readl(ohci, &ohci->regs->intrstatus) &
361 (OHCI_INTR_RD | OHCI_INTR_RHSC))
362 usb_hcd_resume_root_hub(hcd);
358} 363}
359 364
360/* Carry out polling-, autostop-, and autoresume-related state changes */ 365/* Carry out polling-, autostop-, and autoresume-related state changes */
@@ -364,7 +369,7 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed,
364 int poll_rh = 1; 369 int poll_rh = 1;
365 int rhsc_enable; 370 int rhsc_enable;
366 371
367 /* Some broken controllers never turn off RHCS in the interrupt 372 /* Some broken controllers never turn off RHSC in the interrupt
368 * status register. For their sake we won't re-enable RHSC 373 * status register. For their sake we won't re-enable RHSC
369 * interrupts if the interrupt bit is already active. 374 * interrupts if the interrupt bit is already active.
370 */ 375 */
@@ -489,7 +494,7 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
489 unsigned long flags; 494 unsigned long flags;
490 495
491 spin_lock_irqsave (&ohci->lock, flags); 496 spin_lock_irqsave (&ohci->lock, flags);
492 if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) 497 if (!HCD_HW_ACCESSIBLE(hcd))
493 goto done; 498 goto done;
494 499
495 /* undocumented erratum seen on at least rev D */ 500 /* undocumented erratum seen on at least rev D */
@@ -533,8 +538,12 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
533 } 538 }
534 } 539 }
535 540
536 hcd->poll_rh = ohci_root_hub_state_changes(ohci, changed, 541 if (ohci_root_hub_state_changes(ohci, changed,
537 any_connected, rhsc_status); 542 any_connected, rhsc_status))
543 set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
544 else
545 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
546
538 547
539done: 548done:
540 spin_unlock_irqrestore (&ohci->lock, flags); 549 spin_unlock_irqrestore (&ohci->lock, flags);
@@ -701,7 +710,7 @@ static int ohci_hub_control (
701 u32 temp; 710 u32 temp;
702 int retval = 0; 711 int retval = 0;
703 712
704 if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) 713 if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
705 return -ESHUTDOWN; 714 return -ESHUTDOWN;
706 715
707 switch (typeReq) { 716 switch (typeReq) {