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 59559C48BF6 for ; Mon, 4 Mar 2024 14:24:05 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=rlZkzcpFo3Fj71uOWtsTiwn7oHIUGS3KFlGWRGBn33Y=; b=e8H6pdVSOGrfyc q8vIzcvt1NpECjoVsK5wbWc/xtwCthh8gK6QTF4AQFl3avIGLwdDmCkrUPjKOghqStCgODNqWsuZy uTixbReGno4yEN+sFDGLWyHOZqw2oG2zC+s2nKKSbR7on0TJWEat4XYH3+kk4d3JrEZ2w0JydwPXp zH5WNsnPbiA5RAtgR8cSSy4w3vBA8DBpSqt9ncl8zbhgbgGNwdf8/jVwbuBJNY73q19Oz6SRidbES KHfZrfV3CwGRIr8SUisDD84DEyXCfVmYltIJ1yznuF8uLOCM4EnMH07HIqJMl+zrbRGjwg7et3U8D f5+0R5COmNz+yPewUzpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh9EN-00000009M2O-3eVG; Mon, 04 Mar 2024 14:23:51 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh9EK-00000009M1E-2TaE; Mon, 04 Mar 2024 14:23:50 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A84D6CE1386; Mon, 4 Mar 2024 14:23:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90565C43390; Mon, 4 Mar 2024 14:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709562223; bh=XXxnvR6/7pWjgGR4OrSNwADlQ09xHuL0Usz9cO3xdU4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AsPt8hoDUStklKvbr9l5y2fCjUGifbeJjU76gbjhnARANwQXeq28a2bR771tR8nGT noq991Wu1u/PCmt4GmXY7fDKquRwzL5iof/dZkzUfh9seVFkRx739pgn8PWheEu6SG UWs0JrRh19UszyusQy3QxyfcQm8/sMHN5c88pWXSH+PdSW3/3avE5HPVXoLb9tKBdF TTIhXfxcJX8lBh50VfYt0ukdtiFqg/8esZM4/Etf2qaOf17eYQFv2EsnRZg7uqsvSu YR364dIhms7VAjpVoZ2rKs1VYiEaI6QPd6KwtY0QFiCXusYMaYeO3bErFJyEXF+YuE Zek//seAJQ1FA== Date: Mon, 4 Mar 2024 08:23:41 -0600 From: Rob Herring To: AngeloGioacchino Del Regno Subject: Re: [PATCH 19/22] ASoC: dt-bindings: mt8192: Document audio-routing and dai-link subnode Message-ID: <20240304142341.GA156846-robh@kernel.org> References: <20240227120939.290143-1-angelogioacchino.delregno@collabora.com> <20240227120939.290143-20-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240227120939.290143-20-angelogioacchino.delregno@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_062349_025314_26FCE250 X-CRM114-Status: GOOD ( 19.80 ) 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: , Cc: shraash@google.com, alsa-devel@alsa-project.org, allen-kh.cheng@mediatek.com, kuninori.morimoto.gx@renesas.com, lgirdwood@gmail.com, tiwai@suse.com, shane.chien@mediatek.com, krzysztof.kozlowski+dt@linaro.org, claudiu.beznea@tuxon.dev, kernel@collabora.com, nfraprado@collabora.com, amergnat@baylibre.com, zhourui@huaqin.corp-partner.google.com, jiaxin.yu@mediatek.com, trevor.wu@mediatek.com, wenst@chromium.org, devicetree@vger.kernel.org, conor+dt@kernel.org, ckeepax@opensource.cirrus.com, arnd@arndb.de, frank.li@vivo.com, maso.huang@mediatek.com, u.kleine-koenig@pengutronix.de, eugen.hristev@collabora.com, alpernebiyasak@gmail.com, broonie@kernel.org, linux-mediatek@lists.infradead.org, linux-sound@vger.kernel.org, matthias.bgg@gmail.com, perex@perex.cz, linux-arm-kernel@lists.infradead.org, xiazhengqiao@huaqin.corp-partner.google.com, dianders@chromium.org, linux-kernel@vger.kernel.org, jarkko.nikula@bitmer.com 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 Tue, Feb 27, 2024 at 01:09:36PM +0100, AngeloGioacchino Del Regno wrote: > Document the dai-link subnodes and the audio-routing property, allowing > to describe machine specific audio hardware and links in device tree. > > While at it, also deprecate the old properties which were previously > used with the driver's partially hardcoded configuration. > > Signed-off-by: AngeloGioacchino Del Regno > --- > .../sound/mt8192-mt6359-rt1015-rt5682.yaml | 129 ++++++++++++++++-- > 1 file changed, 121 insertions(+), 8 deletions(-) > > diff --git a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml > index 7e50f5d65c8f..78e221003750 100644 > --- a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml > +++ b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml > @@ -20,6 +20,15 @@ properties: > - mediatek,mt8192_mt6359_rt1015p_rt5682 > - mediatek,mt8192_mt6359_rt1015p_rt5682s > > + audio-routing: > + $ref: /schemas/types.yaml#/definitions/non-unique-string-array Already defined in sound-card-common.yaml. Add a $ref. > + description: > + A list of the connections between audio components. Each entry is a > + pair of strings, the first being the connection's sink, the second > + being the connection's source. > + Valid names could be the input or output widgets of audio components, > + power supplies, MicBias of codec and the software switch. Generally the names are defined here. > + > mediatek,platform: > $ref: /schemas/types.yaml#/definitions/phandle > description: The phandle of MT8192 ASoC platform. > @@ -27,10 +36,12 @@ properties: > mediatek,hdmi-codec: > $ref: /schemas/types.yaml#/definitions/phandle > description: The phandle of HDMI codec. > + deprecated: true > > headset-codec: > type: object > additionalProperties: false > + deprecated: true > > properties: > sound-dai: > @@ -41,6 +52,7 @@ properties: > speaker-codecs: > type: object > additionalProperties: false > + deprecated: true > > properties: > sound-dai: > @@ -51,13 +63,83 @@ properties: > required: > - sound-dai > > +patternProperties: > + ".*-dai-link$": > + type: object > + description: > + Container for dai-link level properties and CODEC sub-nodes. > + > + properties: > + link-name: > + description: Indicates dai-link name and PCM stream name > + items: > + enum: > + - I2S0 > + - I2S1 > + - I2S2 > + - I2S3 > + - I2S4 > + - I2S5 > + - I2S6 > + - I2S7 > + - I2S8 > + - I2S9 > + - TDM > + > + codec: > + description: Holds subnode which indicates codec dai. > + type: object > + additionalProperties: false > + properties: > + sound-dai: > + minItems: 1 > + maxItems: 2 > + required: > + - sound-dai > + > + dai-format: > + description: audio format > + items: > + enum: > + - i2s > + - right_j > + - left_j > + - dsp_a > + - dsp_b > + > + mediatek,clk-provider: > + $ref: /schemas/types.yaml#/definitions/string > + description: Indicates dai-link clock master. > + items: > + enum: > + - cpu > + - codec > + > + additionalProperties: false Move this before properties. > + > + required: > + - link-name > + > additionalProperties: false > > required: > - compatible > - mediatek,platform > - - headset-codec > - - speaker-codecs > + > +allOf: > + # Disallow dai-link-xxx nodes if the legacy properties are specified xxx-dai-link? > + - if: > + patternProperties: > + ".*-dai-link$": false > + then: > + required: > + - headset-codec > + - speaker-codecs > + else: > + properties: > + headset-codec: false > + speaker-codecs: false > + mediatek,hdmi-codec: false Allowing both would preserve compatibility. That's not needed? If so, say why in the commit msg. > > examples: > - | > @@ -65,19 +147,50 @@ examples: > 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>; > > - headset-codec { > - sound-dai = <&rt5682>; > + audio-routing = > + "Headphone Jack", "HPOL", > + "Headphone Jack", "HPOR", > + "IN1P", "Headset Mic", > + "Speakers", "Speaker"; > + > + spk-playback-dai-link { > + link-name = "I2S3"; > + dai-format = "i2s"; > + mediatek,clk-provider = "cpu"; > + codec { > + sound-dai = <&rt1015p>; > + }; > + }; > + > + hs-playback-dai-link { > + link-name = "I2S8"; > + dai-format = "i2s"; > + mediatek,clk-provider = "cpu"; > + codec { > + sound-dai = <&rt5682 0>; > + }; > + }; > + > + hs-capture-dai-link { > + link-name = "I2S9"; > + dai-format = "i2s"; > + mediatek,clk-provider = "cpu"; > + codec { > + sound-dai = <&rt5682 0>; > + }; > }; > > - speaker-codecs { > - sound-dai = <&rt1015_l>, > - <&rt1015_r>; > + displayport-dai-link { > + link-name = "TDM"; > + dai-format = "dsp_a"; > + codec { > + sound-dai = <&anx_bridge_dp>; > + }; > }; > }; > > -- > 2.44.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel