Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jeeja KP <jeeja.kp@intel.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.de,
	patches.audio@intel.com, broonie@kernel.org,
	liam.r.girdwood@intel.com,
	Sachin Mokashi <sachinx.mokashi@intel.com>
Subject: Applied "ASoC: hdac_hdmi: Enable pin and converter in prepare" to the asoc tree
Date: Thu, 19 Jan 2017 18:03:47 +0000	[thread overview]
Message-ID: <E1cUH3r-0004w0-4R@debutante> (raw)
In-Reply-To: <1483341277-14475-10-git-send-email-jeeja.kp@intel.com>

The patch

   ASoC: hdac_hdmi: Enable pin and converter in prepare

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 1de777fed54dfa93e166a3c934c5846920b86f0c Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Tue, 10 Jan 2017 17:57:48 +0530
Subject: [PATCH] ASoC: hdac_hdmi: Enable pin and converter in prepare

Instead of enabling pin and cvt in pcm_open(), need to restore pin and
cvt state after system resume to restart the playback which is
paused/stopped before system suspend.
So enable pin and cvt in playback_prepare and call prepare when trigger
cmd is paused/started and resume to reconfigure pin and cvt.

Signed-off-by: Sachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/hdac_hdmi.c | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index c602c4960924..1da4405ee435 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -114,6 +114,12 @@ struct hdac_hdmi_priv {
 	struct hdac_chmap chmap;
 };
 
+static void hdac_hdmi_enable_cvt(struct hdac_ext_device *edev,
+			struct hdac_hdmi_dai_pin_map *dai_map);
+
+static int hdac_hdmi_enable_pin(struct hdac_ext_device *hdac,
+			struct hdac_hdmi_dai_pin_map *dai_map);
+
 static struct hdac_hdmi_pcm *get_hdmi_pcm_from_id(struct hdac_hdmi_priv *hdmi,
 						int pcm_idx)
 {
@@ -411,6 +417,10 @@ static int hdac_hdmi_playback_prepare(struct snd_pcm_substream *substream,
 	dev_dbg(&hdac->hdac.dev, "stream tag from cpu dai %d format in cvt 0x%x\n",
 			dd->stream_tag,	dd->format);
 
+	hdac_hdmi_enable_cvt(hdac, dai_map);
+	ret = hdac_hdmi_enable_pin(hdac, dai_map);
+	if (ret < 0)
+		return ret;
 	mutex_lock(&pin->lock);
 	pin->channels = substream->runtime->channels;
 
@@ -464,12 +474,7 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
 static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream,
 		struct snd_soc_dai *dai)
 {
-	struct hdac_ext_device *edev = snd_soc_dai_get_drvdata(dai);
 	struct hdac_ext_dma_params *dd;
-	struct hdac_hdmi_priv *hdmi = edev->private_data;
-	struct hdac_hdmi_dai_pin_map *dai_map;
-
-	dai_map = &hdmi->dai_map[dai->id];
 
 	dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data(dai, substream);
 
@@ -622,11 +627,6 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream,
 
 	dai_map->pin = pin;
 
-	hdac_hdmi_enable_cvt(hdac, dai_map);
-	ret = hdac_hdmi_enable_pin(hdac, dai_map);
-	if (ret < 0)
-		return ret;
-
 	ret = hdac_hdmi_eld_limit_formats(substream->runtime,
 				pin->eld.eld_buffer);
 	if (ret < 0)
@@ -639,18 +639,15 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream,
 static int hdac_hdmi_trigger(struct snd_pcm_substream *substream, int cmd,
 		struct snd_soc_dai *dai)
 {
-	struct hdac_hdmi_dai_pin_map *dai_map;
-	struct hdac_ext_device *hdac = snd_soc_dai_get_drvdata(dai);
-	struct hdac_hdmi_priv *hdmi = hdac->private_data;
-	int ret;
-
-	dai_map = &hdmi->dai_map[dai->id];
-	if (cmd == SNDRV_PCM_TRIGGER_RESUME) {
-		ret = hdac_hdmi_enable_pin(hdac, dai_map);
-		if (ret < 0)
-			return ret;
 
+	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_RESUME:
+	case SNDRV_PCM_TRIGGER_START:
+	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		return hdac_hdmi_playback_prepare(substream, dai);
+
+	default:
+		return 0;
 	}
 
 	return 0;
-- 
2.11.0

  reply	other threads:[~2017-01-19 18:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02  7:14 [PATCH v4 0/9] ASoC: Intel: Skylake: Driver updates jeeja.kp
2017-01-02  7:14 ` [PATCH v4 1/9] ALSA: hda: check stream decoupled register state jeeja.kp
2017-01-02  7:14 ` [PATCH v4 2/9] ASoC: Intel: Skylake: Add set_tristate DAI ops to enable SSP MCLK jeeja.kp
2017-01-06 18:32   ` Mark Brown
2017-01-10  9:31     ` Jeeja KP
2017-01-02  7:14 ` [PATCH v4 3/9] ASoC: Intel: Skylake: Remove unused SSP BE prepare DAI ops jeeja.kp
2017-01-02  7:14 ` [PATCH v4 4/9] ASoC: Intel: Skylake: Add supply widget as non DSP widget jeeja.kp
2017-01-02  7:14 ` [PATCH v4 5/9] ASoC: Intel: Skylake: Add supply widget in skl_nau_max machine jeeja.kp
2017-01-02  7:14 ` [PATCH v4 6/9] ASoC: Intel: Skylake: Add supply widget in bxt_da_max machine jeeja.kp
2017-01-06 18:34   ` Mark Brown
2017-01-02  7:14 ` [PATCH v4 7/9] ASoC: Intel: Skylake: Don't reset pass-through pipe in BE prepare jeeja.kp
2017-01-02  7:14 ` [PATCH v4 8/9] ASoC: Intel: Skylake: set the resume point to LPIB jeeja.kp
2017-01-02  7:14 ` [PATCH v4 9/9] ASoC: hdac_hdmi: Enable pin and converter in prepare jeeja.kp
2017-01-19 18:03   ` Mark Brown [this message]
2017-01-02 10:01 ` [PATCH v4 0/9] ASoC: Intel: Skylake: Driver updates Vinod Koul

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=E1cUH3r-0004w0-4R@debutante \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=patches.audio@intel.com \
    --cc=sachinx.mokashi@intel.com \
    --cc=tiwai@suse.de \
    /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