aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-pci.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-09-23 01:42:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 19:47:40 -0400
commitf197b2c54b9d9a133a9a8ff92f35cadf8945ea14 (patch)
treea5a4da41e38d8681977a9f3b52fa2e5f1db278ea /drivers/usb/host/ohci-pci.c
parent5f827ea3c3820cd8e0a1a35e4d275c8b78ee94e1 (diff)
[PATCH] OHCI PM updates
This simplifies the OHCI root hub suspend logic: - Uses new usbcore root hub calls to make autosuspend work again: * Uses a newish usbcore root hub wakeup mechanism, making requests to khubd not keventd. * Uses an even newer sibling suspend hook. - Expect someone always made usbcore call ohci_hub_suspend() before bus glue fires; and that ohci_hub_resume() is only called after that bus glue ran. Previously, only CONFIG_USB_SUSPEND promised those things. (Includes updates to PCI and OMAP bus glue.) - Handle a not-noticed-before special case during resume from one of the swsusp snapshots when using "usb-handoff": the controller isn't left in RESET state. (A bug to fix in the usb-handoff code...) Also cleans up a minor debug printk glitch, and switches an mdelay over to an msleep (how did that stick around for so long?). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/usb/host/ohci-dbg.c | 4 ---- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-hub.c | 42 ++++++++++++------------------------------ drivers/usb/host/ohci-mem.c | 1 - drivers/usb/host/ohci-omap.c | 36 ++++++++++++------------------------ drivers/usb/host/ohci-pci.c | 40 ++++++++-------------------------------- drivers/usb/host/ohci.h | 1 - 7 files changed, 33 insertions(+), 93 deletions(-)
Diffstat (limited to 'drivers/usb/host/ohci-pci.c')
-rw-r--r--drivers/usb/host/ohci-pci.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 0afa237b02ad..99a0ad41aec5 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -112,23 +112,13 @@ ohci_pci_start (struct usb_hcd *hcd)
112 112
113static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) 113static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
114{ 114{
115 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 115 /* root hub was already suspended */
116
117 /* suspend root hub, hoping it keeps power during suspend */
118 if (time_before (jiffies, ohci->next_statechange))
119 msleep (100);
120
121#ifdef CONFIG_USB_SUSPEND
122 (void) usb_suspend_device (hcd->self.root_hub);
123#else
124 usb_lock_device (hcd->self.root_hub);
125 (void) ohci_hub_suspend (hcd);
126 usb_unlock_device (hcd->self.root_hub);
127#endif
128 116
129 /* let things settle down a bit */ 117 /* FIXME these PMAC things get called in the wrong places. ASIC
130 msleep (100); 118 * clocks should be turned off AFTER entering D3, and on BEFORE
131 119 * trying to enter D0. Evidently the PCI layer doesn't currently
120 * provide the right sort of platform hooks for this ...
121 */
132#ifdef CONFIG_PPC_PMAC 122#ifdef CONFIG_PPC_PMAC
133 if (_machine == _MACH_Pmac) { 123 if (_machine == _MACH_Pmac) {
134 struct device_node *of_node; 124 struct device_node *of_node;
@@ -145,9 +135,6 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
145 135
146static int ohci_pci_resume (struct usb_hcd *hcd) 136static int ohci_pci_resume (struct usb_hcd *hcd)
147{ 137{
148 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
149 int retval = 0;
150
151#ifdef CONFIG_PPC_PMAC 138#ifdef CONFIG_PPC_PMAC
152 if (_machine == _MACH_Pmac) { 139 if (_machine == _MACH_Pmac) {
153 struct device_node *of_node; 140 struct device_node *of_node;
@@ -159,19 +146,8 @@ static int ohci_pci_resume (struct usb_hcd *hcd)
159 } 146 }
160#endif /* CONFIG_PPC_PMAC */ 147#endif /* CONFIG_PPC_PMAC */
161 148
162 /* resume root hub */ 149 usb_hcd_resume_root_hub(hcd);
163 if (time_before (jiffies, ohci->next_statechange)) 150 return 0;
164 msleep (100);
165#ifdef CONFIG_USB_SUSPEND
166 /* get extra cleanup even if remote wakeup isn't in use */
167 retval = usb_resume_device (hcd->self.root_hub);
168#else
169 usb_lock_device (hcd->self.root_hub);
170 retval = ohci_hub_resume (hcd);
171 usb_unlock_device (hcd->self.root_hub);
172#endif
173
174 return retval;
175} 151}
176 152
177#endif /* CONFIG_PM */ 153#endif /* CONFIG_PM */