public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: perex@perex.cz, tiwai@suse.de, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com, Nikesh.Oswal@cirrus.com
Subject: [PATCH] ASoC: make dapm cache search depth configurable
Date: Tue,  8 Sep 2015 11:11:37 +0100	[thread overview]
Message-ID: <1441707097-11200-1-git-send-email-nikesh@opensource.wolfsonmicro.com> (raw)

cache search depth will have a default value of 2 and can
be modified by the respective component probe function

Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
---
 include/sound/soc-dapm.h |    1 +
 sound/soc/soc-core.c     |    2 ++
 sound/soc/soc-dapm.c     |    5 +++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 5abba03..15717b4 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -629,6 +629,7 @@ struct snd_soc_dapm_context {
 
 	struct snd_soc_dapm_wcache path_sink_cache;
 	struct snd_soc_dapm_wcache path_source_cache;
+	unsigned int cache_search_depth;
 
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *debugfs_dapm;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6173d15..1802883 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1595,6 +1595,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 	card->dapm.bias_level = SND_SOC_BIAS_OFF;
 	card->dapm.dev = card->dev;
 	card->dapm.card = card;
+	card->dapm.cache_search_depth = 2;
 	list_add(&card->dapm.list, &card->dapm_list);
 
 #ifdef CONFIG_DEBUG_FS
@@ -2665,6 +2666,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	component->remove = component->driver->remove;
 
 	dapm = &component->dapm;
+	dapm->cache_search_depth = 2;
 	dapm->dev = dev;
 	dapm->component = component;
 	dapm->bias_level = SND_SOC_BIAS_OFF;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f4bf21a..36ab9cb 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -580,11 +580,12 @@ dapm_wcache_lookup(struct snd_soc_dapm_wcache *wcache, const char *name)
 {
 	struct snd_soc_dapm_widget *w = wcache->widget;
 	struct list_head *wlist;
-	const int depth = 2;
+	int depth;
 	int i = 0;
 
-	if (w) {
+	if (w && w->dapm->cache_search_depth) {
 		wlist = &w->dapm->card->widgets;
+		depth = w->dapm->cache_search_depth;
 
 		list_for_each_entry_from(w, wlist, list) {
 			if (!strcmp(name, w->name))
-- 
1.7.9.5


             reply	other threads:[~2015-09-08 10:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08 10:11 Nikesh Oswal [this message]
2015-09-08 10:42 ` [PATCH] ASoC: make dapm cache search depth configurable Mark Brown
2015-09-10  9:42   ` Nikesh
2015-09-10 10:31     ` 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=1441707097-11200-1-git-send-email-nikesh@opensource.wolfsonmicro.com \
    --to=nikesh@opensource.wolfsonmicro.com \
    --cc=Nikesh.Oswal@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=perex@perex.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox