diff options
Diffstat (limited to 'drivers/usb/host/uhci-hcd.c')
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index fec9872dd9dc..f65d5a858733 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -262,20 +262,12 @@ __acquires(uhci->lock) | |||
262 | { | 262 | { |
263 | int auto_stop; | 263 | int auto_stop; |
264 | int int_enable, egsm_enable; | 264 | int int_enable, egsm_enable; |
265 | struct usb_device *rhdev = uhci_to_hcd(uhci)->self.root_hub; | ||
265 | 266 | ||
266 | auto_stop = (new_state == UHCI_RH_AUTO_STOPPED); | 267 | auto_stop = (new_state == UHCI_RH_AUTO_STOPPED); |
267 | dev_dbg(&uhci_to_hcd(uhci)->self.root_hub->dev, | 268 | dev_dbg(&rhdev->dev, "%s%s\n", __func__, |
268 | "%s%s\n", __FUNCTION__, | ||
269 | (auto_stop ? " (auto-stop)" : "")); | 269 | (auto_stop ? " (auto-stop)" : "")); |
270 | 270 | ||
271 | /* If we get a suspend request when we're already auto-stopped | ||
272 | * then there's nothing to do. | ||
273 | */ | ||
274 | if (uhci->rh_state == UHCI_RH_AUTO_STOPPED) { | ||
275 | uhci->rh_state = new_state; | ||
276 | return; | ||
277 | } | ||
278 | |||
279 | /* Enable resume-detect interrupts if they work. | 271 | /* Enable resume-detect interrupts if they work. |
280 | * Then enter Global Suspend mode if _it_ works, still configured. | 272 | * Then enter Global Suspend mode if _it_ works, still configured. |
281 | */ | 273 | */ |
@@ -285,8 +277,10 @@ __acquires(uhci->lock) | |||
285 | if (remote_wakeup_is_broken(uhci)) | 277 | if (remote_wakeup_is_broken(uhci)) |
286 | egsm_enable = 0; | 278 | egsm_enable = 0; |
287 | if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable || | 279 | if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable || |
288 | !device_may_wakeup( | 280 | #ifdef CONFIG_PM |
289 | &uhci_to_hcd(uhci)->self.root_hub->dev)) | 281 | (!auto_stop && !rhdev->do_remote_wakeup) || |
282 | #endif | ||
283 | (auto_stop && !device_may_wakeup(&rhdev->dev))) | ||
290 | uhci->working_RD = int_enable = 0; | 284 | uhci->working_RD = int_enable = 0; |
291 | 285 | ||
292 | outw(int_enable, uhci->io_addr + USBINTR); | 286 | outw(int_enable, uhci->io_addr + USBINTR); |
@@ -308,8 +302,7 @@ __acquires(uhci->lock) | |||
308 | return; | 302 | return; |
309 | } | 303 | } |
310 | if (!(inw(uhci->io_addr + USBSTS) & USBSTS_HCH)) | 304 | if (!(inw(uhci->io_addr + USBSTS) & USBSTS_HCH)) |
311 | dev_warn(&uhci_to_hcd(uhci)->self.root_hub->dev, | 305 | dev_warn(uhci_dev(uhci), "Controller not stopped yet!\n"); |
312 | "Controller not stopped yet!\n"); | ||
313 | 306 | ||
314 | uhci_get_current_frame_number(uhci); | 307 | uhci_get_current_frame_number(uhci); |
315 | 308 | ||