From patchwork Fri May 13 09:05:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 12848522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D40CEC433EF for ; Fri, 13 May 2022 09:06:37 +0000 (UTC) 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 416F6181A; Fri, 13 May 2022 11:05:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 416F6181A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652432795; bh=5mA2q4jU7mOmTLqJJHgUX50CsuPQPdMJu+xw1pDiJi0=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=YIY9wNNFR9Ven0y5IJm0mYa8Q60yUijPBIMvbzXTUAquWbH+5f0YA92BS1WFNIUho 3kqjsEifzk+9gjIElAv99Jz6P28KBGeBGgQRTfEtFAuqbpdz7MZ6Q5VCbn/jULeoKK irErOzBNw0BGbWeSqILY7smDB5HfPofkCMkATqH8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D2C6BF80158; Fri, 13 May 2022 11:05:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 187F1F80236; Fri, 13 May 2022 11:05:43 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EF470F800E9 for ; Fri, 13 May 2022 11:05:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EF470F800E9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="dOlwMY6N" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24D4rtBE001348; Fri, 13 May 2022 04:05:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=RiMIVc2ewtJS4aq3sSmwjQ8n+IhMPQkFEiSytfsIKN4=; b=dOlwMY6Nbmu91SMYAwKniF78szKZouJNmpD5e2JyIonBH2IBYKSpbQmVybgA6AX0q1Dw QGgr+DrrxsaJxrZKnRnT3xHDMaPWuRQtfp4z+ZYOWOpQUWNOzjogq25zQZn7SjPPKqJf fps8sGuM2Hp+9R5hgWhLtsVepIm7V6v3bu2J9YiJ+OY95w9nZCUNGb9WIxxwhKJJ9S4U NftOItVdxYECAzD4VLE7JgjYlUzwxGWjOJsqtMg9IGWJIj35WEpqwjGUTYnK4Wn7upqZ ycYQiPKBS9ry6z0TVbDbcpr63cgXCbsjKRfVbkNd9cEmKoKFTrXA+EP10cNMvp0J8ylV AA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3fwn6p0m79-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 13 May 2022 04:05:34 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 13 May 2022 10:05:32 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Fri, 13 May 2022 10:05:32 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C2CCBB10; Fri, 13 May 2022 09:05:32 +0000 (UTC) From: Charles Keepax To: Subject: [PATCH 1/3] ASoC: core: Correct spelling fliped -> flipped Date: Fri, 13 May 2022 10:05:30 +0100 Message-ID: <20220513090532.1450944-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: A38AH6_mrgb8YKjdyCG0uoI5CqhKkOOC X-Proofpoint-GUID: A38AH6_mrgb8YKjdyCG0uoI5CqhKkOOC X-Proofpoint-Spam-Reason: safe Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, kuninori.morimoto.gx@renesas.com 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" Signed-off-by: Charles Keepax Reviewed-by: Kuninori Morimoto --- include/sound/soc.h | 2 +- sound/soc/generic/audio-graph-card2.c | 2 +- sound/soc/soc-core.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index f906e5a708308..f20f5f890794a 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1259,7 +1259,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, const char *propname); int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname); -unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt); +unsigned int snd_soc_daifmt_clock_provider_flipped(unsigned int dai_fmt); unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame); unsigned int snd_soc_daifmt_parse_format(struct device_node *np, const char *prefix); diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 2b5d20f02f8f8..77ac4051b8276 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -711,7 +711,7 @@ static void graph_link_init(struct asoc_simple_priv *priv, */ daiclk = snd_soc_daifmt_clock_provider_from_bitmap(bit_frame); if (is_cpu_node) - daiclk = snd_soc_daifmt_clock_provider_fliped(daiclk); + daiclk = snd_soc_daifmt_clock_provider_flipped(daiclk); dai_link->dai_fmt = daifmt | daiclk; dai_link->init = asoc_simple_dai_init; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d68e64b73eea7..32267a38130b3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1230,7 +1230,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd, /* * Flip the polarity for the "CPU" end of a CODEC<->CODEC link */ - inv_dai_fmt = snd_soc_daifmt_clock_provider_fliped(dai_fmt); + inv_dai_fmt = snd_soc_daifmt_clock_provider_flipped(dai_fmt); for_each_rtd_cpu_dais(rtd, i, cpu_dai) { unsigned int fmt = dai_fmt; @@ -3035,7 +3035,7 @@ int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname) } EXPORT_SYMBOL_GPL(snd_soc_of_parse_aux_devs); -unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt) +unsigned int snd_soc_daifmt_clock_provider_flipped(unsigned int dai_fmt) { unsigned int inv_dai_fmt = dai_fmt & ~SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK; @@ -3056,7 +3056,7 @@ unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt) return inv_dai_fmt; } -EXPORT_SYMBOL_GPL(snd_soc_daifmt_clock_provider_fliped); +EXPORT_SYMBOL_GPL(snd_soc_daifmt_clock_provider_flipped); unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame) { From patchwork Fri May 13 09:05:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 12848531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 47831C433F5 for ; Fri, 13 May 2022 09:07:29 +0000 (UTC) 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 258E21AEB; Fri, 13 May 2022 11:06:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 258E21AEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652432847; bh=bLhHgrFqotuFuVS8jS4dwSmhv38xDX9CkE4XGKKhVvI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QacdYhSkredtZEeiSwBInJlYsPbRFzpK2QcIOdqpypoa8b/6suZgQ8j+pyZx+Ms8F jPRdO8bVyQzqFGyaWr2+qiBYNXClCqZDZmKE9XucWqLMhyIYsUEQid7oPX1QTKz7b+ c8IBxyMdA3CgoXG+ZxNkWS9BAoLIzXBpotnaAKmI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F0739F80516; Fri, 13 May 2022 11:05:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 70FECF8025E; Fri, 13 May 2022 11:05:52 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 314DDF80272 for ; Fri, 13 May 2022 11:05:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 314DDF80272 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="kZ8sxWOz" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24D6NLui024569; Fri, 13 May 2022 04:05:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=Jy8nJVtBMWQumc0Kj6jEHKGQ1qM+Jo14jQwTbfDQqx0=; b=kZ8sxWOzpHEZeM91WDcN5nVfmqZCfOI6nVK3I2Qsfk4x5P+eN0ksT4JaDcCSbFhS7l0z iq32il9eDPQnGHVbwVVpj9JMq4FkWfTPnDDoC62u06us2gOpHHlokcqr5CQi9iTdPmKo Kqt32ndtj1axnEd1DqVyLPsITzVSeW6ExzPPYCLu29y0Ycz/Ti/ht6/kduBZ7JdSg6vr /K2TSKFimg8eKdn3M6RQlRWJhlAqiyO6S8Nal4g6AlLcvNdMPXvWaHx5DniltuRpZY7q ugtEuKiFqAb4XHGNAOaLolhjG2BV4zZ/ZcHGMT07bqsqr34nbxNGiH4ONP8Fni0qGa6N LA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3fwp619dhq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 13 May 2022 04:05:41 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 13 May 2022 10:05:32 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Fri, 13 May 2022 10:05:32 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C77FA11D1; Fri, 13 May 2022 09:05:32 +0000 (UTC) From: Charles Keepax To: Subject: [PATCH 2/3] ASoC: core: Pass legacy_dai_naming flag directly Date: Fri, 13 May 2022 10:05:31 +0100 Message-ID: <20220513090532.1450944-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220513090532.1450944-1-ckeepax@opensource.cirrus.com> References: <20220513090532.1450944-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: TMQR3vI69rj98lfyxnOWiPAirNUUaR2s X-Proofpoint-ORIG-GUID: TMQR3vI69rj98lfyxnOWiPAirNUUaR2s X-Proofpoint-Spam-Reason: safe Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, kuninori.morimoto.gx@renesas.com 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" Passing the result of the helper function snd_soc_component_is_codec to snd_soc_register_dai is less clear than just passing the DAI naming flag directly. snd_soc_register_dai wants to know if it should use the legacy DAI naming. The CODEC distinction is more of a historical thing and not obviously directly related, and there are already a couple of CPU side components that explicitly opt in to non-legacy DAI naming. Signed-off-by: Charles Keepax --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 32267a38130b3..9574f86dd4de2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2497,7 +2497,7 @@ static int snd_soc_register_dais(struct snd_soc_component *component, for (i = 0; i < count; i++) { dai = snd_soc_register_dai(component, dai_drv + i, count == 1 && - !snd_soc_component_is_codec(component)); + !component->driver->non_legacy_dai_naming); if (dai == NULL) { ret = -ENOMEM; goto err; From patchwork Fri May 13 09:05:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 12848523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 75684C433F5 for ; Fri, 13 May 2022 09:07:10 +0000 (UTC) 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 2127A1AE0; Fri, 13 May 2022 11:06:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2127A1AE0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652432828; bh=cSv0nXCNyLQR0IhqBfgQeQCGGLzNAnZHuAw+LtiMJJI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bLn26Axs4YB/24WHgqrsAvKFw8wRlDAd+Ktg4rrMk+5bXt46JLUtzz69Rw8VkCNUn bPak5yPu2MLPHdDgVTOW9Pa3riLeRi6Pfe1Gm4Wp9MiKZMVYayrjZDjkMqqyb+kRVn QGkv/LKwXh+KeNPVekmJQTJLSfRNmXvd5UiObOd4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 78D74F80272; Fri, 13 May 2022 11:05:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15365F804AB; Fri, 13 May 2022 11:05:51 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F023AF8025E for ; Fri, 13 May 2022 11:05:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F023AF8025E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="eKKWN1fG" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24D6NLuj024569; Fri, 13 May 2022 04:05:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=/jCByvbLs+br1BUbiL1G0ewDJD8IsSMZCnvY0w3xHW8=; b=eKKWN1fG++rChq+WjBGH0iFRAyAzrOG98hZfROCewiEheBe4NV1mrnQenIDvbSMkbTG/ V8S4VU/3IB94wfkkMzsb3ygUz/oR9IeJ4ROGziMueJwm65OgD31G7eQ5kGJwnGYba08b P5kp9OKELWl6jKUQbvGT+4A2s2EsnvqmZrKL0Fa3EtPiDQCRy0EMJ5urlEonutTdbcAy pGwATqR2EFEAE29qC2Tu+slQqwdEkrb4Zd7BN8bhYkl5WfBOz0ohsOjr/PwYlqSOA6aP nM/oZG/8ZyZ9+mhGOeG3Olda+U8siPEa0vQQotGDezTah/PuSOXTDZFEbPGWmyJiMu0G 0Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3fwp619dhq-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 13 May 2022 04:05:42 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 13 May 2022 10:05:32 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Fri, 13 May 2022 10:05:32 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D5503468; Fri, 13 May 2022 09:05:32 +0000 (UTC) From: Charles Keepax To: Subject: [PATCH 3/3] ASoC: soc-component: Update handling to component delays Date: Fri, 13 May 2022 10:05:32 +0100 Message-ID: <20220513090532.1450944-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220513090532.1450944-1-ckeepax@opensource.cirrus.com> References: <20220513090532.1450944-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: Qq9mhvJVGyQt8aqIJvUIdWH88rlHMdB6 X-Proofpoint-ORIG-GUID: Qq9mhvJVGyQt8aqIJvUIdWH88rlHMdB6 X-Proofpoint-Spam-Reason: safe Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, kuninori.morimoto.gx@renesas.com 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" Currently the checking for if a component sits on the CPU or CODEC side of the DAI link is done with a helper function that checks if the component defines legacy_dai_naming. However, there are already a couple of CPU side components that explicitly opt in to non-legacy DAI naming and it doesn't seem like a very robust solution. Rather than looking for the flag check if the component is attached to any of the CODEC DAIs on the DAI link. This is more robust and helps to bring the core further in the direction of a component being a generic block rather than being classified as platform or CODEC drivers. Signed-off-by: Charles Keepax --- sound/soc/soc-component.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index c0664f94990c8..e12f8244242b9 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -932,6 +932,20 @@ int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream) return 0; } +static bool snd_soc_component_is_codec_on_rtd(struct snd_soc_pcm_runtime *rtd, + struct snd_soc_component *component) +{ + struct snd_soc_dai *dai; + int i; + + for_each_rtd_codec_dais(rtd, i, dai) { + if (dai->component == component) + return true; + } + + return false; +} + void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream, snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay) @@ -953,7 +967,7 @@ void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream, delay = component->driver->delay(component, substream); - if (snd_soc_component_is_codec(component)) + if (snd_soc_component_is_codec_on_rtd(rtd, component)) *codec_delay = max(*codec_delay, delay); else *cpu_delay = max(*cpu_delay, delay);