Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1877195rbb; Tue, 27 Feb 2024 04:18:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWd2E5Pj0srjwEakqiXjjlQaOnL0lMZWSDaAR+ruIMaGPP7K54zcNXFe/LMHIzT9K7idcyH5EoN5i21XH+Gn1k7SKnzbgj1V7T1Y4InlA== X-Google-Smtp-Source: AGHT+IGF98YL0NC14AO1ItZD2FNwmHIjKKvpxyYTs94c7QAC2MfhQMzLJ2ebNYAzKIOaTh2Bn+26 X-Received: by 2002:aa7:ce09:0:b0:566:470b:2edc with SMTP id d9-20020aa7ce09000000b00566470b2edcmr739228edv.22.1709036292053; Tue, 27 Feb 2024 04:18:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709036292; cv=pass; d=google.com; s=arc-20160816; b=t0rxdC2Fu84JyHF7oeEntYgI9OymF6yHXs+dnAr4VdPDqBog01OQ62AIcfQnKGay0W J1UvzhwUeShUPtisL61/eJO1ZPn1TNVO254A2i/2EiURGLaXs7d/3sV0Deao1vXtWZdv dsh+O/1gbczQRAEVyCkYnOjvDyFnn1ZA5JakVM8OJNR1hgRpiqYztsMWt9k8EIUhUQO/ IUiIVLE53PMh5KiGbOdCt2TNBKbO/e6Hh9ma8pWuLS7YM7pfpWMNS1/jVaz9xQ3qwjO7 RFNKcwcM+bqBnfhbdn04a7duehbyG5l0cuNEBa5vDyUtbUM/UPCH1toBSjumLSdk5e1c 5uGQ== 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=eRMJn0pE8TYZx9enMWU4EsIQubRLS65nO131sXbiCgs=; fh=9iEt4iCRn9CzCxci4w2sdEG90CBf9Xi5ef9RsAZByLs=; b=sst7VYZF/jMefc5YcSjKKXsqdPtTLWFrkhdKJqTMxNnN7MSbue7Q5mzSYFXxmuOaV1 KmAgYAOn6+CxToRuvq6lCSsSPx0EXD1MujNvtNSLnopqZHPjwCqq1uM59+yGMzdHz8PQ 6CIX5+rEOEEdgHUFOyPjMI/7nFc8nlWu0h4OsY/qEvhWMCIzDk2TQ274lb6HAcHNabbm 4hLQ8XkHQ6uiXJqbeX3X477JdxwnVx8fWofHsro+z34YDW7o4zY34OioOcoTGDhkEHFz 3rHEbjsOlJvTCTesoA/xXEtJeh+qyBxnntHi1r9jV7huONhejfDCxZePUnSHPGCRQuMM xAww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=rdX+ioti; 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-83196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a3-20020a509b43000000b005660baf9c8bsi670635edj.518.2024.02.27.04.18.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 04:18:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=rdX+ioti; 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-83196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83196-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 57C891F29028 for ; Tue, 27 Feb 2024 12:17:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCFCF13B7AB; Tue, 27 Feb 2024 12:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="rdX+ioti" 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 0112114E2F5; Tue, 27 Feb 2024 12:10:55 +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=1709035857; cv=none; b=Ht1Oi1ZMy65+0U33Q0qYYtcebjsza+SEhnrI5ltUaUch3kvLft1rCevXBonuqU9CHtvl2Bz80y9y+OlcXf1tCGKhjs1PUC72MLLqL1DqxwXWc7m78AMa98sB+GgdBvYUJpFNBL5iFE6qzwLxePddN0qDV8wwHuIEmHWl7QFHcdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709035857; c=relaxed/simple; bh=kerl0vuMjIUyp2KQJaznzvgGUT3Ij7TaPpRv6UYqes4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rKoFvWfLvXrfNcMK7CW6eT90x8e2pAPJ+LfXFiV4FjU9aCBwYRQj7wSCD0KrDFUgZrCg2h0shr/X4r3g84FKf2oyQPAitG5y6Me37vHH1rJFiQVq9wO+EUZCEhfUslVDwYfvJrFVL3cZWnPYOIT63Z6YUvFXVsMRoZfgxwCl7WM= 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=rdX+ioti; 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=1709035854; bh=kerl0vuMjIUyp2KQJaznzvgGUT3Ij7TaPpRv6UYqes4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rdX+iotiv9CWmoNGpRD/XS4hMay7N4Hx0oTNvOLOUfmKPJFz13HcCGcjslTdDY6rg 3MPYEsPb3JWw6yPyAgSfpHDC+6Jsf1CNMOiF47FNUiz+BHcHW95fWHGik88SJI1qKQ 9Wov/MswS7sgBqY9sXqbShhuK9K2VtytUCtd9fFHhwv2zbLlZtDbSKjaIeIWt4uVOE csuiW2LQn9YXiW8P05+Ay6OTQUwvIHC9Z+q//Ig4PxJDteM9wJ1RV6QVxav2LwsIJ6 j3BdvZUNrrlnRHh5f0JRfq8H8w/EulZd64RoHaY1w5FM5UahY2l9aXf4L5Sk0aCO6m XN7bgA2j1s0aw== 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 2BF3837820EB; Tue, 27 Feb 2024 12:10:52 +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 18/22] ASoC: dt-bindings: mt8195: Document audio-routing and dai-link subnode Date: Tue, 27 Feb 2024 13:09:35 +0100 Message-ID: <20240227120939.290143-19-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 driver hardcoded configuration. Signed-off-by: AngeloGioacchino Del Regno --- .../bindings/sound/mt8195-mt6359.yaml | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt8195-mt6359.yaml b/Documentation/devicetree/bindings/sound/mt8195-mt6359.yaml index c1ddbf672ca3..2334aa39df18 100644 --- a/Documentation/devicetree/bindings/sound/mt8195-mt6359.yaml +++ b/Documentation/devicetree/bindings/sound/mt8195-mt6359.yaml @@ -23,6 +23,15 @@ properties: $ref: /schemas/types.yaml#/definitions/string description: User specified audio sound card name + 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 MT8195 ASoC platform. @@ -30,10 +39,12 @@ properties: mediatek,dptx-codec: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle of MT8195 Display Port Tx codec node. + deprecated: true mediatek,hdmi-codec: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle of MT8195 HDMI codec node. + deprecated: true mediatek,adsp: $ref: /schemas/types.yaml#/definitions/phandle @@ -45,12 +56,75 @@ properties: A list of the desired dai-links in the sound card. Each entry is a name defined in the machine driver. +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: + - DPTX_BE + - ETDM1_IN_BE + - ETDM2_IN_BE + - ETDM1_OUT_BE + - ETDM2_OUT_BE + - ETDM3_OUT_BE + - PCM1_BE + + 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 +# Disallow legacy properties if dai-link-xxx nodes are specified +if: + not: + patternProperties: + ".*-dai-link$": false +then: + properties: + mediatek,dptx-codec: false + mediatek,hdmi-codec: false + examples: - | @@ -59,6 +133,55 @@ examples: mediatek,platform = <&afe>; pinctrl-names = "default"; pinctrl-0 = <&aud_pins_default>; + + audio-routing = + "Headphone", "HPOL", + "Headphone", "HPOR", + "IN1P", "Headset Mic", + "Ext Spk", "Speaker"; + + mm-dai-link { + link-name = "ETDM1_IN_BE"; + mediatek,clk-provider = "cpu"; + }; + + hs-playback-dai-link { + link-name = "ETDM1_OUT_BE"; + mediatek,clk-provider = "cpu"; + codec { + sound-dai = <&headset_codec>; + }; + }; + + hs-capture-dai-link { + link-name = "ETDM2_IN_BE"; + mediatek,clk-provider = "cpu"; + codec { + sound-dai = <&headset_codec>; + }; + }; + + spk-playback-dai-link { + link-name = "ETDM2_OUT_BE"; + mediatek,clk-provider = "cpu"; + codec { + sound-dai = <&spk_amplifier>; + }; + }; + + hdmi-dai-link { + link-name = "ETDM3_OUT_BE"; + codec { + sound-dai = <&hdmi_tx>; + }; + }; + + displayport-dai-link { + link-name = "DPTX_BE"; + codec { + sound-dai = <&dp_tx>; + }; + }; }; ... -- 2.44.0