diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-06-25 14:02:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 14:35:37 -0700 |
commit | 4147200d25c423e627ab4487530b3d9f2ef829c8 (patch) | |
tree | 7261fbfd97782482d18333f1b0e9de0e2e4bf968 /drivers/usb | |
parent | 057c58bfb1dc9bbb75b8ba3b6c6336cfca63b9d0 (diff) | |
download | op-kernel-dev-4147200d25c423e627ab4487530b3d9f2ef829c8.zip op-kernel-dev-4147200d25c423e627ab4487530b3d9f2ef829c8.tar.gz |
USB: add do_wakeup parameter for PCI HCD suspend
This patch (as1385) adds a "do_wakeup" parameter to the pci_suspend
method used by PCI-based host controller drivers. ehci-hcd in
particular needs to know whether or not to enable wakeup when
suspending a controller. Although that information is currently
available through device_may_wakeup(), when support is added for
runtime suspend this will no longer be true.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-au1xxx.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 2 |
8 files changed, 16 insertions, 14 deletions
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index f0156de..e387e39 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -386,7 +386,9 @@ static int hcd_pci_suspend(struct device *dev) return retval; if (hcd->driver->pci_suspend) { - retval = hcd->driver->pci_suspend(hcd); + bool do_wakeup = device_may_wakeup(dev); + + retval = hcd->driver->pci_suspend(hcd, do_wakeup); suspend_report_result(hcd->driver->pci_suspend, retval); if (retval) return retval; diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c index faa6174..2baf8a8 100644 --- a/drivers/usb/host/ehci-au1xxx.c +++ b/drivers/usb/host/ehci-au1xxx.c @@ -228,7 +228,7 @@ static int ehci_hcd_au1xxx_drv_suspend(struct device *dev) * the root hub is either suspended or stopped. */ spin_lock_irqsave(&ehci->lock, flags); - ehci_prepare_ports_for_controller_suspend(ehci); + ehci_prepare_ports_for_controller_suspend(ehci, device_may_wakeup(dev)); ehci_writel(ehci, 0, &ehci->regs->intr_enable); (void)ehci_readl(ehci, &ehci->regs->intr_enable); diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 5cd967d..a416421 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -313,7 +313,8 @@ static int ehci_fsl_drv_suspend(struct device *dev) struct ehci_fsl *ehci_fsl = hcd_to_ehci_fsl(hcd); void __iomem *non_ehci = hcd->regs; - ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd)); + ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd), + device_may_wakeup(dev)); if (!fsl_deep_sleep()) return 0; diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 0931f5a..1292a5b 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -107,7 +107,7 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci) } static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, - bool suspending) + bool suspending, bool do_wakeup) { int port; u32 temp; @@ -117,8 +117,7 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, * when the controller is suspended or resumed. In all other * cases they don't need to be changed. */ - if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup || - device_may_wakeup(ehci_to_hcd(ehci)->self.controller)) + if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup || do_wakeup) return; /* clear phy low-power mode before changing wakeup flags */ diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index a307d55..f555e4f 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -277,7 +277,7 @@ done: * Also they depend on separate root hub suspend/resume. */ -static int ehci_pci_suspend(struct usb_hcd *hcd) +static int ehci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct ehci_hcd *ehci = hcd_to_ehci(hcd); unsigned long flags; @@ -291,7 +291,7 @@ static int ehci_pci_suspend(struct usb_hcd *hcd) * the root hub is either suspended or stopped. */ spin_lock_irqsave (&ehci->lock, flags); - ehci_prepare_ports_for_controller_suspend(ehci); + ehci_prepare_ports_for_controller_suspend(ehci, do_wakeup); ehci_writel(ehci, 0, &ehci->regs->intr_enable); (void)ehci_readl(ehci, &ehci->regs->intr_enable); diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index e6c57cc..a4a63ce 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -540,11 +540,11 @@ struct ehci_fstn { /* Prepare the PORTSC wakeup flags during controller suspend/resume */ -#define ehci_prepare_ports_for_controller_suspend(ehci) \ - ehci_adjust_port_wakeup_flags(ehci, true); +#define ehci_prepare_ports_for_controller_suspend(ehci, do_wakeup) \ + ehci_adjust_port_wakeup_flags(ehci, true, do_wakeup); -#define ehci_prepare_ports_for_controller_resume(ehci) \ - ehci_adjust_port_wakeup_flags(ehci, false); +#define ehci_prepare_ports_for_controller_resume(ehci) \ + ehci_adjust_port_wakeup_flags(ehci, false, false); /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index b8a1148..6bdc8b2 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c @@ -392,7 +392,7 @@ static int __devinit ohci_pci_start (struct usb_hcd *hcd) #ifdef CONFIG_PM -static int ohci_pci_suspend(struct usb_hcd *hcd) +static int ohci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); unsigned long flags; diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 2743ec7..a7850f5 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c @@ -788,7 +788,7 @@ static int uhci_rh_resume(struct usb_hcd *hcd) return rc; } -static int uhci_pci_suspend(struct usb_hcd *hcd) +static int uhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct uhci_hcd *uhci = hcd_to_uhci(hcd); int rc = 0; |