From: Pavel Machek Subject: 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 Update by stefanr: Shuffle with existing PPC_PMAC code. Set power state in the resume hook too. Signed-off-by: Stefan Richter Index: linux/drivers/ieee1394/ohci1394.c =================================================================== --- linux.orig/drivers/ieee1394/ohci1394.c 2006-09-07 20:33:29.000000000 +0200 +++ linux/drivers/ieee1394/ohci1394.c 2006-09-07 22:58:27.000000000 +0200 @@ -3535,6 +3535,7 @@ static void ohci1394_pci_remove(struct p #ifdef CONFIG_PM static int ohci1394_pci_resume (struct pci_dev *pdev) { +/* PowerMac resume code comes first */ #ifdef CONFIG_PPC_PMAC if (machine_is(powermac)) { struct device_node *of_node; @@ -3546,17 +3547,19 @@ static int ohci1394_pci_resume (struct p } #endif /* CONFIG_PPC_PMAC */ + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); pci_enable_device(pdev); return 0; } - static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state) { pci_save_state(pdev); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); +/* PowerMac suspend code comes last */ #ifdef CONFIG_PPC_PMAC if (machine_is(powermac)) { struct device_node *of_node; @@ -3566,11 +3569,10 @@ static int ohci1394_pci_suspend (struct if (of_node) pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0); } -#endif - +#endif /* CONFIG_PPC_PMAC */ return 0; } -#endif +#endif /* CONFIG_PM */ #define PCI_CLASS_FIREWIRE_OHCI ((PCI_CLASS_SERIAL_FIREWIRE << 8) | 0x10)