Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp501413lqi; Thu, 7 Mar 2024 03:50:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMhWjV5PB5n06U4uIggMRmPEw2FEnJTzdWLP2elMql9DMTnELi1/XMClqIa00nooO/OMtT5a0dxH4MkqkolImMP8dDN4xT7Q3iFvNUhA== X-Google-Smtp-Source: AGHT+IGcmbUEOfracW+A8fZ/qgrtLO/7NKYsb3DYkhany2bN/BPseJ4/6cnemZqgyKlo91NXUPkG X-Received: by 2002:ac8:7c48:0:b0:42e:78b9:84ef with SMTP id o8-20020ac87c48000000b0042e78b984efmr7675314qtv.8.1709812229655; Thu, 07 Mar 2024 03:50:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709812229; cv=pass; d=google.com; s=arc-20160816; b=UjgAkFhK8BqHGGVi89c0+jBlWqfzF2dqAxEKqU1HsFjshEHPSW1C8wMCdx3Xp1y5ij 0CFCy9E8arik7qDZ0MKmBTZ2cZq1TOFgSqRDGd7Z4c4v5llGLLR9rPFgkWN0e6Bx3HzB hck3W7O4FdvvvRaUTUGlIeQXWhFm98XWHb75Gl+C1cUj47VrHegECPH/7GFz6P2ir64G VYT8MwnUPq41l2KJPexMtBobbQxPlgPzg3g3i+JUIyodr1nIVsTxmbEUAq+U61x32i0L dRr5cEYKI4OF4MPOdOWKDq6flR9Y7DZZXkLrtFEkI0QBtLmcOBulXVvadYcHY8cEVRWT v2TA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3IcLA+L5cJYec3f2Od6TLTHDy8Fss42h4H7vqUnr2l0=; fh=9iEt4iCRn9CzCxci4w2sdEG90CBf9Xi5ef9RsAZByLs=; b=zaYk1+mhsqu+SR2aOsf1i0hr6s9HNYb87C+BqKrj6I22dZddl7BYjgG9sWwhG3qFFN IHmut93ifYnEOAhv9+fnHXUsPHVyxzL7sKtjII+oosN88NTw5w+TJYl+6d0BDk8n6UFf T+4DQvHhLJhrJn+xqctUv9FLdSWuUOav+uMDSmDOjJHfFFmMM8xHjRYrnFeNMPkGmE4B 6KWVFbGHjJnp7w0ABE8ZiWTFygD1jNdDiqg/Qh3BSi3w4nsVn2Xh07Mh8jOKQxgIFeH4 f4rp3iFI4P7G4yoocicvh1eh/O0/phzN3HHxIzzQTzfwXBDnOZmOgEwc7aLsEw2lkBKS TJjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=1yQDhPJX; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-95481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fv9-20020a05622a4a0900b0042ef7077bc1si8188566qtb.550.2024.03.07.03.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 03:50:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=1yQDhPJX; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-95481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 53E241C22A84 for ; Thu, 7 Mar 2024 11:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AE8C12FB2C; Thu, 7 Mar 2024 11:45:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="1yQDhPJX" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 E2D2E12F5B2; Thu, 7 Mar 2024 11:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709811941; cv=none; b=qYbCloBOSTmTrMuz6ni30nO+AZqgl67xIICEWSqxFGS4tC4v4lmqthOmd/B7NPXzyPfZM/8UQc3JpRTPpT7gG/cr1LtYcLMb9l19wi6yHYjEks60vQdRQuFKkhXpdjXqGtIPQUfKUKePjUf3pA55cpuEIVVuQvCX/SXnvlCzqYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709811941; c=relaxed/simple; bh=PhUbcVjfbDZRFpij5bSKc+8hvWDLh0jAfdYGXhyvfGI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MgZExsHr3T1pp8ccug50pKj5wsQ2S4DMW7vrdHP5EcDdpyJWef47LlZphP+v+0vA1HmSbK+MselA/78GVEo9TZPj4CJBWicgoBVAkaPhwC2ZFOfqIcmDoSnypM3nGwQHZvRdVh6jt3qkQakYlE666yy5iNna575oCGBXnChJW04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=1yQDhPJX; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709811938; bh=PhUbcVjfbDZRFpij5bSKc+8hvWDLh0jAfdYGXhyvfGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1yQDhPJXTzad1FHuZjnONMxRAtgjyRo58y2Us1LAou+ipgfsUngaCvQxyz7EskJ30 Q/MaBlE86nDpnMd5gwHQm9ocfkVdeJQI/bT4kOawcZGSPOMyzwlqTykfPWxfP/m7Ml HSMSkhWJ7wKPOfDOTTacR1xa4DaAByINXCU8uuhVUKJCF/pfqHlXrR70eifHl542vx r3ZTs6lstS3CsGi87sTbfzk1TCIcCKntceigvRChou7vSb4Hqa7G0Qzb6EKDQRqvPQ NqtJts/8D1HUPtbenV32pKOw5DbPIhBmo6cOc/kZBP0nYOc2nZBHr+yEip0Xf2sCfm /h65wCBg1HvLg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 25E1137820EE; Thu, 7 Mar 2024 11:45:36 +0000 (UTC) From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: wenst@chromium.org, lgirdwood@gmail.com, robh@kernel.org, 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, AngeloGioacchino Del Regno Subject: [PATCH v2 19/22] ASoC: dt-bindings: mt8192: Document audio-routing and dai-link subnode Date: Thu, 7 Mar 2024 12:44:42 +0100 Message-ID: <20240307114445.196981-20-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240307114445.196981-1-angelogioacchino.delregno@collabora.com> References: <20240307114445.196981-1-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-Transfer-Encoding: 8bit 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 | 124 ++++++++++++++++-- 1 file changed, 115 insertions(+), 9 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..449454c50dcc 100644 --- a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml +++ b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml @@ -13,6 +13,9 @@ maintainers: description: This binding describes the MT8192 sound card. +allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: @@ -20,6 +23,14 @@ properties: - mediatek,mt8192_mt6359_rt1015p_rt5682 - mediatek,mt8192_mt6359_rt1015p_rt5682s + audio-routing: + 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. + mediatek,platform: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle of MT8192 ASoC platform. @@ -27,10 +38,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 +54,7 @@ properties: speaker-codecs: type: object additionalProperties: false + deprecated: true properties: sound-dai: @@ -51,33 +65,125 @@ properties: required: - sound-dai +patternProperties: + ".*-dai-link$": + type: object + additionalProperties: false + + description: + Container for dai-link level properties and CODEC sub-nodes. + + properties: + link-name: + description: Indicates dai-link name and PCM stream name + 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 + 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. + enum: [ cpu, codec ] + + required: + - link-name + additionalProperties: false required: - compatible - mediatek,platform - - headset-codec - - speaker-codecs + +# Disallow legacy properties if xxx-dai-link nodes are specified +if: + not: + patternProperties: + ".*-dai-link$": false +then: + properties: + headset-codec: false + speaker-codecs: false + mediatek,hdmi-codec: false +else: + required: + - headset-codec + - speaker-codecs examples: - | sound: mt8192-sound { compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; - mediatek,platform = <&afe>; - mediatek,hdmi-codec = <&anx_bridge_dp>; + model = "mt8192_mt6359_rt1015_rt5682"; pinctrl-names = "aud_clk_mosi_off", "aud_clk_mosi_on"; pinctrl-0 = <&aud_clk_mosi_off>; pinctrl-1 = <&aud_clk_mosi_on>; + mediatek,platform = <&afe>; + + 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>; + }; + }; - headset-codec { - sound-dai = <&rt5682>; + 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