aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-11-07 18:24:46 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:48:30 -0500
commit2c1c3c4cd5f796b1912c65aaf3bf48c0ddf11f5e (patch)
treed0adc25607629f4fbb9f45cc498f5c155d520291 /drivers/usb/host
parent8d7802ed3c617120863f84346638d1cf1c96137b (diff)
[PATCH] USB: EHCI updates (4/4) driver model wakeup flags
This teaches the EHCI driver to use the new driver model wakeup flags, replacing the similar ones in the HCD glue. It also adds a workaround for the current glitch whereby PCI init doesn't init the wakeup flags from the PCI PM capabilities. (EHCI controllers don't worry about legacy mode; the PCI PM capability would always do the job.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-hub.c4
-rw-r--r--drivers/usb/host/ehci-pci.c11
3 files changed, 13 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 29f52a44b928..dd871023265c 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -624,7 +624,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
624 } 624 }
625 625
626 /* remote wakeup [4.3.1] */ 626 /* remote wakeup [4.3.1] */
627 if ((status & STS_PCD) && hcd->remote_wakeup) { 627 if ((status & STS_PCD) && device_may_wakeup(&hcd->self.root_hub->dev)) {
628 unsigned i = HCS_N_PORTS (ehci->hcs_params); 628 unsigned i = HCS_N_PORTS (ehci->hcs_params);
629 629
630 /* resume root hub? */ 630 /* resume root hub? */
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 82caf336e9b6..69b0b9be7a64 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -59,7 +59,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
59 59
60 if ((t1 & PORT_PE) && !(t1 & PORT_OWNER)) 60 if ((t1 & PORT_PE) && !(t1 & PORT_OWNER))
61 t2 |= PORT_SUSPEND; 61 t2 |= PORT_SUSPEND;
62 if (hcd->remote_wakeup) 62 if (device_may_wakeup(&hcd->self.root_hub->dev))
63 t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E; 63 t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E;
64 else 64 else
65 t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E); 65 t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);
@@ -517,7 +517,7 @@ static int ehci_hub_control (
517 if ((temp & PORT_PE) == 0 517 if ((temp & PORT_PE) == 0
518 || (temp & PORT_RESET) != 0) 518 || (temp & PORT_RESET) != 0)
519 goto error; 519 goto error;
520 if (hcd->remote_wakeup) 520 if (device_may_wakeup(&hcd->self.root_hub->dev))
521 temp |= PORT_WAKE_BITS; 521 temp |= PORT_WAKE_BITS;
522 writel (temp | PORT_SUSPEND, 522 writel (temp | PORT_SUSPEND,
523 &ehci->regs->port_status [wIndex]); 523 &ehci->regs->port_status [wIndex]);
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 13f73a836e45..ac088bc72f1c 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -210,7 +210,16 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
210 /* Serial Bus Release Number is at PCI 0x60 offset */ 210 /* Serial Bus Release Number is at PCI 0x60 offset */
211 pci_read_config_byte(pdev, 0x60, &ehci->sbrn); 211 pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
212 212
213 /* REVISIT: per-port wake capability (PCI 0x62) currently unused */ 213 /* Workaround current PCI init glitch: wakeup bits aren't
214 * being set from PCI PM capability.
215 */
216 if (!device_can_wakeup(&pdev->dev)) {
217 u16 port_wake;
218
219 pci_read_config_word(pdev, 0x62, &port_wake);
220 if (port_wake & 0x0001)
221 device_init_wakeup(&pdev->dev, 1);
222 }
214 223
215 retval = ehci_pci_reinit(ehci, pdev); 224 retval = ehci_pci_reinit(ehci, pdev);
216done: 225done: