linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [sound] hdac-codec runtime suspended at PM:Suspend.
@ 2018-03-12 11:17 Anshuman Gupta
  2018-03-12 11:26 ` Rafael J. Wysocki
  0 siblings, 1 reply; 11+ messages in thread
From: Anshuman Gupta @ 2018-03-12 11:17 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai
  Cc: alsa-devel, linux-kernel, linux-pm, anshuman.gupta

Keep hdac-codec to be in runtime suspended while entering to suspend.
If hdac-codec is already in runtime suspend state skip its power down
sequence in prepare, power up sequence in complete phase.

Avoid resuming hdac controller PCI device 00:1f.3 from runtime suspend
state in case  hdac-codec already in runtime-suspend state, this is
unnecessary and block the direct complete even for hdac controller
PCI device 00:1f.3.

This enabled direct complete path for hdac-codec and PCI device 00:1f.3.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 sound/soc/codecs/hdac_hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index f3b4f4d..810a8a6 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1852,6 +1852,8 @@ static int hdmi_codec_prepare(struct device *dev)
 	struct hdac_ext_device *edev = to_hda_ext_device(dev);
 	struct hdac_device *hdac = &edev->hdac;
 
+	if (pm_runtime_status_suspended(dev))
+		return 1;
 	pm_runtime_get_sync(&edev->hdac.dev);
 
 	/*
@@ -1873,6 +1875,8 @@ static void hdmi_codec_complete(struct device *dev)
 	struct hdac_hdmi_priv *hdmi = edev->private_data;
 	struct hdac_device *hdac = &edev->hdac;
 
+	if (pm_runtime_status_suspended(dev))
+		return;
 	/* Power up afg */
 	snd_hdac_codec_read(hdac, hdac->afg, 0,	AC_VERB_SET_POWER_STATE,
 							AC_PWRST_D0);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-08-28 17:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 11:17 [PATCH] [sound] hdac-codec runtime suspended at PM:Suspend Anshuman Gupta
2018-03-12 11:26 ` Rafael J. Wysocki
     [not found]   ` <5aa8fbe9.4251620a.c3daa.3711SMTPIN_ADDED_BROKEN@mx.google.com>
2018-03-14 10:53     ` Rafael J. Wysocki
     [not found]       ` <20180314153714.GA11459@anshuman.gupta@intel.com>
2018-03-15 10:42         ` Subhransu S. Prusty
     [not found]           ` <20180315153230.GA16531@anshuman.gupta@intel.com>
2018-03-26  7:03             ` Subhransu S. Prusty
2018-03-26  7:30               ` Takashi Iwai
2018-03-27 15:36                 ` Lukas Wunner
2018-08-18 18:12   ` [PATCH v2 0/1] cover-letter " Anshuman Gupta
2018-08-18 18:12     ` [PATCH v2 1/1] " Anshuman Gupta
2018-08-28 16:34       ` Anshuman Gupta
2018-08-28 17:05         ` Takashi Iwai

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).