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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c19e71a94e1b..6e958bf94191 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2351,6 +2351,17 @@ static void azx_power_notify(struct hda_bus *bus)
2351 * power management 2351 * power management
2352 */ 2352 */
2353 2353
2354static int snd_hda_codecs_inuse(struct hda_bus *bus)
2355{
2356 struct hda_codec *codec;
2357
2358 list_for_each_entry(codec, &bus->codec_list, list) {
2359 if (snd_hda_codec_needs_resume(codec))
2360 return 1;
2361 }
2362 return 0;
2363}
2364
2354static int azx_suspend(struct pci_dev *pci, pm_message_t state) 2365static int azx_suspend(struct pci_dev *pci, pm_message_t state)
2355{ 2366{
2356 struct snd_card *card = pci_get_drvdata(pci); 2367 struct snd_card *card = pci_get_drvdata(pci);
@@ -2397,7 +2408,8 @@ static int azx_resume(struct pci_dev *pci)
2397 return -EIO; 2408 return -EIO;
2398 azx_init_pci(chip); 2409 azx_init_pci(chip);
2399 2410
2400 azx_init_chip(chip, 1); 2411 if (snd_hda_codecs_inuse(chip->bus))
2412 azx_init_chip(chip, 1);
2401 2413
2402 snd_hda_resume(chip->bus); 2414 snd_hda_resume(chip->bus);
2403 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2415 snd_power_change_state(card, SNDRV_CTL_POWER_D0);