summaryrefslogtreecommitdiffstats
path: root/sound/hda
diff options
context:
space:
mode:
authorJeeja KP <jeeja.kp@intel.com>2015-08-23 02:22:51 -0400
committerTakashi Iwai <tiwai@suse.de>2015-08-23 03:43:27 -0400
commit4308c9b083fbab1a442e68a03de099841791df27 (patch)
tree664c2721d627828f15465b4092c39314aef6d237 /sound/hda
parent54d1d2f5f0886f7c31512c83a6ed87bbcd0d2b3a (diff)
ALSA: hdac: Add snd_hdac_get_hdac_stream()
Add a helper to find the stream using stream tag and direction. This is useful for drivers to query stream based on stream tag and direction, fox example while downloading FW thru DSP loader code Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/hdac_stream.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 4c15d0accc9e..8981159813ef 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -286,6 +286,28 @@ void snd_hdac_stream_release(struct hdac_stream *azx_dev)
286} 286}
287EXPORT_SYMBOL_GPL(snd_hdac_stream_release); 287EXPORT_SYMBOL_GPL(snd_hdac_stream_release);
288 288
289/**
290 * snd_hdac_get_stream - return hdac_stream based on stream_tag and
291 * direction
292 *
293 * @bus: HD-audio core bus
294 * @dir: direction for the stream to be found
295 * @stream_tag: stream tag for stream to be found
296 */
297struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus,
298 int dir, int stream_tag)
299{
300 struct hdac_stream *s;
301
302 list_for_each_entry(s, &bus->stream_list, list) {
303 if (s->direction == dir && s->stream_tag == stream_tag)
304 return s;
305 }
306
307 return NULL;
308}
309EXPORT_SYMBOL_GPL(snd_hdac_get_stream);
310
289/* 311/*
290 * set up a BDL entry 312 * set up a BDL entry
291 */ 313 */