Blob Blame History Raw
From c07fa3fcbd28b6d8383a05f0570d472894c6e38f Mon Sep 17 00:00:00 2001
From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Date: Wed, 26 Aug 2020 11:45:28 -0700
Subject: [PATCH] ASoC: SOF: Intel: hda: modify the signature of get_stream_with_tag()
References: jsc#SLE-16518
Patch-mainline: v5.10-rc1
Git-commit: c07fa3fcbd28b6d8383a05f0570d472894c6e38f

Modify the signature of get_stream_with_tag() to add the direction
as an argument to extend it for using with capture streams.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 sound/soc/sof/intel/hda-loader.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c
index 914699f550b1..804f5f64aa33 100644
--- a/sound/soc/sof/intel/hda-loader.c
+++ b/sound/soc/sof/intel/hda-loader.c
@@ -205,18 +205,15 @@ static int cl_trigger(struct snd_sof_dev *sdev,
 }
 
 static struct hdac_ext_stream *get_stream_with_tag(struct snd_sof_dev *sdev,
-						   int tag)
+						   int tag, int direction)
 {
 	struct hdac_bus *bus = sof_to_bus(sdev);
 	struct hdac_stream *s;
 
 	/* get stream with tag */
-	list_for_each_entry(s, &bus->stream_list, list) {
-		if (s->direction == SNDRV_PCM_STREAM_PLAYBACK &&
-		    s->stream_tag == tag) {
+	list_for_each_entry(s, &bus->stream_list, list)
+		if (s->direction == direction && s->stream_tag == tag)
 			return stream_to_hdac_ext_stream(s);
-		}
-	}
 
 	return NULL;
 }
@@ -322,7 +319,7 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
 	}
 
 	/* get stream with tag */
-	stream = get_stream_with_tag(sdev, tag);
+	stream = get_stream_with_tag(sdev, tag, SNDRV_PCM_STREAM_PLAYBACK);
 	if (!stream) {
 		dev_err(sdev->dev,
 			"error: could not get stream with stream tag %d\n",
-- 
2.16.4