diff options
Diffstat (limited to 'sound/pci/intel8x0m.c')
-rw-r--r-- | sound/pci/intel8x0m.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index fc27a6a69e77..da44bb3f8e7a 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -1012,9 +1012,10 @@ static int snd_intel8x0m_free(struct intel8x0m *chip) | |||
1012 | /* | 1012 | /* |
1013 | * power management | 1013 | * power management |
1014 | */ | 1014 | */ |
1015 | static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state) | 1015 | static int intel8x0m_suspend(struct device *dev) |
1016 | { | 1016 | { |
1017 | struct snd_card *card = pci_get_drvdata(pci); | 1017 | struct pci_dev *pci = to_pci_dev(dev); |
1018 | struct snd_card *card = dev_get_drvdata(dev); | ||
1018 | struct intel8x0m *chip = card->private_data; | 1019 | struct intel8x0m *chip = card->private_data; |
1019 | int i; | 1020 | int i; |
1020 | 1021 | ||
@@ -1028,13 +1029,14 @@ static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state) | |||
1028 | } | 1029 | } |
1029 | pci_disable_device(pci); | 1030 | pci_disable_device(pci); |
1030 | pci_save_state(pci); | 1031 | pci_save_state(pci); |
1031 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1032 | pci_set_power_state(pci, PCI_D3hot); |
1032 | return 0; | 1033 | return 0; |
1033 | } | 1034 | } |
1034 | 1035 | ||
1035 | static int intel8x0m_resume(struct pci_dev *pci) | 1036 | static int intel8x0m_resume(struct device *dev) |
1036 | { | 1037 | { |
1037 | struct snd_card *card = pci_get_drvdata(pci); | 1038 | struct pci_dev *pci = to_pci_dev(dev); |
1039 | struct snd_card *card = dev_get_drvdata(dev); | ||
1038 | struct intel8x0m *chip = card->private_data; | 1040 | struct intel8x0m *chip = card->private_data; |
1039 | 1041 | ||
1040 | pci_set_power_state(pci, PCI_D0); | 1042 | pci_set_power_state(pci, PCI_D0); |
@@ -1060,6 +1062,11 @@ static int intel8x0m_resume(struct pci_dev *pci) | |||
1060 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1062 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1061 | return 0; | 1063 | return 0; |
1062 | } | 1064 | } |
1065 | |||
1066 | static SIMPLE_DEV_PM_OPS(intel8x0m_pm, intel8x0m_suspend, intel8x0m_resume); | ||
1067 | #define INTEL8X0M_PM_OPS &intel8x0m_pm | ||
1068 | #else | ||
1069 | #define INTEL8X0M_PM_OPS NULL | ||
1063 | #endif /* CONFIG_PM */ | 1070 | #endif /* CONFIG_PM */ |
1064 | 1071 | ||
1065 | #ifdef CONFIG_PROC_FS | 1072 | #ifdef CONFIG_PROC_FS |
@@ -1329,10 +1336,9 @@ static struct pci_driver intel8x0m_driver = { | |||
1329 | .id_table = snd_intel8x0m_ids, | 1336 | .id_table = snd_intel8x0m_ids, |
1330 | .probe = snd_intel8x0m_probe, | 1337 | .probe = snd_intel8x0m_probe, |
1331 | .remove = __devexit_p(snd_intel8x0m_remove), | 1338 | .remove = __devexit_p(snd_intel8x0m_remove), |
1332 | #ifdef CONFIG_PM | 1339 | .driver = { |
1333 | .suspend = intel8x0m_suspend, | 1340 | .pm = INTEL8X0M_PM_OPS, |
1334 | .resume = intel8x0m_resume, | 1341 | }, |
1335 | #endif | ||
1336 | }; | 1342 | }; |
1337 | 1343 | ||
1338 | module_pci_driver(intel8x0m_driver); | 1344 | module_pci_driver(intel8x0m_driver); |