All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, lgirdwood@gmail.com, patches.audio@intel.com,
	broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Subject: [PATCH 1/3] ASoC: hdac_hdmi: Fix to use dev_pm ops instead soc pm
Date: Fri,  1 Apr 2016 13:36:25 +0530	[thread overview]
Message-ID: <1459497987-28979-2-git-send-email-subhransu.s.prusty@intel.com> (raw)
In-Reply-To: <1459497987-28979-1-git-send-email-subhransu.s.prusty@intel.com>

Use dev_pm ops feature instead of soc pm as core assumes system
is capable of direct complete. Register with complete callback
instead of resume to synchronize with Jack notification from
display driver. This ensures correct Jack notification to user
space.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/codecs/hdac_hdmi.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 26f9459..da3432c 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1420,9 +1420,9 @@ static int hdmi_codec_remove(struct snd_soc_codec *codec)
 }
 
 #ifdef CONFIG_PM
-static int hdmi_codec_resume(struct snd_soc_codec *codec)
+static void hdmi_codec_complete(struct device *dev)
 {
-	struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
+	struct hdac_ext_device *edev = to_hda_ext_device(dev);
 	struct hdac_hdmi_priv *hdmi = edev->private_data;
 	struct hdac_hdmi_pin *pin;
 	struct hdac_device *hdac = &edev->hdac;
@@ -1464,19 +1464,15 @@ static int hdmi_codec_resume(struct snd_soc_codec *codec)
 		dev_err(bus->dev,
 			"Cannot turn OFF display power on i915, err: %d\n",
 			err);
-		return err;
 	}
-
-	return 0;
 }
 #else
-#define hdmi_codec_resume NULL
+#define hdmi_codec_complete NULL
 #endif
 
 static struct snd_soc_codec_driver hdmi_hda_codec = {
 	.probe		= hdmi_codec_probe,
 	.remove		= hdmi_codec_remove,
-	.resume		= hdmi_codec_resume,
 	.idle_bias_off	= true,
 };
 
@@ -1629,6 +1625,7 @@ static int hdac_hdmi_runtime_resume(struct device *dev)
 
 static const struct dev_pm_ops hdac_hdmi_pm = {
 	SET_RUNTIME_PM_OPS(hdac_hdmi_runtime_suspend, hdac_hdmi_runtime_resume, NULL)
+	.complete = hdmi_codec_complete,
 };
 
 static const struct hda_device_id hdmi_list[] = {
-- 
1.9.1

  reply	other threads:[~2016-04-01  8:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01  8:06 [PATCH 0/3] ASoC: hdac_hdmi: Fix codec power state in S3 Subhransu S. Prusty
2016-04-01  8:06 ` Subhransu S. Prusty [this message]
2016-04-02 16:39   ` Applied "ASoC: hdac_hdmi: Fix to use dev_pm ops instead soc pm" to the asoc tree Mark Brown
2016-04-01  8:06 ` [PATCH 2/3] ASoC: hdac_hdmi: Fix codec power state in S3 during playback Subhransu S. Prusty
2016-04-02 16:39   ` Applied "ASoC: hdac_hdmi: Fix codec power state in S3 during playback" to the asoc tree Mark Brown
2016-04-01  8:06 ` [PATCH 3/3] ASoC: Intel: Skylake: Fix to turn OFF codec power when entering S3 Subhransu S. Prusty
2016-04-02 16:39   ` Applied "ASoC: Intel: Skylake: Fix to turn OFF codec power when entering S3" to the asoc tree Mark Brown

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=1459497987-28979-2-git-send-email-subhransu.s.prusty@intel.com \
    --to=subhransu.s.prusty@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches.audio@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.