summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorWang Xingchao <xingchao.wang@linux.intel.com>2013-05-30 22:07:08 +0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-06 17:31:47 +0200
commitc67e2228b799ea586f4f6ba7006ce61431f8dde6 (patch)
tree843a094c9a564698be6afb25f7445f6d2944c6c0 /sound
parentf85da868e3b998394634209cc1e48e0f4126901b (diff)
downloadlinux-c67e2228b799ea586f4f6ba7006ce61431f8dde6.tar.gz
linux-c67e2228b799ea586f4f6ba7006ce61431f8dde6.tar.bz2
linux-c67e2228b799ea586f4f6ba7006ce61431f8dde6.zip
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')
-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)
*/
static int azx_free(struct azx *chip)
{
+ struct pci_dev *pci = chip->pci;
int i;
+ if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
+ && chip->running)
+ pm_runtime_get_noresume(&pci->dev);
+
azx_del_card_list(chip);
azx_notifier_unregister(chip);
@@ -3755,9 +3760,6 @@ static int azx_probe(struct pci_dev *pci,
goto out_free;
}
- if (pci_dev_run_wake(pci))
- pm_runtime_put_noidle(&pci->dev);
-
dev++;
complete_all(&chip->probe_wait);
return 0;
@@ -3770,6 +3772,7 @@ out_free:
static int azx_probe_continue(struct azx *chip)
{
+ struct pci_dev *pci = chip->pci;
int dev = chip->dev_index;
int err;
@@ -3817,6 +3820,8 @@ static int azx_probe_continue(struct azx *chip)
power_down_all_codecs(chip);
azx_notifier_register(chip);
azx_add_card_list(chip);
+ if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
+ pm_runtime_put_noidle(&pci->dev);
return 0;
@@ -3829,9 +3834,6 @@ static void azx_remove(struct pci_dev *pci)
{
struct snd_card *card = pci_get_drvdata(pci);
- if (pci_dev_run_wake(pci))
- pm_runtime_get_noresume(&pci->dev);
-
if (card)
snd_card_free(card);
pci_set_drvdata(pci, NULL);