summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci-hub.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-20 00:49:41 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-20 00:49:41 (GMT)
commitcea35899a02226b70baeee7e179d7a7c6e814b98 (patch)
tree19621a7ae67df5f398071791d52489a464b1b30a /drivers/usb/host/ohci-hub.c
parent53971a86d2db89f32859dc26bd6594b5bc665d5b (diff)
parentd6d211db37e75de2ddc3a4f979038c40df7cc79c (diff)
downloadlinux-cea35899a02226b70baeee7e179d7a7c6e814b98.tar.xz
Merge 3.15-rc5 into usb-next
We need these USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-hub.c')
-rw-r--r--drivers/usb/host/ohci-hub.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 3d53208..b4940de 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -90,6 +90,24 @@ __acquires(ohci->lock)
dl_done_list (ohci);
finish_unlinks (ohci, ohci_frame_no(ohci));
+ /*
+ * Some controllers don't handle "global" suspend properly if
+ * there are unsuspended ports. For these controllers, put all
+ * the enabled ports into suspend before suspending the root hub.
+ */
+ if (ohci->flags & OHCI_QUIRK_GLOBAL_SUSPEND) {
+ __hc32 __iomem *portstat = ohci->regs->roothub.portstatus;
+ int i;
+ unsigned temp;
+
+ for (i = 0; i < ohci->num_ports; (++i, ++portstat)) {
+ temp = ohci_readl(ohci, portstat);
+ if ((temp & (RH_PS_PES | RH_PS_PSS)) ==
+ RH_PS_PES)
+ ohci_writel(ohci, RH_PS_PSS, portstat);
+ }
+ }
+
/* maybe resume can wake root hub */
if (ohci_to_hcd(ohci)->self.root_hub->do_remote_wakeup || autostop) {
ohci->hc_control |= OHCI_CTRL_RWE;