All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH v2 6/7] ASoC: Intel: Add runtime module lookup API call
Date: Tue, 28 Oct 2014 17:37:17 +0000	[thread overview]
Message-ID: <1414517838-16210-6-git-send-email-liam.r.girdwood@linux.intel.com> (raw)
In-Reply-To: <1414517838-16210-1-git-send-email-liam.r.girdwood@linux.intel.com>

Add an API to allow quick lookup of runtime modules based on ID.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 sound/soc/intel/sst-firmware.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index b27d385..692a6ae 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -1158,6 +1158,26 @@ struct sst_module *sst_module_get_from_id(struct sst_dsp *dsp, u32 id)
 }
 EXPORT_SYMBOL_GPL(sst_module_get_from_id);
 
+struct sst_module_runtime *sst_module_runtime_get_from_id(
+	struct sst_module *module, u32 id)
+{
+	struct sst_module_runtime *runtime;
+	struct sst_dsp *dsp = module->dsp;
+
+	mutex_lock(&dsp->mutex);
+
+	list_for_each_entry(runtime, &module->runtime_list, list) {
+		if (runtime->id == id) {
+			mutex_unlock(&dsp->mutex);
+			return runtime;
+		}
+	}
+
+	mutex_unlock(&dsp->mutex);
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(sst_module_runtime_get_from_id);
+
 /* returns block address in DSP address space */
 u32 sst_dsp_get_offset(struct sst_dsp *dsp, u32 offset,
 	enum sst_mem_type type)
-- 
1.9.1

  parent reply	other threads:[~2014-10-28 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 17:37 [PATCH v2 1/7] ASoC: Intel: Make ADSP memory block allocation more generic Liam Girdwood
2014-10-28 17:37 ` [PATCH v2 2/7] ASoC: Intel: update scratch allocator to use generic block allocator Liam Girdwood
2014-10-28 17:37 ` [PATCH v2 3/7] ASoC: Intel: Add call to calculate offsets internally within the DSP Liam Girdwood
2014-10-28 17:37 ` [PATCH v2 4/7] ASoC: Intel: Add runtime module support Liam Girdwood
2014-10-28 17:37 ` [PATCH v2 5/7] ASoC: Intel: Add DMA firmware loading support Liam Girdwood
2014-10-28 17:37 ` Liam Girdwood [this message]
2014-10-28 17:37 ` [PATCH v2 7/7] ASoC: Intel: Provide streams with dynamic module information Liam Girdwood

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=1414517838-16210-6-git-send-email-liam.r.girdwood@linux.intel.com \
    --to=liam.r.girdwood@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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.