diff options
author | David Brownell <david-b@pacbell.net> | 2005-11-23 18:45:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-24 02:04:28 -0500 |
commit | 21b1861fb2ba5b25b32c63bc540bbc7ca1d186f8 (patch) | |
tree | bb99e3e7d2ff715d9dbee2db6b3c229d75c2365b /drivers/usb/core | |
parent | 188075211cc75a31190de4a19a084e3d83ee1c89 (diff) |
[PATCH] USB: ohci, move ppc asic tweaks nearer pci
This should fix a suspend/resume issues that appear with OHCI on some
PPC hardware. The PCI layer should doesn't have the hooks needed for
such ASIC-specific hooks (in this case, software clock gating), so
this moves the code to do that into hcd-pci.c ... where it can be
done after the relevant PCI PM state transition (to/from D3).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 7feb829362d6..5131d88e8c5b 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -20,9 +20,17 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
23 | #include <linux/usb.h> | ||
24 | |||
23 | #include <asm/io.h> | 25 | #include <asm/io.h> |
24 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
25 | #include <linux/usb.h> | 27 | |
28 | #ifdef CONFIG_PPC_PMAC | ||
29 | #include <asm/machdep.h> | ||
30 | #include <asm/pmac_feature.h> | ||
31 | #include <asm/pci-bridge.h> | ||
32 | #include <asm/prom.h> | ||
33 | #endif | ||
26 | 34 | ||
27 | #include "usb.h" | 35 | #include "usb.h" |
28 | #include "hcd.h" | 36 | #include "hcd.h" |
@@ -277,8 +285,22 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message) | |||
277 | } | 285 | } |
278 | 286 | ||
279 | done: | 287 | done: |
280 | if (retval == 0) | 288 | if (retval == 0) { |
281 | dev->dev.power.power_state = PMSG_SUSPEND; | 289 | dev->dev.power.power_state = PMSG_SUSPEND; |
290 | |||
291 | #ifdef CONFIG_PPC_PMAC | ||
292 | /* Disable ASIC clocks for USB */ | ||
293 | if (_machine == _MACH_Pmac) { | ||
294 | struct device_node *of_node; | ||
295 | |||
296 | of_node = pci_device_to_OF_node (dev); | ||
297 | if (of_node) | ||
298 | pmac_call_feature(PMAC_FTR_USB_ENABLE, | ||
299 | of_node, 0, 0); | ||
300 | } | ||
301 | #endif | ||
302 | } | ||
303 | |||
282 | return retval; | 304 | return retval; |
283 | } | 305 | } |
284 | EXPORT_SYMBOL (usb_hcd_pci_suspend); | 306 | EXPORT_SYMBOL (usb_hcd_pci_suspend); |
@@ -301,6 +323,18 @@ int usb_hcd_pci_resume (struct pci_dev *dev) | |||
301 | return 0; | 323 | return 0; |
302 | } | 324 | } |
303 | 325 | ||
326 | #ifdef CONFIG_PPC_PMAC | ||
327 | /* Reenable ASIC clocks for USB */ | ||
328 | if (_machine == _MACH_Pmac) { | ||
329 | struct device_node *of_node; | ||
330 | |||
331 | of_node = pci_device_to_OF_node (dev); | ||
332 | if (of_node) | ||
333 | pmac_call_feature (PMAC_FTR_USB_ENABLE, | ||
334 | of_node, 0, 1); | ||
335 | } | ||
336 | #endif | ||
337 | |||
304 | /* NOTE: chip docs cover clean "real suspend" cases (what Linux | 338 | /* NOTE: chip docs cover clean "real suspend" cases (what Linux |
305 | * calls "standby", "suspend to RAM", and so on). There are also | 339 | * calls "standby", "suspend to RAM", and so on). There are also |
306 | * dirty cases when swsusp fakes a suspend in "shutdown" mode. | 340 | * dirty cases when swsusp fakes a suspend in "shutdown" mode. |