aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2006-09-17 13:39:06 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-09-17 13:39:06 -0400
commitf0645e7720e0baacbde61d7d1f0180309451c695 (patch)
tree78a0c50f341648770963372162331643888647ba /drivers
parent9531f13ae56b136d0ad09e6e5c8308a7dc58f3f0 (diff)
set power state of firewire host during suspend
Put firewire host controller in PCI Dx state for system suspend. (I was not able to measure any power savings, but it sounds like right thing to do, anyway.) Signed-off-by: Pavel Machek <pavel@suse.cz> Update by stefanr: Shuffle with existing PPC_PMAC code. Set power state in the resume hook too. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ieee1394/ohci1394.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 8d92246bdc3b..54d686aed39f 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -3532,6 +3532,7 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
3532#ifdef CONFIG_PM 3532#ifdef CONFIG_PM
3533static int ohci1394_pci_resume (struct pci_dev *pdev) 3533static int ohci1394_pci_resume (struct pci_dev *pdev)
3534{ 3534{
3535/* PowerMac resume code comes first */
3535#ifdef CONFIG_PPC_PMAC 3536#ifdef CONFIG_PPC_PMAC
3536 if (machine_is(powermac)) { 3537 if (machine_is(powermac)) {
3537 struct device_node *of_node; 3538 struct device_node *of_node;
@@ -3543,17 +3544,19 @@ static int ohci1394_pci_resume (struct pci_dev *pdev)
3543 } 3544 }
3544#endif /* CONFIG_PPC_PMAC */ 3545#endif /* CONFIG_PPC_PMAC */
3545 3546
3547 pci_set_power_state(pdev, PCI_D0);
3546 pci_restore_state(pdev); 3548 pci_restore_state(pdev);
3547 pci_enable_device(pdev); 3549 pci_enable_device(pdev);
3548 3550
3549 return 0; 3551 return 0;
3550} 3552}
3551 3553
3552
3553static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state) 3554static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state)
3554{ 3555{
3555 pci_save_state(pdev); 3556 pci_save_state(pdev);
3557 pci_set_power_state(pdev, pci_choose_state(pdev, state));
3556 3558
3559/* PowerMac suspend code comes last */
3557#ifdef CONFIG_PPC_PMAC 3560#ifdef CONFIG_PPC_PMAC
3558 if (machine_is(powermac)) { 3561 if (machine_is(powermac)) {
3559 struct device_node *of_node; 3562 struct device_node *of_node;
@@ -3563,11 +3566,10 @@ static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state)
3563 if (of_node) 3566 if (of_node)
3564 pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0); 3567 pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0);
3565 } 3568 }
3566#endif 3569#endif /* CONFIG_PPC_PMAC */
3567
3568 return 0; 3570 return 0;
3569} 3571}
3570#endif 3572#endif /* CONFIG_PM */
3571 3573
3572#define PCI_CLASS_FIREWIRE_OHCI ((PCI_CLASS_SERIAL_FIREWIRE << 8) | 0x10) 3574#define PCI_CLASS_FIREWIRE_OHCI ((PCI_CLASS_SERIAL_FIREWIRE << 8) | 0x10)
3573 3575