From patchwork Tue Sep 8 10:11:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: nikesh@opensource.wolfsonmicro.com X-Patchwork-Id: 7139721 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D5C2BEEC1 for ; Tue, 8 Sep 2015 10:12:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92D09206F5 for ; Tue, 8 Sep 2015 10:12:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 66C85206F4 for ; Tue, 8 Sep 2015 10:12:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0DE2A265026; Tue, 8 Sep 2015 12:12:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C46CC26066A; Tue, 8 Sep 2015 12:11:56 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EA822264FF9; Tue, 8 Sep 2015 12:11:54 +0200 (CEST) Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id C46FE260666 for ; Tue, 8 Sep 2015 12:11:47 +0200 (CEST) Received: from nikesh-Latitude-E6410.wolfsonmicro.main (axios.lumison.net [212.20.245.98]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id 5249A3B40FE; Tue, 8 Sep 2015 11:11:46 +0100 (BST) From: Nikesh Oswal To: broonie@kernel.org, lgirdwood@gmail.com Date: Tue, 8 Sep 2015 11:11:37 +0100 Message-Id: <1441707097-11200-1-git-send-email-nikesh@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.9.5 Cc: alsa-devel@alsa-project.org, tiwai@suse.de, patches@opensource.wolfsonmicro.com, Nikesh.Oswal@cirrus.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: make dapm cache search depth configurable X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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))