From patchwork Wed Aug 10 04:10:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 9272631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 06BB1600CB for ; Wed, 10 Aug 2016 04:04:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3ED024B5B for ; Wed, 10 Aug 2016 04:04:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D697A28066; Wed, 10 Aug 2016 04:04:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15C3224B5B for ; Wed, 10 Aug 2016 04:04:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CEA9F266D76; Wed, 10 Aug 2016 06:04:48 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 832682667BC; Wed, 10 Aug 2016 06:03:27 +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 718E9265ADE; Wed, 10 Aug 2016 06:03:25 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 3F117265A8C for ; Wed, 10 Aug 2016 06:03:17 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 09 Aug 2016 21:03:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,497,1464678000"; d="scan'208"; a="1032889106" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by orsmga002.jf.intel.com with ESMTP; 09 Aug 2016 21:03:12 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Wed, 10 Aug 2016 09:40:49 +0530 Message-Id: <1470802250-9232-3-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470802250-9232-1-git-send-email-vinod.koul@intel.com> References: <1470802250-9232-1-git-send-email-vinod.koul@intel.com> Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com, broonie@kernel.org, Vinod Koul Subject: [alsa-devel] [PATCH 2/3] ASoC: Intel: Skylake: Populate modules after loading 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 Once topology and firmware are loaded, we can parse the manifest. Use driver pipe and widget list to get list of all modules and populate the data. Signed-off-by: Vinod Koul --- sound/soc/intel/skylake/skl-pcm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 140249269cdb..eb1f00b28df1 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1138,6 +1138,32 @@ static int skl_pcm_new(struct snd_soc_pcm_runtime *rtd) return retval; } +static int skl_populate_modules(struct skl *skl) +{ + struct skl_pipeline *p; + struct skl_pipe_module *m; + struct snd_soc_dapm_widget *w; + struct skl_module_cfg *mconfig; + int ret; + + list_for_each_entry(p, &skl->ppl_list, node) { + list_for_each_entry(m, &p->pipe->w_list, node) { + + w = m->w; + mconfig = w->priv; + + ret = snd_skl_get_module_info(skl->skl_sst, mconfig); + if (ret < 0) { + dev_err(skl->skl_sst->dev, + "query module info failed:%d\n", ret); + goto err; + } + } + } +err: + return ret; +} + static int skl_platform_soc_probe(struct snd_soc_platform *platform) { struct hdac_ext_bus *ebus = dev_get_drvdata(platform->dev); @@ -1169,6 +1195,7 @@ static int skl_platform_soc_probe(struct snd_soc_platform *platform) dev_err(platform->dev, "Failed to boot first fw: %d\n", ret); return ret; } + skl_populate_modules(skl); } pm_runtime_mark_last_busy(platform->dev); pm_runtime_put_autosuspend(platform->dev);