aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorWang Xingchao <xingchao.wang@linux.intel.com>2013-05-30 10:07:08 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-06 11:31:47 -0400
commitc67e2228b799ea586f4f6ba7006ce61431f8dde6 (patch)
tree843a094c9a564698be6afb25f7445f6d2944c6c0 /sound/pci
parentf85da868e3b998394634209cc1e48e0f4126901b (diff)
ALSA: hda - Fix runtime PM check
The device can support runtime PM no matter whether it support signal wakeup or not. For some chips like Haswell which doesnot support PME by default, this patch let haswell Display HD-A controller enter runtime suspend, and bring more power saving whith power-well feature enabled. Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index de18722c4873..aa4d4d716704 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -3120,8 +3120,13 @@ static int register_vga_switcheroo(struct azx *chip)
3120 */ 3120 */
3121static int azx_free(struct azx *chip) 3121static int azx_free(struct azx *chip)
3122{ 3122{
3123 struct pci_dev *pci = chip->pci;
3123 int i; 3124 int i;
3124 3125
3126 if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
3127 && chip->running)
3128 pm_runtime_get_noresume(&pci->dev);
3129
3125 azx_del_card_list(chip); 3130 azx_del_card_list(chip);
3126 3131
3127 azx_notifier_unregister(chip); 3132 azx_notifier_unregister(chip);
@@ -3755,9 +3760,6 @@ static int azx_probe(struct pci_dev *pci,
3755 goto out_free; 3760 goto out_free;
3756 } 3761 }
3757 3762
3758 if (pci_dev_run_wake(pci))
3759 pm_runtime_put_noidle(&pci->dev);
3760
3761 dev++; 3763 dev++;
3762 complete_all(&chip->probe_wait); 3764 complete_all(&chip->probe_wait);
3763 return 0; 3765 return 0;
@@ -3770,6 +3772,7 @@ out_free:
3770 3772
3771static int azx_probe_continue(struct azx *chip) 3773static int azx_probe_continue(struct azx *chip)
3772{ 3774{
3775 struct pci_dev *pci = chip->pci;
3773 int dev = chip->dev_index; 3776 int dev = chip->dev_index;
3774 int err; 3777 int err;
3775 3778
@@ -3817,6 +3820,8 @@ static int azx_probe_continue(struct azx *chip)
3817 power_down_all_codecs(chip); 3820 power_down_all_codecs(chip);
3818 azx_notifier_register(chip); 3821 azx_notifier_register(chip);
3819 azx_add_card_list(chip); 3822 azx_add_card_list(chip);
3823 if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
3824 pm_runtime_put_noidle(&pci->dev);
3820 3825
3821 return 0; 3826 return 0;
3822 3827
@@ -3829,9 +3834,6 @@ static void azx_remove(struct pci_dev *pci)
3829{ 3834{
3830 struct snd_card *card = pci_get_drvdata(pci); 3835 struct snd_card *card = pci_get_drvdata(pci);
3831 3836
3832 if (pci_dev_run_wake(pci))
3833 pm_runtime_get_noresume(&pci->dev);
3834
3835 if (card) 3837 if (card)
3836 snd_card_free(card); 3838 snd_card_free(card);
3837 pci_set_drvdata(pci, NULL); 3839 pci_set_drvdata(pci, NULL);