From patchwork Tue Apr 13 23:19:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12201581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C05C433B4 for ; Tue, 13 Apr 2021 23:21:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6599461242 for ; Tue, 13 Apr 2021 23:21:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6599461242 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9F90116BB; Wed, 14 Apr 2021 01:20:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F90116BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618356081; bh=vYv9G7Mzo+vry5ms01RH4M90lEYPUtQeN+5MbYO1y60=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PQl+bKvEWUPbvhzC+HIeCpy1mHvv30zEYJGyRYbZQjV58c5F1AG7X5Skab172Kk+b hKnOw9kpM/kChOR4MRtdbnoVo4leKlkBqUnLOPyJILp9QSvg2fwC2zoYtMGVaFN/2I t5VD0Tgm3tw0eEBEyueEuvDj4qoLaTKZg46Xh3ao= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7D4B2F8023A; Wed, 14 Apr 2021 01:20:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1BF2DF80254; Wed, 14 Apr 2021 01:20:04 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 2A5D4F800EB for ; Wed, 14 Apr 2021 01:19:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2A5D4F800EB Date: 14 Apr 2021 08:19:55 +0900 X-IronPort-AV: E=Sophos;i="5.82,220,1613401200"; d="scan'208";a="78207863" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 14 Apr 2021 08:19:55 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id E72B54006DE9; Wed, 14 Apr 2021 08:19:55 +0900 (JST) Message-ID: <87pmyxzs9w.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/5] ASoC: simple-card: remove unused variable from simple_parse_of() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> References: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto commit d9ffff696c5b4 ("ASoC: simple-card: Use snd_soc_of_parse_aux_devs()") switched to use snd_soc_of_parse_aux_devs() on simple_parse_of(). Thus noone is using *top anymore. Let's cleanup unused variable. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index bf5ddf1ea65f..7a87cd56d513 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -441,15 +441,10 @@ static int simple_for_each_link(struct asoc_simple_priv *priv, static int simple_parse_of(struct asoc_simple_priv *priv) { - struct device *dev = simple_priv_to_dev(priv); - struct device_node *top = dev->of_node; struct snd_soc_card *card = simple_priv_to_card(priv); struct link_info li; int ret; - if (!top) - return -EINVAL; - ret = asoc_simple_parse_widgets(card, PREFIX); if (ret < 0) return ret; From patchwork Tue Apr 13 23:20:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12201583 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 296B4C433ED for ; Tue, 13 Apr 2021 23:21:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A292861244 for ; Tue, 13 Apr 2021 23:21:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A292861244 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 42EF116C6; Wed, 14 Apr 2021 01:20:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42EF116C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618356086; bh=9zOcwYs3n7dC7KCoJr7+asKivzuuXtD7yxDHs62HVMg=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VcJ7tbE0wtoPX6zR/N0hiNEUK3s4uOADzOKEeeHNFHnswDCJRI6NTw7/rpfG3v4LS LeBbGADlAVVlwEuv430pA8YTgpoCD/XPWOE/Bc5SQWaZMJMqtZQMRv9NYPFHNlbmjy S9fF70lgfW96tAWcTfQPXbR3St9AvMJPdstz3el4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 19462F8032B; Wed, 14 Apr 2021 01:20:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B64E7F8032C; Wed, 14 Apr 2021 01:20:09 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id DD4D4F80260 for ; Wed, 14 Apr 2021 01:20:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD4D4F80260 Date: 14 Apr 2021 08:20:04 +0900 X-IronPort-AV: E=Sophos;i="5.82,220,1613401200"; d="scan'208";a="77980991" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Apr 2021 08:20:04 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6B5E141139AA; Wed, 14 Apr 2021 08:20:04 +0900 (JST) Message-ID: <87o8ehzs9n.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/5] ASoC: simple-card: use asoc_link_to_xxx() macro User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> References: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto We shouldn't use dai_link->cpus/codecs/platforms directly, because these are array now to supporting multi CPU/Codec/Platform. This patch uses asoc_link_to_xxx() macro for it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 35 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 7a87cd56d513..9462b0d21486 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -122,9 +122,9 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct asoc_simple_dai *dai; - struct snd_soc_dai_link_component *cpus = dai_link->cpus; - struct snd_soc_dai_link_component *codecs = dai_link->codecs; - struct snd_soc_dai_link_component *platforms = dai_link->platforms; + struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); + struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); struct device_node *top = dev->of_node; struct device_node *node = of_get_parent(np); char *prefix = ""; @@ -149,11 +149,11 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai = dai_props->cpu_dai; - ret = asoc_simple_parse_dai(np, dai_link->cpus, &is_single_links); + ret = asoc_simple_parse_dai(np, cpus, &is_single_links); if (ret) goto out_put_node; - ret = asoc_simple_parse_clk(dev, np, dai, dai_link->cpus); + ret = asoc_simple_parse_clk(dev, np, dai, cpus); if (ret < 0) goto out_put_node; @@ -177,11 +177,11 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai = dai_props->codec_dai; cconf = dai_props->codec_conf; - ret = asoc_simple_parse_dai(np, dai_link->codecs, NULL); + ret = asoc_simple_parse_dai(np, codecs, NULL); if (ret < 0) goto out_put_node; - ret = asoc_simple_parse_clk(dev, np, dai, dai_link->codecs); + ret = asoc_simple_parse_clk(dev, np, dai, codecs); if (ret < 0) goto out_put_node; @@ -233,6 +233,9 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv, struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct asoc_simple_dai *cpu_dai = dai_props->cpu_dai; struct asoc_simple_dai *codec_dai = dai_props->codec_dai; + struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); + struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); struct device_node *top = dev->of_node; struct device_node *cpu = NULL; struct device_node *node = NULL; @@ -261,15 +264,15 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv, simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix); - ret = asoc_simple_parse_dai(cpu, dai_link->cpus, &single_cpu); + ret = asoc_simple_parse_dai(cpu, cpus, &single_cpu); if (ret < 0) goto dai_link_of_err; - ret = asoc_simple_parse_dai(codec, dai_link->codecs, NULL); + ret = asoc_simple_parse_dai(codec, codecs, NULL); if (ret < 0) goto dai_link_of_err; - ret = asoc_simple_parse_dai(plat, dai_link->platforms, NULL); + ret = asoc_simple_parse_dai(plat, platforms, NULL); if (ret < 0) goto dai_link_of_err; @@ -281,26 +284,26 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv, if (ret < 0) goto dai_link_of_err; - ret = asoc_simple_parse_clk(dev, cpu, cpu_dai, dai_link->cpus); + ret = asoc_simple_parse_clk(dev, cpu, cpu_dai, cpus); if (ret < 0) goto dai_link_of_err; - ret = asoc_simple_parse_clk(dev, codec, codec_dai, dai_link->codecs); + ret = asoc_simple_parse_clk(dev, codec, codec_dai, codecs); if (ret < 0) goto dai_link_of_err; ret = asoc_simple_set_dailink_name(dev, dai_link, "%s-%s", - dai_link->cpus->dai_name, - dai_link->codecs->dai_name); + cpus->dai_name, + codecs->dai_name); if (ret < 0) goto dai_link_of_err; dai_link->ops = &simple_ops; dai_link->init = asoc_simple_dai_init; - asoc_simple_canonicalize_cpu(dai_link->cpus, single_cpu); - asoc_simple_canonicalize_platform(dai_link->platforms, dai_link->cpus); + asoc_simple_canonicalize_cpu(cpus, single_cpu); + asoc_simple_canonicalize_platform(platforms, cpus); dai_link_of_err: of_node_put(plat); From patchwork Tue Apr 13 23:20:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12201585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C985C433ED for ; Tue, 13 Apr 2021 23:22:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8A4A61249 for ; Tue, 13 Apr 2021 23:22:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8A4A61249 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 169C916B4; Wed, 14 Apr 2021 01:21:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 169C916B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618356122; bh=96pkErL2P+hjLHTIDr7tzFLkTEEB6jEYY/ctVfRZ9os=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pi8LxiNYxilJiUe6PjadfdwcPdt5yH2MoeUGdHqMZMDVlycIPvoPbCz+LTkp5/7U8 JtbIy4t2V8ejf4agrjwlJfzMSSNL0FEWAXt7sEY3Wa3dlYECTxcDUGT3WNZxbC2z9V BlP6Zg/yRtpJY8kISj9wAsHlBn/zRVG/sONooqJI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D790EF80424; Wed, 14 Apr 2021 01:20:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 62803F80425; Wed, 14 Apr 2021 01:20:14 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 80D4BF8025C for ; Wed, 14 Apr 2021 01:20:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 80D4BF8025C Date: 14 Apr 2021 08:20:10 +0900 X-IronPort-AV: E=Sophos;i="5.82,220,1613401200"; d="scan'208";a="78207908" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 14 Apr 2021 08:20:10 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 04E9D4006DE9; Wed, 14 Apr 2021 08:20:10 +0900 (JST) Message-ID: <87mtu1zs9i.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/5] ASoC: simple-card: use simple_props_to_xxx() macro User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> References: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto We shouldn't use dai_props->cpus/codecs directly, because these are array now to supporting multi CPU/Codec/Platform. This patch uses simple_props_to_xxx() macro for it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 9462b0d21486..5a686f82d1b4 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -147,7 +147,7 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai_link->dynamic = 1; dai_link->dpcm_merged_format = 1; - dai = dai_props->cpu_dai; + dai = simple_props_to_dai_cpu(dai_props, 0); ret = asoc_simple_parse_dai(np, cpus, &is_single_links); if (ret) @@ -174,8 +174,8 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai_link->no_pcm = 1; dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup; - dai = dai_props->codec_dai; - cconf = dai_props->codec_conf; + dai = simple_props_to_dai_codec(dai_props, 0); + cconf = simple_props_to_codec_conf(dai_props, 0); ret = asoc_simple_parse_dai(np, codecs, NULL); if (ret < 0) @@ -231,8 +231,8 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv, struct device *dev = simple_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); - struct asoc_simple_dai *cpu_dai = dai_props->cpu_dai; - struct asoc_simple_dai *codec_dai = dai_props->codec_dai; + struct asoc_simple_dai *cpu_dai = simple_props_to_dai_cpu(dai_props, 0); + struct asoc_simple_dai *codec_dai = simple_props_to_dai_codec(dai_props, 0); struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); From patchwork Tue Apr 13 23:20:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12201587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8441CC433B4 for ; Tue, 13 Apr 2021 23:22:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7FFE61246 for ; Tue, 13 Apr 2021 23:22:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7FFE61246 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3CC3816C3; Wed, 14 Apr 2021 01:21:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3CC3816C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618356155; bh=en6ESl5CoV5+CCsvaokJnEbDmzfMvao0gLa0OsB4mFs=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mQ63Kglu8xEgITLutaQNO1sNHGaUt8qtxf52YTx9S2eEyN03QpqfwHrRMkwztL/CR cKfraXw5j3mOD1NpLML8zR9dzSyGuoVOJzQQXBu4UQVQYTw+nBB/SCBKV6cOH/PkXt ur9pQITM75IcTOkQMLBmy2eqDafKw4pRPq6Z4yI4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1E2DFF804AB; Wed, 14 Apr 2021 01:20:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D5707F804AC; Wed, 14 Apr 2021 01:20:19 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id C6F10F80425 for ; Wed, 14 Apr 2021 01:20:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C6F10F80425 Date: 14 Apr 2021 08:20:15 +0900 X-IronPort-AV: E=Sophos;i="5.82,220,1613401200"; d="scan'208";a="77981013" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Apr 2021 08:20:15 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 883E04113AC1; Wed, 14 Apr 2021 08:20:15 +0900 (JST) Message-ID: <87lf9lzs9c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/5] ASoC: audio-graph: use asoc_link_to_xxx() macro User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> References: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto We shouldn't use dai_link->cpus/codecs/platforms directly, because these are array now to supporting multi CPU/Codec/Platform. This patch uses asoc_link_to_xxx() macro for it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 33 +++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 0582fe296471..55384f1415b3 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -224,9 +224,9 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *ports; struct device_node *node; struct asoc_simple_dai *dai; - struct snd_soc_dai_link_component *cpus = dai_link->cpus; - struct snd_soc_dai_link_component *codecs = dai_link->codecs; - struct snd_soc_dai_link_component *platforms = dai_link->platforms; + struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); + struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); int ret; port = of_get_parent(ep); @@ -248,11 +248,11 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai = dai_props->cpu_dai; - ret = asoc_simple_parse_dai(ep, dai_link->cpus, &is_single_links); + ret = asoc_simple_parse_dai(ep, cpus, &is_single_links); if (ret) goto out_put_node; - ret = asoc_simple_parse_clk(dev, ep, dai, dai_link->cpus); + ret = asoc_simple_parse_clk(dev, ep, dai, cpus); if (ret < 0) goto out_put_node; @@ -291,11 +291,11 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai = dai_props->codec_dai; cconf = dai_props->codec_conf; - ret = asoc_simple_parse_dai(ep, dai_link->codecs, NULL); + ret = asoc_simple_parse_dai(ep, codecs, NULL); if (ret < 0) goto out_put_node; - ret = asoc_simple_parse_clk(dev, ep, dai, dai_link->codecs); + ret = asoc_simple_parse_clk(dev, ep, dai, codecs); if (ret < 0) goto out_put_node; @@ -357,6 +357,9 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, struct device_node *top = dev->of_node; struct asoc_simple_dai *cpu_dai = dai_props->cpu_dai; struct asoc_simple_dai *codec_dai = dai_props->codec_dai; + struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); + struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); int ret, single_cpu = 0; dev_dbg(dev, "link_of (%pOF)\n", cpu_ep); @@ -372,11 +375,11 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, if (ret < 0) return ret; - ret = asoc_simple_parse_dai(cpu_ep, dai_link->cpus, &single_cpu); + ret = asoc_simple_parse_dai(cpu_ep, cpus, &single_cpu); if (ret < 0) return ret; - ret = asoc_simple_parse_dai(codec_ep, dai_link->codecs, NULL); + ret = asoc_simple_parse_dai(codec_ep, codecs, NULL); if (ret < 0) return ret; @@ -388,26 +391,26 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, if (ret < 0) return ret; - ret = asoc_simple_parse_clk(dev, cpu_ep, cpu_dai, dai_link->cpus); + ret = asoc_simple_parse_clk(dev, cpu_ep, cpu_dai, cpus); if (ret < 0) return ret; - ret = asoc_simple_parse_clk(dev, codec_ep, codec_dai, dai_link->codecs); + ret = asoc_simple_parse_clk(dev, codec_ep, codec_dai, codecs); if (ret < 0) return ret; ret = asoc_simple_set_dailink_name(dev, dai_link, "%s-%s", - dai_link->cpus->dai_name, - dai_link->codecs->dai_name); + cpus->dai_name, + codecs->dai_name); if (ret < 0) return ret; dai_link->ops = &graph_ops; dai_link->init = asoc_simple_dai_init; - asoc_simple_canonicalize_cpu(dai_link->cpus, single_cpu); - asoc_simple_canonicalize_platform(dai_link->platforms, dai_link->cpus); + asoc_simple_canonicalize_cpu(cpus, single_cpu); + asoc_simple_canonicalize_platform(platforms, cpus); return 0; } From patchwork Tue Apr 13 23:20:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12201589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89FAAC433ED for ; Tue, 13 Apr 2021 23:22:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E05AA61242 for ; Tue, 13 Apr 2021 23:22:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E05AA61242 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 63AD016D3; Wed, 14 Apr 2021 01:22:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 63AD016D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618356172; bh=0LgLS8TSFc/GOwQzQ1aGDF0fPsyJj7QV8K7TuFwr4K4=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gHR4f4D5W8t9ITd7W14H0r+E3K9di34gLfnhg9ulZG9dpgRAoesb6VgHL7KNVeBNC gdn5Od6X22v+LdbhYS8gJP+qrk3Vj/pMRRyRbTlfRmZ+eJtg18n01Cm/Vmxpe2r9WO higKUYTjImj8E9AONksVVX7O6EYzAUXkm6Lnr1VQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A5828F804AF; Wed, 14 Apr 2021 01:20:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1FACF804B0; Wed, 14 Apr 2021 01:20:27 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 0C683F804AE for ; Wed, 14 Apr 2021 01:20:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C683F804AE Date: 14 Apr 2021 08:20:20 +0900 X-IronPort-AV: E=Sophos;i="5.82,220,1613401200"; d="scan'208";a="77981019" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Apr 2021 08:20:20 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 94D9A41139AA; Wed, 14 Apr 2021 08:20:20 +0900 (JST) Message-ID: <87k0p5zs97.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/5] ASoC: audio-graph: use simple_props_to_xxx() macro User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> References: <87r1jdzsaj.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto We shouldn't use dai_props->cpus/codecs directly, because these are array now to supporting multi CPU/Codec/Platform. This patch uses simple_props_to_xxx() macro for it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 55384f1415b3..36b2ad7dd283 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -246,7 +246,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai_link->dynamic = 1; dai_link->dpcm_merged_format = 1; - dai = dai_props->cpu_dai; + dai = simple_props_to_dai_cpu(dai_props, 0); ret = asoc_simple_parse_dai(ep, cpus, &is_single_links); if (ret) @@ -288,8 +288,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai_link->no_pcm = 1; dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup; - dai = dai_props->codec_dai; - cconf = dai_props->codec_conf; + dai = simple_props_to_dai_codec(dai_props, 0); + cconf = simple_props_to_codec_conf(dai_props, 0); ret = asoc_simple_parse_dai(ep, codecs, NULL); if (ret < 0) @@ -355,8 +355,8 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct device_node *top = dev->of_node; - struct asoc_simple_dai *cpu_dai = dai_props->cpu_dai; - struct asoc_simple_dai *codec_dai = dai_props->codec_dai; + struct asoc_simple_dai *cpu_dai = simple_props_to_dai_cpu(dai_props, 0); + struct asoc_simple_dai *codec_dai = simple_props_to_dai_codec(dai_props, 0); struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);