Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1869108lqg; Mon, 4 Mar 2024 06:23:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUg0EcqnGfWhzkftXpK5nhkn8UOrncTb2TxoS+P2OYTwAyqwPMzH+6ApNgNyVgMi8YFB2wflrl56spwYVWFrRB9cyEmLSKnFC8A7VtY+w== X-Google-Smtp-Source: AGHT+IHLaCJvLZAhx6KQAm7fZhqPvrcp+J8z01rFidlNGsXAFUaXqPVLqZuYznOPg+EI9m3RatE6 X-Received: by 2002:a50:bacb:0:b0:567:1797:426f with SMTP id x69-20020a50bacb000000b005671797426fmr3567314ede.24.1709562232816; Mon, 04 Mar 2024 06:23:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709562232; cv=pass; d=google.com; s=arc-20160816; b=UKlLiYRyHFBB7H1aPeOUUmOCK83f8dOf926ny7t798eIaNJWm2c6wWIq/FCVeDoMOl FWMsrfSgUsTfZ1g0x/yIpjqT0arO+LI21eCW5s+5zjqH12CNgelMJUxI9QjxZ6uXb0kX MbZwvmhTnZUOZfCjgcfzJRv8pAvm5fqs+Ug5k8EXICMWFPRQ/Cc3N+PvbUxy7UmQdSlS QJL/Mrq+w65x0IiUodRrvsdtvMnx2/F6MiMcgIV+Fca7paAY2ICTWrVroWp6wYsX+fBD HJZOqliIw2RhSrfwSnqfuhraPLLY3egBE6CbaU07QXQlFJPOhga8QwYCuMDvT7BBXt6M igEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hZ2JVEDgmiFzKsuSYxpzr/7KrPRAfX7wF19HQuPSEm0=; fh=lAIOR0uEjtAD9wFcwd7aRw87Dn4qYuHqaUislxAkopY=; b=QJrjg/dwqRilcE2R+FSLDFxfAHSv6m926DlXGhJ0WJGPLqlq2UMjOdBEnR/LUfTlCS 0tsXPkC+HOmNy+LY16ivVzRtg2qNwxHC3tBFADaW22c+6XyUJzPH3kejg3wQzBSEYDD/ knADxKDbLa15yGP7ZakmrH7yzFdwduSYKF79fm0dP1EilMuu62dhUMIbAlpOCZNTegGi Bbo/DuY4WuPEU80uMXC2LQPgXJIXFre0ZtCKxPd/aYnrwlk5pSnnjIGmGHdjK/auAUkP SIQy3eCpi27lv+IaZWYE4HfsG67mLl07xQ4IwZxvXKzvL3Oqdx+Mw5mUh1+2f6wL/LLb nc1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AsPt8hoD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-90721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s23-20020a50ab17000000b0056445f4ade6si4117936edc.234.2024.03.04.06.23.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 06:23:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AsPt8hoD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-90721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6422C1F266C4 for ; Mon, 4 Mar 2024 14:23:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43354405C7; Mon, 4 Mar 2024 14:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AsPt8hoD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42B4C3FB0A; Mon, 4 Mar 2024 14:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709562224; cv=none; b=IgvOkWcmFYnRyYowhJe+GF4Q1D9Jy5qbC2unpRqYE56FES96DyubXBCfOzNu3SKFlPsO5gmbmgk978/SiIX5iKuO9Zsh2iZSiT+3f1+XyjlcLOMgzRWHdQ8z18QAE9UjGs4cGWUvv3UOL+5ZUuH0EjnRIfZyJryFD262LuPwUdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709562224; c=relaxed/simple; bh=XXxnvR6/7pWjgGR4OrSNwADlQ09xHuL0Usz9cO3xdU4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kVPlKnnPBCUtyHrV4wn+uPVEUlZs9WEP7d4F8ws7/MnYL1rHNLDpbmnUxdlaYScuL7ZXgx2YF5NwUiz/TZcR5n7FDN3ywQizq/de+2kaPzaahKu6CjQ1rmjWfUuH78hHv1HaAHYB981cIC4OhlQe/iwLtmjLqk/fdocRGd2Gyx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AsPt8hoD; arc=none smtp.client-ip=10.30.226.201 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 Cc: broonie@kernel.org, wenst@chromium.org, lgirdwood@gmail.com, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, matthias.bgg@gmail.com, perex@perex.cz, tiwai@suse.com, trevor.wu@mediatek.com, maso.huang@mediatek.com, xiazhengqiao@huaqin.corp-partner.google.com, arnd@arndb.de, kuninori.morimoto.gx@renesas.com, shraash@google.com, amergnat@baylibre.com, nicolas.ferre@microchip.com, u.kleine-koenig@pengutronix.de, dianders@chromium.org, frank.li@vivo.com, allen-kh.cheng@mediatek.com, eugen.hristev@collabora.com, claudiu.beznea@tuxon.dev, jarkko.nikula@bitmer.com, jiaxin.yu@mediatek.com, alpernebiyasak@gmail.com, ckeepax@opensource.cirrus.com, zhourui@huaqin.corp-partner.google.com, nfraprado@collabora.com, alsa-devel@alsa-project.org, shane.chien@mediatek.com, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240227120939.290143-20-angelogioacchino.delregno@collabora.com> 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 >