diff options
Diffstat (limited to 'drivers/usb/host/ohci-pci.c')
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 40 |
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 | ||
113 | static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) | 113 | static 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 | ||
146 | static int ohci_pci_resume (struct usb_hcd *hcd) | 136 | static 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 */ |