Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1634041lql; Wed, 13 Mar 2024 04:06:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVk0El18RLM9vxZNqJ7Z+Edi1HIoAxDWE8/QSJI4+a1SxXIIRSBhjRcQOapD4ii3zikMO0/c/9P02xHwd++uEH9DsuohidxM+aLpDWdvA== X-Google-Smtp-Source: AGHT+IHorkGigI+OzExi4E6DrQDJC+oq5yUCWnJmmwlbjFl4vNcOdQsCdKKi2z8GoTaP5UNLr0Bv X-Received: by 2002:a05:6214:5e81:b0:690:cd2d:5f11 with SMTP id mm1-20020a0562145e8100b00690cd2d5f11mr4885716qvb.26.1710327996442; Wed, 13 Mar 2024 04:06:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710327996; cv=pass; d=google.com; s=arc-20160816; b=QSr3nCweOWJRQahcIQ+eXHHfWdaOlJNy7u0nS7IY6g2efg07J/m+Ip3qzDT1cZImII U3dcYbe+IvY4sBtNATUBKI88BB2hNAz6kZIVGbyWzhfJTxZ8JMrtVB/qKO+8eh8+HWv2 +FS1YNNJoQCp0g9M1/USiq9x9u5Gp2F2OpfHXmEeZzIyYhUS//BTkXOO5MiEeFVqGKJA kCJ2NfN056qtb8D4PEva/naBVj+02IOnFirfnidn4IL/2zIW1ZcYXbVFfRGTFG83eaBu WRES8sOkWIwQDTmojkT0IsDsTFtYoIwGiGi0Na2C6/C5WSYrgYd6sLh4Dp8xVoa/kC/l fX2g== 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=98sk6giUBHTMVT5PBA0HVuwDKHiSTyRg6MNb1JQ3tas=; fh=9iEt4iCRn9CzCxci4w2sdEG90CBf9Xi5ef9RsAZByLs=; b=iI0Xpp4kxdLtZa383E5iUh0ad+NDTMi+B/UFKanlCzg3iSEZgaLBK3LEmUNeMGsnmY QAIwa4CJJq5pSHwZzWUQyM5ieWeFQHWtvUtiJGgKYVnR8cWn8AMXqRKaKip46uvLYaID OGiBbavyyJphyoKc8K3o+PzDeLEPo2FTzqa9DGNfr1S9RzuMTLqGY0pOTX+Ww8wggRpU xVL8HewaKuF4PoBOjkJ3dFtZ+hZx/xYoVo1cvvdPq3Q0n/Sly5Z6UktujoDvFAAQtCmr nNI0fr8pZ1M3ov8j5OsE/HKehKM7XepFOsRbahhehHHLnQp/XVUlWJ0+g9H6Jp0YWr0h iJAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=y8g5hzok; 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-101399-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101399-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. [147.75.199.223]) by mx.google.com with ESMTPS id u2-20020ad45aa2000000b00690a1134d4esi9392489qvg.303.2024.03.13.04.06.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 04:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101399-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=y8g5hzok; 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-101399-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101399-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 1E8691C21C45 for ; Wed, 13 Mar 2024 11:06:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC4A654BCF; Wed, 13 Mar 2024 11:02:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="y8g5hzok" 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 36E2A5381A; Wed, 13 Mar 2024 11:02:44 +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=1710327765; cv=none; b=dB+kEiuxD6WwqCKKRhqebJIhYQiomOIq0qZMzBtRXr9X42wKG0rZBbQ2fXy12U4OfM2JrFauTSJ/UlMbZLu1/K9twj262nBlIFEqs5e7TrddL9v5S/PKFrSmD+SsuTzP7y4xOGDTN0T3Mtx56O0oCeZ2+ujr+jwGK21KFRDfqlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710327765; c=relaxed/simple; bh=Wciq8BsSA2oF9VMBg7MCCd2p9FuoNAQBM2GrJPu40Kg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QszAFsrA0JnbPb+5tRclUN2V3tXos5csiTXTuerwO9M/KU0PTlrV8EM67WCDMfdXML+3Xi0QTRhKMI0HAPILz7lNZwpbGZn5i+1Br2Ln9PccqN+i3UHHtirLGuPYfT80V0cGz5cQRKLEz2x0C72vaLuDClLeOsLPQHuwz9r5roo= 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=y8g5hzok; 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=1710327762; bh=Wciq8BsSA2oF9VMBg7MCCd2p9FuoNAQBM2GrJPu40Kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y8g5hzokKiz41ztxd27YyJh9veZa419hy4rFoNeQmd0SrTPKrgiqGRfh77qN+mlX8 /HTBXZPNxqJaKZqLmJMv7ir0folxNsVvbiyg0sVl88kpfSgikKLEhYW8WQXZ5QAjW7 8PGH2KPnAOnSr1eIZguDiJb/iO1/tUwZySiJ0aB3lNAWDSImAPLcVxq1huXFM4HcW0 /9gcNkjg/zLPIlZaYbFqewbxySo22Uy+yQ1NJJubzXTFRXrluNB0E4f3o3Hy81Bama m7NfgSPP5GSlLXJ55FpE6KXHKnubluMAtp9MuAmUEG15wyAyEi9BQ5xT4bpF4nGRd5 VejPJAlz0WI+Q== 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 9E86537820D4; Wed, 13 Mar 2024 11:02:40 +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 v3 19/22] ASoC: dt-bindings: mt8192: Document audio-routing and dai-link subnode Date: Wed, 13 Mar 2024 12:01:44 +0100 Message-ID: <20240313110147.1267793-20-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313110147.1267793-1-angelogioacchino.delregno@collabora.com> References: <20240313110147.1267793-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. Also, since describing machine specific audio hardware and links replaces the now deprecated old logic doing the same in a driver hardcoded fashion, it is not allowed to have both the old and new properties together. Signed-off-by: AngeloGioacchino Del Regno --- .../sound/mt8192-mt6359-rt1015-rt5682.yaml | 139 ++++++++++++++++-- 1 file changed, 129 insertions(+), 10 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..c4e68f31aaab 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,31 @@ 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. + minItems: 2 + items: + enum: + # Sinks + - Speakers + - Headphone Jack + - IN1P + - Left Spk + - Right Spk + + # Sources + - Headset Mic + - HPOL + - HPOR + - Left SPO + - Right SPO + - Speaker + mediatek,platform: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle of MT8192 ASoC platform. @@ -27,10 +55,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 +71,7 @@ properties: speaker-codecs: type: object additionalProperties: false + deprecated: true properties: sound-dai: @@ -51,33 +82,121 @@ properties: required: - sound-dai -additionalProperties: false +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 + +unevaluatedProperties: 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 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