All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Rander Wang <rander.wang@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 19/21] ASoC: SOF: Intel: hda: fix stream id setting
Date: Mon, 22 Jul 2019 09:14:00 -0500	[thread overview]
Message-ID: <20190722141402.7194-20-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20190722141402.7194-1-pierre-louis.bossart@linux.intel.com>

From: Rander Wang <rander.wang@linux.intel.com>

snd_hdac_ext_link_clear_stream_id maps stream id to
link output, which is for playback, not capture.

Tested on Whiskey Lake platform.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/intel/hda-dai.c | 15 +++++++++++----
 sound/soc/sof/intel/hda-dsp.c |  8 +++++++-
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
index 2b5e2b8c69c2..8796f385be76 100644
--- a/sound/soc/sof/intel/hda-dai.c
+++ b/sound/soc/sof/intel/hda-dai.c
@@ -327,8 +327,12 @@ static int hda_link_pcm_trigger(struct snd_pcm_substream *substream,
 					  DMA_CHAN_INVALID, substream->stream);
 		if (ret < 0)
 			return ret;
-		stream_tag = hdac_stream(link_dev)->stream_tag;
-		snd_hdac_ext_link_clear_stream_id(link, stream_tag);
+
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+			stream_tag = hdac_stream(link_dev)->stream_tag;
+			snd_hdac_ext_link_clear_stream_id(link, stream_tag);
+		}
+
 		link_dev->link_prepared = 0;
 
 		/* fallthrough */
@@ -369,8 +373,11 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream,
 	if (!link)
 		return -EINVAL;
 
-	stream_tag = hdac_stream(link_dev)->stream_tag;
-	snd_hdac_ext_link_clear_stream_id(link, stream_tag);
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+		stream_tag = hdac_stream(link_dev)->stream_tag;
+		snd_hdac_ext_link_clear_stream_id(link, stream_tag);
+	}
+
 	snd_soc_dai_set_dma_data(dai, substream, NULL);
 	snd_hdac_ext_stream_release(link_dev, HDAC_EXT_STREAM_TYPE_LINK);
 	link_dev->link_prepared = 0;
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index e38008194574..fb55a3c5afd0 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -450,9 +450,15 @@ int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev)
 			link = snd_hdac_ext_bus_get_link(bus, name);
 			if (!link)
 				return -EINVAL;
+
+			stream->link_prepared = 0;
+
+			if (hdac_stream(stream)->direction ==
+				SNDRV_PCM_STREAM_CAPTURE)
+				continue;
+
 			stream_tag = hdac_stream(stream)->stream_tag;
 			snd_hdac_ext_link_clear_stream_id(link, stream_tag);
-			stream->link_prepared = 0;
 		}
 	}
 #endif
-- 
2.20.1

  parent reply	other threads:[~2019-07-22 14:14 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 14:13 [PATCH 00/21] ASoC: SOF: updates for 5.4 Pierre-Louis Bossart
2019-07-22 14:13 ` [PATCH 01/21] ASoC: SOF: pci: mark last_busy value at runtime PM init Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: pci: mark last_busy value at runtime PM init" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 02/21] ASoC: SOF: reset DMA state in prepare Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: reset DMA state in prepare" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 03/21] ASoC: SOF: use common code to send PCM_FREE IPC Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: use common code to send PCM_FREE IPC" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 04/21] ASoC: SOF: ipc: use timeout configured at probe Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: ipc: use timeout configured at probe" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 05/21] ASoC: SOF: core: increase default IPC timeouts Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: core: increase default IPC timeouts" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 06/21] ASoC: SOF: Introduce snd_sof_dsp_get_bar_index ops Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Introduce snd_sof_dsp_get_bar_index ops" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 07/21] ASoC: SOF: loader: Use the BAR provided by FW Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: loader: Use the BAR provided by FW" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 08/21] ASoC: SOF: loader: Don't ignore SRAM block types Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: loader: Don't ignore SRAM block types" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 09/21] ASoC: SOF: remove unused state variable in suspend function Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: remove unused state variable in suspend function" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 10/21] ASoC: SOF: Intel: hda: correct ROM state mask Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: correct ROM state mask" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 11/21] ASoC: SOF: Intel: hda: reduce ifdef usage for hda Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: reduce ifdef usage for hda" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 12/21] ASoC: SOF: Intel: hda: Enable jack detection Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: Enable jack detection" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 13/21] ASoC: SOF: Intel: hda: set position buffer in init chip Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: set position buffer in init chip" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 14/21] ASoC: SOF: Intel: hda: use SOF defined init chip in resume Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: use SOF defined init chip in resume" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 15/21] ASoC: SOF: Intel: hda: remove duplicated clear WAKESTS Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: remove duplicated clear WAKESTS" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 16/21] ASoC: SOF: Intel: hda: add a parameter to disable MSI Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: add a parameter to disable MSI" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 17/21] ASoC: SOF: Intel: hda: reset link DMA state in prepare Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: reset link DMA state in prepare" to the asoc tree Mark Brown
2019-07-22 14:13 ` [PATCH 18/21] ASoC: SOF: Intel: hda: fix link DMA config Pierre-Louis Bossart
2019-07-23 11:15   ` Mark Brown
2019-07-23 14:37     ` Pierre-Louis Bossart
2019-07-23 16:30       ` Mark Brown
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: fix link DMA config" to the asoc tree Mark Brown
2019-07-22 14:14 ` Pierre-Louis Bossart [this message]
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: fix stream id setting" " Mark Brown
2019-07-22 14:14 ` [PATCH 20/21] ASoC: SOF: Intel: hda: remove misleading error trace from IRQ thread Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: hda: remove misleading error trace from IRQ thread" to the asoc tree Mark Brown
2019-07-22 14:14 ` [PATCH 21/21] ASoC: SOF: Intel: ssp: BCLK delay parameter Pierre-Louis Bossart
2019-07-23 11:29   ` Applied "ASoC: SOF: Intel: ssp: BCLK delay parameter" 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=20190722141402.7194-20-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=rander.wang@linux.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 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.