diff options
Diffstat (limited to 'drivers/usb/host/ohci-pci.c')
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index eede6be098d2..bf1d5ab4aa3a 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, message); | ||
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 */ |
@@ -218,9 +194,9 @@ static const struct hc_driver ohci_pci_hc_driver = { | |||
218 | */ | 194 | */ |
219 | .hub_status_data = ohci_hub_status_data, | 195 | .hub_status_data = ohci_hub_status_data, |
220 | .hub_control = ohci_hub_control, | 196 | .hub_control = ohci_hub_control, |
221 | #ifdef CONFIG_USB_SUSPEND | 197 | #ifdef CONFIG_PM |
222 | .hub_suspend = ohci_hub_suspend, | 198 | .bus_suspend = ohci_bus_suspend, |
223 | .hub_resume = ohci_hub_resume, | 199 | .bus_resume = ohci_bus_resume, |
224 | #endif | 200 | #endif |
225 | .start_port_reset = ohci_start_port_reset, | 201 | .start_port_reset = ohci_start_port_reset, |
226 | }; | 202 | }; |
@@ -240,6 +216,7 @@ MODULE_DEVICE_TABLE (pci, pci_ids); | |||
240 | static struct pci_driver ohci_pci_driver = { | 216 | static struct pci_driver ohci_pci_driver = { |
241 | .name = (char *) hcd_name, | 217 | .name = (char *) hcd_name, |
242 | .id_table = pci_ids, | 218 | .id_table = pci_ids, |
219 | .owner = THIS_MODULE, | ||
243 | 220 | ||
244 | .probe = usb_hcd_pci_probe, | 221 | .probe = usb_hcd_pci_probe, |
245 | .remove = usb_hcd_pci_remove, | 222 | .remove = usb_hcd_pci_remove, |