From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D2A7C433EF for ; Mon, 21 Mar 2022 15:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350102AbiCUPZE (ORCPT ); Mon, 21 Mar 2022 11:25:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350076AbiCUPY7 (ORCPT ); Mon, 21 Mar 2022 11:24:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6D2B25E9C; Mon, 21 Mar 2022 08:23:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7AAB1B817C2; Mon, 21 Mar 2022 15:23:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2884C340E8; Mon, 21 Mar 2022 15:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647876211; bh=4ZpyIyXYDcZ36RfZOIv4oxh4lJ+vIIHH8n+8gbprSCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FLUh+ySfIHCMJccWzOujn77JxsZSejOrwn2p+855hwyPXkF77aZrr9VGfNd3TNBae Jv/ZNWbw9RsZ+dfUJ84+PcHkfujZL0NeibCYTsty4A6WSXYyMYGmUmcj2w2lcgxd4P cf8c1Gms39QL09R0tr7PAs6V8cKQg33YUUbBvLVsjcnKMHMgi57S0ZTfSyDw1nfGl/ HoyUkLDdnEeKZ8mYgoL+WPh+F2bKLY/gcv6y9AFrzpORCRUSuBTM7+tSlEiZbuUDU6 80L7Ocezq1BqkwgAuVGW8CVX5utlXtGw9ev6MzSOKgVw2psVepJdNKjc6a5a4AXINL /VeaMprAovbNg== Date: Mon, 21 Mar 2022 23:23:26 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Cc: broonie@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Subject: Re: [v5 3/4] ASoC: mediatek: mt8192: refactor for I2S8/I2S9 DAI links of headset Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-4-jiaxin.yu@mediatek.com> <17e6e8895ebc1113911481c7e097b394005db123.camel@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 21, 2022 at 10:38:48PM +0800, Jiaxin Yu wrote: > On Mon, 2022-03-21 at 17:21 +0800, Tzung-Bi Shih wrote: > > On Mon, Mar 21, 2022 at 05:14:08PM +0800, Jiaxin Yu wrote: > > > On Mon, 2022-03-21 at 11:59 +0800, Tzung-Bi Shih wrote: > > > > On Sat, Mar 19, 2022 at 07:41:10PM +0800, Jiaxin Yu wrote: > > > > > @@ -1145,6 +1140,13 @@ static int > > > > > mt8192_mt6359_dev_probe(struct > > > > > platform_device *pdev) > > > > > goto err_speaker_codec; > > > > > } > > > > > > > > > > + headset_codec = of_get_child_by_name(pdev->dev.of_node, > > > > > "mediatek,headset-codec"); > > > > > + if (!headset_codec) { > > > > > + ret = -EINVAL; > > > > > + dev_err_probe(&pdev->dev, ret, "Property > > > > > 'headset_codec' missing or invalid\n"); > > > > > + goto err_headset_codec; > > > > > + } > > > > > > > > (to be neat) Does it have any reason to prevent from using > > > > of_parse_phandle() > > > > but of_get_child_by_name()? > > > > > > "mediatek,headset-codec" is a child node of pdev->dev.of_node, so I > > > use > > > of_get_child_by_name() to get and pass it to > > > snd_soc_of_get_dai_link_codecs(). > > > > "mediatek,platform" and "mediatek,hdmi-codec" are also children of > > pdev->dev.of_node. I guess my question is: why doesn't it also use > > of_parse_phandle() for "mediatek,headset-codec"? Did I > > misunderstand? > > The following is from bindings, "mediatek,speaker-codec" and > "mediatek,headset-codec" are sub nodes of sound but "mediatek,platform" > and "mediatek,hdmi-codec" are the name of properties. So we can't get > the sub node pointer through of_parse_phandle(). > > sound: mt8192-sound { > compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; > mediatek,platform = <&afe>; > mediatek,hdmi-codec = <&anx_bridge_dp>; > pinctrl-names = "aud_clk_mosi_off", > "aud_clk_mosi_on"; > pinctrl-0 = <&aud_clk_mosi_off>; > pinctrl-1 = <&aud_clk_mosi_on>; > > mediatek,headset-codec { > sound-dai = <&rt5682>; > }; > > mediatek,speaker-codec { > sound-dai = <&rt1015_l>, > <&rt1015_r>; > }; > }; Got it, thanks for the explanation. Will provide my R-b tag in another thread. From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 ADA10C433EF for ; Mon, 21 Mar 2022 15:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RAfc6ItU53/j7Dw5xGbW1bQiqhEHcCFdkkyMGrwsT00=; b=hSqDfykundSGsA IdyMwczKuwgh+/kPXoxxNtEqPLl0LGSZcVDtAMm+W61H35m4Vtnq0gXA1TOxyvQcC5/VOXtdNGpqZ X/R+84Nz9499oqPZRvMlQ1SkDq0VMq86htttluTaLWK4Jz5Mg1oMWpNRR3MVj0h44LORDj2zOUZdO Sxa1IhD6r45MyC5QQMr3CFOgdUW7spSXnp75ozTJuTP3dgd2nrfzm3/v+zfyQb/cSF5QAaWdlim9u mAQjE8inavvM5RmYzUit7lUp17vfGmhCjBhD/mNqbMhVIvPVrvvEW2YXOliMOtTQUK34QuTSfGrvj 8LwgWzzOKrGdJXBfCY4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWJsq-008Beg-Lt; Mon, 21 Mar 2022 15:23:48 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWJsa-008BYV-B4; Mon, 21 Mar 2022 15:23:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CFE7860FA7; Mon, 21 Mar 2022 15:23:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2884C340E8; Mon, 21 Mar 2022 15:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647876211; bh=4ZpyIyXYDcZ36RfZOIv4oxh4lJ+vIIHH8n+8gbprSCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FLUh+ySfIHCMJccWzOujn77JxsZSejOrwn2p+855hwyPXkF77aZrr9VGfNd3TNBae Jv/ZNWbw9RsZ+dfUJ84+PcHkfujZL0NeibCYTsty4A6WSXYyMYGmUmcj2w2lcgxd4P cf8c1Gms39QL09R0tr7PAs6V8cKQg33YUUbBvLVsjcnKMHMgi57S0ZTfSyDw1nfGl/ HoyUkLDdnEeKZ8mYgoL+WPh+F2bKLY/gcv6y9AFrzpORCRUSuBTM7+tSlEiZbuUDU6 80L7Ocezq1BqkwgAuVGW8CVX5utlXtGw9ev6MzSOKgVw2psVepJdNKjc6a5a4AXINL /VeaMprAovbNg== Date: Mon, 21 Mar 2022 23:23:26 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Cc: broonie@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Subject: Re: [v5 3/4] ASoC: mediatek: mt8192: refactor for I2S8/I2S9 DAI links of headset Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-4-jiaxin.yu@mediatek.com> <17e6e8895ebc1113911481c7e097b394005db123.camel@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_082332_501718_38B9C206 X-CRM114-Status: GOOD ( 21.57 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, Mar 21, 2022 at 10:38:48PM +0800, Jiaxin Yu wrote: > On Mon, 2022-03-21 at 17:21 +0800, Tzung-Bi Shih wrote: > > On Mon, Mar 21, 2022 at 05:14:08PM +0800, Jiaxin Yu wrote: > > > On Mon, 2022-03-21 at 11:59 +0800, Tzung-Bi Shih wrote: > > > > On Sat, Mar 19, 2022 at 07:41:10PM +0800, Jiaxin Yu wrote: > > > > > @@ -1145,6 +1140,13 @@ static int > > > > > mt8192_mt6359_dev_probe(struct > > > > > platform_device *pdev) > > > > > goto err_speaker_codec; > > > > > } > > > > > > > > > > + headset_codec = of_get_child_by_name(pdev->dev.of_node, > > > > > "mediatek,headset-codec"); > > > > > + if (!headset_codec) { > > > > > + ret = -EINVAL; > > > > > + dev_err_probe(&pdev->dev, ret, "Property > > > > > 'headset_codec' missing or invalid\n"); > > > > > + goto err_headset_codec; > > > > > + } > > > > > > > > (to be neat) Does it have any reason to prevent from using > > > > of_parse_phandle() > > > > but of_get_child_by_name()? > > > > > > "mediatek,headset-codec" is a child node of pdev->dev.of_node, so I > > > use > > > of_get_child_by_name() to get and pass it to > > > snd_soc_of_get_dai_link_codecs(). > > > > "mediatek,platform" and "mediatek,hdmi-codec" are also children of > > pdev->dev.of_node. I guess my question is: why doesn't it also use > > of_parse_phandle() for "mediatek,headset-codec"? Did I > > misunderstand? > > The following is from bindings, "mediatek,speaker-codec" and > "mediatek,headset-codec" are sub nodes of sound but "mediatek,platform" > and "mediatek,hdmi-codec" are the name of properties. So we can't get > the sub node pointer through of_parse_phandle(). > > sound: mt8192-sound { > compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; > mediatek,platform = <&afe>; > mediatek,hdmi-codec = <&anx_bridge_dp>; > pinctrl-names = "aud_clk_mosi_off", > "aud_clk_mosi_on"; > pinctrl-0 = <&aud_clk_mosi_off>; > pinctrl-1 = <&aud_clk_mosi_on>; > > mediatek,headset-codec { > sound-dai = <&rt5682>; > }; > > mediatek,speaker-codec { > sound-dai = <&rt1015_l>, > <&rt1015_r>; > }; > }; Got it, thanks for the explanation. Will provide my R-b tag in another thread. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 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 9E984C433F5 for ; Mon, 21 Mar 2022 15:24:44 +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 B2E1C1743; Mon, 21 Mar 2022 16:23:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B2E1C1743 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1647876282; bh=4ZpyIyXYDcZ36RfZOIv4oxh4lJ+vIIHH8n+8gbprSCg=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UXVUzfN3EfwIzmLWB5UwT6IAcLDVQGPkXarIWnKCfj3J4d8dv95PeTw1JrLTU9Soq 1ancgqvO8quJCh7bsbEvBSlj1UnjvUP24reYVIWVmO0KSOqcGCnz4dd0mbfUwuMe/h fMaGIATzvP2NpeIxIL3Af6td2OVC5JED5rb6aXYQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DF85EF802D2; Mon, 21 Mar 2022 16:23:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BE2B0F80431; Mon, 21 Mar 2022 16:23:37 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1E119F80116 for ; Mon, 21 Mar 2022 16:23:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1E119F80116 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FLUh+ySf" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CFE7860FA7; Mon, 21 Mar 2022 15:23:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2884C340E8; Mon, 21 Mar 2022 15:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647876211; bh=4ZpyIyXYDcZ36RfZOIv4oxh4lJ+vIIHH8n+8gbprSCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FLUh+ySfIHCMJccWzOujn77JxsZSejOrwn2p+855hwyPXkF77aZrr9VGfNd3TNBae Jv/ZNWbw9RsZ+dfUJ84+PcHkfujZL0NeibCYTsty4A6WSXYyMYGmUmcj2w2lcgxd4P cf8c1Gms39QL09R0tr7PAs6V8cKQg33YUUbBvLVsjcnKMHMgi57S0ZTfSyDw1nfGl/ HoyUkLDdnEeKZ8mYgoL+WPh+F2bKLY/gcv6y9AFrzpORCRUSuBTM7+tSlEiZbuUDU6 80L7Ocezq1BqkwgAuVGW8CVX5utlXtGw9ev6MzSOKgVw2psVepJdNKjc6a5a4AXINL /VeaMprAovbNg== Date: Mon, 21 Mar 2022 23:23:26 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Subject: Re: [v5 3/4] ASoC: mediatek: mt8192: refactor for I2S8/I2S9 DAI links of headset Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-4-jiaxin.yu@mediatek.com> <17e6e8895ebc1113911481c7e097b394005db123.camel@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, broonie@kernel.org, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.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" On Mon, Mar 21, 2022 at 10:38:48PM +0800, Jiaxin Yu wrote: > On Mon, 2022-03-21 at 17:21 +0800, Tzung-Bi Shih wrote: > > On Mon, Mar 21, 2022 at 05:14:08PM +0800, Jiaxin Yu wrote: > > > On Mon, 2022-03-21 at 11:59 +0800, Tzung-Bi Shih wrote: > > > > On Sat, Mar 19, 2022 at 07:41:10PM +0800, Jiaxin Yu wrote: > > > > > @@ -1145,6 +1140,13 @@ static int > > > > > mt8192_mt6359_dev_probe(struct > > > > > platform_device *pdev) > > > > > goto err_speaker_codec; > > > > > } > > > > > > > > > > + headset_codec = of_get_child_by_name(pdev->dev.of_node, > > > > > "mediatek,headset-codec"); > > > > > + if (!headset_codec) { > > > > > + ret = -EINVAL; > > > > > + dev_err_probe(&pdev->dev, ret, "Property > > > > > 'headset_codec' missing or invalid\n"); > > > > > + goto err_headset_codec; > > > > > + } > > > > > > > > (to be neat) Does it have any reason to prevent from using > > > > of_parse_phandle() > > > > but of_get_child_by_name()? > > > > > > "mediatek,headset-codec" is a child node of pdev->dev.of_node, so I > > > use > > > of_get_child_by_name() to get and pass it to > > > snd_soc_of_get_dai_link_codecs(). > > > > "mediatek,platform" and "mediatek,hdmi-codec" are also children of > > pdev->dev.of_node. I guess my question is: why doesn't it also use > > of_parse_phandle() for "mediatek,headset-codec"? Did I > > misunderstand? > > The following is from bindings, "mediatek,speaker-codec" and > "mediatek,headset-codec" are sub nodes of sound but "mediatek,platform" > and "mediatek,hdmi-codec" are the name of properties. So we can't get > the sub node pointer through of_parse_phandle(). > > sound: mt8192-sound { > compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; > mediatek,platform = <&afe>; > mediatek,hdmi-codec = <&anx_bridge_dp>; > pinctrl-names = "aud_clk_mosi_off", > "aud_clk_mosi_on"; > pinctrl-0 = <&aud_clk_mosi_off>; > pinctrl-1 = <&aud_clk_mosi_on>; > > mediatek,headset-codec { > sound-dai = <&rt5682>; > }; > > mediatek,speaker-codec { > sound-dai = <&rt1015_l>, > <&rt1015_r>; > }; > }; Got it, thanks for the explanation. Will provide my R-b tag in another thread. From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D13C9C433F5 for ; Mon, 21 Mar 2022 15:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5AJXjQwM1w99RqYE4jF9VWOr6Kf7xBsvt01PSfFqogs=; b=lQtgIOOo7d5RFh l9N4jQMF/cKyxmxNbyajmTM4oY2BxVi7Bih260U3qorr9tuAKq+kYpktUQXVIWtxAVMeGyG1oEMCn i1bW7cyr/NE/sFsXUmahgW/G4NVmleqrhrUxmks3+NU0Mw+v2rjbd+rmsWRv0ct6wxfqXI/6k2xZb ZGAVJLBHXpTxnb9UrQhnUb1hpXic79SEisRu+ZhbFj4P4iLhSyaipIOmjpwE8uuLZGWhmebgEfwDy hN3Zm/C3mVj/dQP2wxB2AsDl6tcYnCLrmpKVnCEhreTtmEzSK8i+gtOrAPT1qstDtUVd7qBM9j4UK CeKoUoIaIpFB5Q9ll42Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWJse-008BZl-9P; Mon, 21 Mar 2022 15:23:36 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWJsa-008BYV-B4; Mon, 21 Mar 2022 15:23:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CFE7860FA7; Mon, 21 Mar 2022 15:23:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2884C340E8; Mon, 21 Mar 2022 15:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647876211; bh=4ZpyIyXYDcZ36RfZOIv4oxh4lJ+vIIHH8n+8gbprSCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FLUh+ySfIHCMJccWzOujn77JxsZSejOrwn2p+855hwyPXkF77aZrr9VGfNd3TNBae Jv/ZNWbw9RsZ+dfUJ84+PcHkfujZL0NeibCYTsty4A6WSXYyMYGmUmcj2w2lcgxd4P cf8c1Gms39QL09R0tr7PAs6V8cKQg33YUUbBvLVsjcnKMHMgi57S0ZTfSyDw1nfGl/ HoyUkLDdnEeKZ8mYgoL+WPh+F2bKLY/gcv6y9AFrzpORCRUSuBTM7+tSlEiZbuUDU6 80L7Ocezq1BqkwgAuVGW8CVX5utlXtGw9ev6MzSOKgVw2psVepJdNKjc6a5a4AXINL /VeaMprAovbNg== Date: Mon, 21 Mar 2022 23:23:26 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Cc: broonie@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Subject: Re: [v5 3/4] ASoC: mediatek: mt8192: refactor for I2S8/I2S9 DAI links of headset Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-4-jiaxin.yu@mediatek.com> <17e6e8895ebc1113911481c7e097b394005db123.camel@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_082332_501718_38B9C206 X-CRM114-Status: GOOD ( 21.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 21, 2022 at 10:38:48PM +0800, Jiaxin Yu wrote: > On Mon, 2022-03-21 at 17:21 +0800, Tzung-Bi Shih wrote: > > On Mon, Mar 21, 2022 at 05:14:08PM +0800, Jiaxin Yu wrote: > > > On Mon, 2022-03-21 at 11:59 +0800, Tzung-Bi Shih wrote: > > > > On Sat, Mar 19, 2022 at 07:41:10PM +0800, Jiaxin Yu wrote: > > > > > @@ -1145,6 +1140,13 @@ static int > > > > > mt8192_mt6359_dev_probe(struct > > > > > platform_device *pdev) > > > > > goto err_speaker_codec; > > > > > } > > > > > > > > > > + headset_codec = of_get_child_by_name(pdev->dev.of_node, > > > > > "mediatek,headset-codec"); > > > > > + if (!headset_codec) { > > > > > + ret = -EINVAL; > > > > > + dev_err_probe(&pdev->dev, ret, "Property > > > > > 'headset_codec' missing or invalid\n"); > > > > > + goto err_headset_codec; > > > > > + } > > > > > > > > (to be neat) Does it have any reason to prevent from using > > > > of_parse_phandle() > > > > but of_get_child_by_name()? > > > > > > "mediatek,headset-codec" is a child node of pdev->dev.of_node, so I > > > use > > > of_get_child_by_name() to get and pass it to > > > snd_soc_of_get_dai_link_codecs(). > > > > "mediatek,platform" and "mediatek,hdmi-codec" are also children of > > pdev->dev.of_node. I guess my question is: why doesn't it also use > > of_parse_phandle() for "mediatek,headset-codec"? Did I > > misunderstand? > > The following is from bindings, "mediatek,speaker-codec" and > "mediatek,headset-codec" are sub nodes of sound but "mediatek,platform" > and "mediatek,hdmi-codec" are the name of properties. So we can't get > the sub node pointer through of_parse_phandle(). > > sound: mt8192-sound { > compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; > mediatek,platform = <&afe>; > mediatek,hdmi-codec = <&anx_bridge_dp>; > pinctrl-names = "aud_clk_mosi_off", > "aud_clk_mosi_on"; > pinctrl-0 = <&aud_clk_mosi_off>; > pinctrl-1 = <&aud_clk_mosi_on>; > > mediatek,headset-codec { > sound-dai = <&rt5682>; > }; > > mediatek,speaker-codec { > sound-dai = <&rt1015_l>, > <&rt1015_r>; > }; > }; Got it, thanks for the explanation. Will provide my R-b tag in another thread. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel