aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b4f3c7295a53..c8aced182fd1 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2405,9 +2405,10 @@ static void azx_power_notify(struct hda_bus *bus)
2405 * power management 2405 * power management
2406 */ 2406 */
2407 2407
2408static int azx_suspend(struct pci_dev *pci, pm_message_t state) 2408static int azx_suspend(struct device *dev)
2409{ 2409{
2410 struct snd_card *card = pci_get_drvdata(pci); 2410 struct pci_dev *pci = to_pci_dev(dev);
2411 struct snd_card *card = dev_get_drvdata(dev);
2411 struct azx *chip = card->private_data; 2412 struct azx *chip = card->private_data;
2412 struct azx_pcm *p; 2413 struct azx_pcm *p;
2413 2414
@@ -2426,13 +2427,14 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
2426 pci_disable_msi(chip->pci); 2427 pci_disable_msi(chip->pci);
2427 pci_disable_device(pci); 2428 pci_disable_device(pci);
2428 pci_save_state(pci); 2429 pci_save_state(pci);
2429 pci_set_power_state(pci, pci_choose_state(pci, state)); 2430 pci_set_power_state(pci, PCI_D3hot);
2430 return 0; 2431 return 0;
2431} 2432}
2432 2433
2433static int azx_resume(struct pci_dev *pci) 2434static int azx_resume(struct device *dev)
2434{ 2435{
2435 struct snd_card *card = pci_get_drvdata(pci); 2436 struct pci_dev *pci = to_pci_dev(dev);
2437 struct snd_card *card = dev_get_drvdata(dev);
2436 struct azx *chip = card->private_data; 2438 struct azx *chip = card->private_data;
2437 2439
2438 pci_set_power_state(pci, PCI_D0); 2440 pci_set_power_state(pci, PCI_D0);
@@ -2457,6 +2459,12 @@ static int azx_resume(struct pci_dev *pci)
2457 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2459 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
2458 return 0; 2460 return 0;
2459} 2461}
2462static SIMPLE_DEV_PM_OPS(azx_pm, azx_suspend, azx_resume);
2463#define AZX_PM_OPS &azx_pm
2464#else
2465#define azx_suspend(dev)
2466#define azx_resume(dev)
2467#define AZX_PM_OPS NULL
2460#endif /* CONFIG_PM */ 2468#endif /* CONFIG_PM */
2461 2469
2462 2470
@@ -2523,13 +2531,13 @@ static void azx_vs_set_state(struct pci_dev *pci,
2523 disabled ? "Disabling" : "Enabling", 2531 disabled ? "Disabling" : "Enabling",
2524 pci_name(chip->pci)); 2532 pci_name(chip->pci));
2525 if (disabled) { 2533 if (disabled) {
2526 azx_suspend(pci, PMSG_FREEZE); 2534 azx_suspend(&pci->dev);
2527 chip->disabled = true; 2535 chip->disabled = true;
2528 snd_hda_lock_devices(chip->bus); 2536 snd_hda_lock_devices(chip->bus);
2529 } else { 2537 } else {
2530 snd_hda_unlock_devices(chip->bus); 2538 snd_hda_unlock_devices(chip->bus);
2531 chip->disabled = false; 2539 chip->disabled = false;
2532 azx_resume(pci); 2540 azx_resume(&pci->dev);
2533 } 2541 }
2534 } 2542 }
2535} 2543}
@@ -3412,10 +3420,9 @@ static struct pci_driver azx_driver = {
3412 .id_table = azx_ids, 3420 .id_table = azx_ids,
3413 .probe = azx_probe, 3421 .probe = azx_probe,
3414 .remove = __devexit_p(azx_remove), 3422 .remove = __devexit_p(azx_remove),
3415#ifdef CONFIG_PM 3423 .driver = {
3416 .suspend = azx_suspend, 3424 .pm = AZX_PM_OPS,
3417 .resume = azx_resume, 3425 },
3418#endif
3419}; 3426};
3420 3427
3421module_pci_driver(azx_driver); 3428module_pci_driver(azx_driver);