All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, patches.audio@intel.com,
	liam.r.girdwood@linux.intel.com,
	Vinod Koul <vinod.koul@intel.com>,
	broonie@kernel.org, Jeeja KP <jeeja.kp@intel.com>
Subject: [PATCH 3/5] ALSA: hdac: Add snd_hdac_get_hdac_stream()
Date: Fri, 21 Aug 2015 21:36:19 +0530	[thread overview]
Message-ID: <1440173181-3150-4-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1440173181-3150-1-git-send-email-vinod.koul@intel.com>

From: Jeeja KP <jeeja.kp@intel.com>

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>
---
 include/sound/hdaudio.h |  2 ++
 sound/hda/hdac_stream.c | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index e37c3355ae8a..67f7068696b9 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -438,6 +438,8 @@ void snd_hdac_stream_init(struct hdac_bus *bus, struct hdac_stream *azx_dev,
 struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,
 					   struct snd_pcm_substream *substream);
 void snd_hdac_stream_release(struct hdac_stream *azx_dev);
+struct hdac_stream *snd_hdac_get_hdac_stream(struct hdac_bus *bus,
+						int dir, int stream_tag);
 
 int snd_hdac_stream_setup(struct hdac_stream *azx_dev);
 void snd_hdac_stream_cleanup(struct hdac_stream *azx_dev);
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 4c15d0accc9e..02aed2e85504 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -286,6 +286,25 @@ void snd_hdac_stream_release(struct hdac_stream *azx_dev)
 }
 EXPORT_SYMBOL_GPL(snd_hdac_stream_release);
 
+/**
+ * snd_hdac_get_hdac_stream - return hdac_stream based on stream_tag and
+ * direction
+ *
+ * @bus: HD-audio core bus
+ */
+struct hdac_stream *snd_hdac_get_hdac_stream(struct hdac_bus *bus,
+						int dir, int stream_tag)
+{
+	struct hdac_stream *s;
+
+	list_for_each_entry(s, &bus->stream_list, list) {
+		if (s->direction == dir && s->stream_tag == stream_tag)
+			return s;
+	}
+
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_get_hdac_stream);
 /*
  * set up a BDL entry
  */
-- 
1.9.1

  parent reply	other threads:[~2015-08-21 16:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 16:06 [PATCH 0/5] ALSA: hdac: More hdac core fixes and updates Vinod Koul
2015-08-21 16:06 ` [PATCH 1/5] ALSA: hdac: Fix to read the correct offset of spcap/link register Vinod Koul
2015-08-21 16:06 ` [PATCH 2/5] ALSA: hdac: Add snd_hdac_ext_bus_link_power_down_all() Vinod Koul
2015-08-21 16:06 ` Vinod Koul [this message]
2015-08-21 16:35   ` [PATCH 3/5] ALSA: hdac: Add snd_hdac_get_hdac_stream() Takashi Iwai
2015-08-23  5:45     ` Vinod Koul
2015-08-21 16:06 ` [PATCH 4/5] ALSA: hdac: Add support to enable SPIB for hdac ext stream Vinod Koul
2015-08-21 17:38   ` Pierre-Louis Bossart
2015-08-23  5:47     ` Vinod Koul
2015-08-21 16:06 ` [PATCH 5/5] ALSA: hdac: Remove the usage of key for host stream Vinod Koul
2015-08-21 17:30 ` [PATCH 0/5] ALSA: hdac: More hdac core fixes and updates Takashi Iwai

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=1440173181-3150-4-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@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.