From patchwork Thu Oct 22 17:52:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 7466401 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 58EC89F302 for ; Thu, 22 Oct 2015 17:53:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7311620860 for ; Thu, 22 Oct 2015 17:53:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 32D0720858 for ; Thu, 22 Oct 2015 17:53:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 17D2C26680B; Thu, 22 Oct 2015 19:53:49 +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, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 77A6D260545; Thu, 22 Oct 2015 19:53:20 +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 A6C6C260545; Thu, 22 Oct 2015 19:53:18 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by alsa0.perex.cz (Postfix) with ESMTP id A7C64260545 for ; Thu, 22 Oct 2015 19:53:14 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 22 Oct 2015 10:49:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,183,1444719600"; d="scan'208";a="833194763" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.34]) by fmsmga002.fm.intel.com with ESMTP; 22 Oct 2015 10:49:36 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 22 Oct 2015 23:22:37 +0530 Message-Id: <1445536362-26670-5-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445536362-26670-1-git-send-email-vinod.koul@intel.com> References: <1445536362-26670-1-git-send-email-vinod.koul@intel.com> Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com, patches.audio@intel.com, broonie@kernel.org, Jeeja KP , Vinod Koul , "Subhransu S. Prusty" Subject: [alsa-devel] [PATCH 4/9] ASoC: Intel: Skylake: Fix to fill all sink/source pipe params 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 From: "Subhransu S. Prusty" Currently params only for first copier widget identified in the source/sink path is queried from NHLT. In the dapm route the playback/capture widget may be connected to more than one copier widget. This patch adds return check to return only for any error case. Signed-off-by: Subhransu S. Prusty Signed-off-by: Jeeja KP Signed-off-by: Vinod Koul --- sound/soc/intel/skylake/skl-topology.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 0fba39dcb2ab..68e1b00ce7ed 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -944,48 +944,60 @@ static int skl_tplg_be_set_src_pipe_params(struct snd_soc_dai *dai, struct skl_pipe_params *params) { struct snd_soc_dapm_path *p; + int ret = -EIO; snd_soc_dapm_widget_for_each_source_path(w, p) { if (p->connect && is_skl_dsp_widget_type(p->source) && p->source->priv) { - if (!p->source->power) - return skl_tplg_be_fill_pipe_params( + if (!p->source->power) { + ret = skl_tplg_be_fill_pipe_params( dai, p->source->priv, params); - else + if (ret < 0) + return ret; + } else { return -EBUSY; + } } else { - return skl_tplg_be_set_src_pipe_params( + ret = skl_tplg_be_set_src_pipe_params( dai, p->source, params); + if (ret < 0) + return ret; } } - return -EIO; + return ret; } static int skl_tplg_be_set_sink_pipe_params(struct snd_soc_dai *dai, struct snd_soc_dapm_widget *w, struct skl_pipe_params *params) { struct snd_soc_dapm_path *p = NULL; + int ret = -EIO; snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connect && is_skl_dsp_widget_type(p->sink) && p->sink->priv) { - if (!p->sink->power) - return skl_tplg_be_fill_pipe_params( + if (!p->sink->power) { + ret = skl_tplg_be_fill_pipe_params( dai, p->sink->priv, params); - else + if (ret < 0) + return ret; + } else { return -EBUSY; + } } else { - return skl_tplg_be_set_sink_pipe_params( + ret = skl_tplg_be_set_sink_pipe_params( dai, p->sink, params); + if (ret < 0) + return ret; } } - return -EIO; + return ret; } /*