aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r--drivers/usb/host/ehci-hub.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 21ac3781f21a..536b433d24f7 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -30,6 +30,8 @@
30 30
31#ifdef CONFIG_PM 31#ifdef CONFIG_PM
32 32
33#define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
34
33static int ehci_hub_control( 35static int ehci_hub_control(
34 struct usb_hcd *hcd, 36 struct usb_hcd *hcd,
35 u16 typeReq, 37 u16 typeReq,
@@ -149,10 +151,10 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
149 } 151 }
150 152
151 /* enable remote wakeup on all ports */ 153 /* enable remote wakeup on all ports */
152 if (device_may_wakeup(&hcd->self.root_hub->dev)) 154 if (hcd->self.root_hub->do_remote_wakeup)
153 t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E; 155 t2 |= PORT_WAKE_BITS;
154 else 156 else
155 t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E); 157 t2 &= ~PORT_WAKE_BITS;
156 158
157 if (t1 != t2) { 159 if (t1 != t2) {
158 ehci_vdbg (ehci, "port %d, %08x -> %08x\n", 160 ehci_vdbg (ehci, "port %d, %08x -> %08x\n",
@@ -174,7 +176,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
174 176
175 /* allow remote wakeup */ 177 /* allow remote wakeup */
176 mask = INTR_MASK; 178 mask = INTR_MASK;
177 if (!device_may_wakeup(&hcd->self.root_hub->dev)) 179 if (!hcd->self.root_hub->do_remote_wakeup)
178 mask &= ~STS_PCD; 180 mask &= ~STS_PCD;
179 ehci_writel(ehci, mask, &ehci->regs->intr_enable); 181 ehci_writel(ehci, mask, &ehci->regs->intr_enable);
180 ehci_readl(ehci, &ehci->regs->intr_enable); 182 ehci_readl(ehci, &ehci->regs->intr_enable);
@@ -232,8 +234,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
232 i = HCS_N_PORTS (ehci->hcs_params); 234 i = HCS_N_PORTS (ehci->hcs_params);
233 while (i--) { 235 while (i--) {
234 temp = ehci_readl(ehci, &ehci->regs->port_status [i]); 236 temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
235 temp &= ~(PORT_RWC_BITS 237 temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
236 | PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E);
237 if (test_bit(i, &ehci->bus_suspended) && 238 if (test_bit(i, &ehci->bus_suspended) &&
238 (temp & PORT_SUSPEND)) { 239 (temp & PORT_SUSPEND)) {
239 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20); 240 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
@@ -534,8 +535,6 @@ ehci_hub_descriptor (
534 535
535/*-------------------------------------------------------------------------*/ 536/*-------------------------------------------------------------------------*/
536 537
537#define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
538
539static int ehci_hub_control ( 538static int ehci_hub_control (
540 struct usb_hcd *hcd, 539 struct usb_hcd *hcd,
541 u16 typeReq, 540 u16 typeReq,
@@ -801,8 +800,6 @@ static int ehci_hub_control (
801 if ((temp & PORT_PE) == 0 800 if ((temp & PORT_PE) == 0
802 || (temp & PORT_RESET) != 0) 801 || (temp & PORT_RESET) != 0)
803 goto error; 802 goto error;
804 if (device_may_wakeup(&hcd->self.root_hub->dev))
805 temp |= PORT_WAKE_BITS;
806 ehci_writel(ehci, temp | PORT_SUSPEND, status_reg); 803 ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
807 break; 804 break;
808 case USB_PORT_FEAT_POWER: 805 case USB_PORT_FEAT_POWER: