From: Wang Xingchao <xingchao.wang@linux.intel.com>
To: tiwai@suse.de, daniel.vetter@ffwll.ch
Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org,
Wang Xingchao <xingchao.wang@linux.intel.com>,
xingchao.wang@intel.com, liam.r.girdwood@intel.com,
david.henningsson@canonical.com
Subject: [PATCH 1/4 V7] ALSA: hda - Fix runtime PM check
Date: Thu, 30 May 2013 22:07:08 +0800 [thread overview]
Message-ID: <1369922831-727-2-git-send-email-xingchao.wang@linux.intel.com> (raw)
In-Reply-To: <1369922831-727-1-git-send-email-xingchao.wang@linux.intel.com>
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>
---
sound/pci/hda/hda_intel.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 418bfc0..cf3d36c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -3091,8 +3091,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);
@@ -3726,9 +3731,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;
@@ -3741,6 +3743,7 @@ out_free:
static int azx_probe_continue(struct azx *chip)
{
+ struct pci_dev *pci = chip->pci;
int dev = chip->dev_index;
int err;
@@ -3788,6 +3791,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;
@@ -3800,9 +3805,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);
--
1.7.9.5
next prev parent reply other threads:[~2013-05-30 14:34 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 14:07 [PATCH 0/4 V7] Power-well API implementation for Haswell Wang Xingchao
2013-05-30 14:07 ` Wang Xingchao [this message]
2013-05-30 14:07 ` [PATCH 2/4] ALSA: hda - Move azx_first_init() into azx_probe_continue() Wang Xingchao
2013-05-30 14:07 ` [PATCH 3/4 V7] ALSA: hda - Add power-welll support for haswell HDA Wang Xingchao
2013-05-30 14:07 ` [PATCH 4/4 V7] i915/drm: Add private api for power well usage Wang Xingchao
2013-06-06 15:34 ` [PATCH 0/4 V7] Power-well API implementation for Haswell Daniel Vetter
2013-07-03 20:00 ` Paulo Zanoni
2013-07-04 8:23 ` Wang xingchao
2013-07-04 13:24 ` Paulo Zanoni
2013-07-04 13:13 ` [Intel-gfx] " Wang xingchao
2013-07-05 21:19 ` Paulo Zanoni
2013-07-06 6:20 ` [Intel-gfx] " Takashi Iwai
2013-07-07 23:59 ` Wang xingchao
2013-07-08 8:07 ` Takashi Iwai
2013-07-17 2:52 ` [Intel-gfx] " Wang, Xingchao
2013-07-17 7:34 ` [alsa-devel] " Takashi Iwai
2013-07-17 8:03 ` [Intel-gfx] " Wang, Xingchao
2013-07-17 8:18 ` Takashi Iwai
2013-07-17 8:25 ` Wang, Xingchao
2013-07-17 13:31 ` [alsa-devel] " Paulo Zanoni
2013-07-17 14:00 ` [Intel-gfx] " Takashi Iwai
2013-07-17 14:05 ` David Henningsson
2013-07-17 14:21 ` [alsa-devel] " Takashi Iwai
2013-07-17 23:17 ` [Intel-gfx] " Wang, Xingchao
2013-07-18 1:00 ` Wang, Xingchao
2013-07-18 6:44 ` Daniel Vetter
2013-07-18 9:23 ` [alsa-devel] " Wang, Xingchao
2013-07-18 9:34 ` Takashi Iwai
2013-07-24 10:31 ` [Intel-gfx] " Wang, Xingchao
2013-07-24 11:02 ` [alsa-devel] " Takashi Iwai
2013-07-24 11:33 ` [Intel-gfx] " Wang, Xingchao
2013-07-24 11:57 ` [alsa-devel] " David Henningsson
2013-07-24 12:13 ` [Intel-gfx] " Takashi Iwai
2013-07-24 13:14 ` Rafael J. Wysocki
2013-07-24 13:30 ` Wang, Xingchao
2013-07-24 13:42 ` Takashi Iwai
2013-07-24 13:46 ` Wang, Xingchao
2013-07-24 14:00 ` Wang, Xingchao
2013-07-25 6:50 ` [alsa-devel] " Wang, Xingchao
2013-07-24 14:36 ` [Intel-gfx] " Wang, Xingchao
2013-07-18 6:54 ` [alsa-devel] " Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369922831-727-2-git-send-email-xingchao.wang@linux.intel.com \
--to=xingchao.wang@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=daniel.vetter@ffwll.ch \
--cc=david.henningsson@canonical.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=liam.r.girdwood@intel.com \
--cc=tiwai@suse.de \
--cc=xingchao.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).