Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1883389rbb; Tue, 27 Feb 2024 04:30:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtN5ZiUR8q4+nrzCfY1DKs98u83hfaHdGEL0u6Z0+d3M9hx5sYnWkW0Vc+kLjEo3wbjQ3fMA8oIy9pkkQhBLavsh+ZYxh2TFzPV55F/g== X-Google-Smtp-Source: AGHT+IHRb8tfgSjAfDxoOk/Yj/mQNUxANVuTpgqhb9xNZuBFkGKNBZb12ygwKgQiaO+V3AFriGWh X-Received: by 2002:a05:6a00:8e06:b0:6e5:a7d:c0b5 with SMTP id io6-20020a056a008e0600b006e50a7dc0b5mr6451822pfb.9.1709037035443; Tue, 27 Feb 2024 04:30:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709037035; cv=pass; d=google.com; s=arc-20160816; b=DZVBJMDBteptz7xVoCi2kBYnM26qq8AOThLmrSJ07jcsxB2Ag1hr6YocpGl7f4ovA/ BefH1YrjOykuHhnS/Y7NpEc9DN7gtm7XKverwxP7UsrrokTxtsDLrMaGGm1i9AvAMywt +gvN6mDokFJ3RIOls5Kcmre3gBJ6+UIFk8O+U6s97kGoOi3tZQiZISO+GESGn1vg17BL OSXWi+WwRB5Mq2R/7Q2nz4+muJiCywTf0zoMssS4cl1ISMuuDJsriIcH/070zQbe9dDt uns07hMyMq+2Ts57r1fLhmAqn7MItni3IpaNZYPJpt1QAg0Gskm+7qvtE9DbE4HHc3u4 tzJw== 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=37IRL9Y9n3JSJCK3M8aKplApsRQVAmXzC8HBkWbpEo8=; fh=9iEt4iCRn9CzCxci4w2sdEG90CBf9Xi5ef9RsAZByLs=; b=iiA8T5oiv+paikJWd5BJiTJoxpeVs05aSIxaKNQ3u/KZcMc1AIM4ldKhxh1viSYxqy TQBE53rX5yRjeagpvHQd3wL0HSzvTzWBkJy5b+Z787+tCn8SF/byfn3vHS7Z8JuzagnS u+KpffRRgFll4wYD7+33OD/POScNfccLH/BYubmbQc5jNM/B83GiRAgaCTK05fgUVvgN v6WbduKYBtSuQVsEv5TWf69EffOI/tb7yIi6LS9LJqnCsfHe4+mimYgpCQTcYz3zwIDj UkX/sY4aTgRyuqGjjPdVxcqQBoRKp6TYrD6RjB/78jOsHoVr/mL8OKqfglbfZ6dCg1bd xjOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MhrmIBZL; 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-83197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g17-20020a63e611000000b005cdf37c9c29si5306356pgh.703.2024.02.27.04.30.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 04:30:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MhrmIBZL; 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-83197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83197-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DA0DBB26889 for ; Tue, 27 Feb 2024 12:17:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26E5F13B7AE; Tue, 27 Feb 2024 12:11:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="MhrmIBZL" 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 5266314EFE2; Tue, 27 Feb 2024 12:10:58 +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=1709035860; cv=none; b=WOuc5qLQt1hhFUiZVyb57W/ut6Lw5BtEF38pRw0mb0EBBvczjWBRLBFM3Qv78WnYkaI8TEv1y35+bJgpHMLTOdgUqJ2aH3x9LAG1cXmge3VKZh5zOF/gEWPTYJleZFKgSrtLhVHhWzMNwbt8HMQuarmU2pU1Jf1YLAFGjzVbNCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709035860; c=relaxed/simple; bh=FpZkwYdVfTF+bMDobFvJQk2yvXp+Z6trPflZm3oUlZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YF4AaOMF8Awn69boCTrd1RaOyegnAyifXBrGV0jE3upo8bELddUzJxVN7JKG4R5GoRsc0PjI6i1Ie5iTMqKuv4m2R9A2CG/3yR4ZBamRZ3HOn+fWFNaUKRGt91Sb0Ep1gaKQkQxch2379RbnXGe5ThVB3CndlE7jpDXeJST/lVU= 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=MhrmIBZL; 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=1709035856; bh=FpZkwYdVfTF+bMDobFvJQk2yvXp+Z6trPflZm3oUlZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MhrmIBZLuCengucGyVl5DGZeBRydUYfybL6TrY4t6sGpxblPW+mvRL19oezNk+jKk 46ghplWyhBYbjSefmsDbsOwfDzfePMAyUbfrvdX0891mgBiwgOVhqgc+FZvULUw+2Y tdLypUTgv2LLXSKMvgLgyZyBqVzVZrs3juZA0U0iqWrcYjKNi+ppf1emP8dxrARRkO 2mG6T1wg1MftZZZhJGKPwc9fcwbmSziaQ7AtqEnsqu9dqIGLDNSu4S3MSzSsRsr8KH 45RfU4PAr3E48BVj4MAa0tLm3IWDfLYalbp+W/az/Fow8/6epWSeA+dl/OL0uMgq/c oeWtYrhmwuC1g== 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 A78BE37820ED; Tue, 27 Feb 2024 12:10:54 +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 19/22] ASoC: dt-bindings: mt8192: Document audio-routing and dai-link subnode Date: Tue, 27 Feb 2024 13:09:36 +0100 Message-ID: <20240227120939.290143-20-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240227120939.290143-1-angelogioacchino.delregno@collabora.com> References: <20240227120939.290143-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 | 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 + 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 +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 + + 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 + - if: + patternProperties: + ".*-dai-link$": false + then: + required: + - headset-codec + - speaker-codecs + else: + properties: + headset-codec: false + speaker-codecs: false + mediatek,hdmi-codec: false 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