From patchwork Mon Jul 4 15:38:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 587162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81FA6C43334 for ; Mon, 4 Jul 2022 15:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232130AbiGDPid (ORCPT ); Mon, 4 Jul 2022 11:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230311AbiGDPic (ORCPT ); Mon, 4 Jul 2022 11:38:32 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931D2E000 for ; Mon, 4 Jul 2022 08:38:30 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id r9so11500375ljp.9 for ; Mon, 04 Jul 2022 08:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=36Fo3nrBjoWjM4WDiir3vWCMAuOSPdmTYxT8kWTupbw=; b=F5iw3ocErp6G/79qF+y+Zvj/c7eDlOClKuycFQdoDdMFRpxBoxDMeuOotY/K4i+AKN MvTavltYKEnlOI2huJvVql0zS37Zoc6CnTj4SKO1FakntuxPEjqpPNbpSAA67CYiq0lB mlb356NkiYwVzSN+Sy/AU/h7b33HThAcbkUkWBRQn2yVYWutEY0AfMtMIhOVZgEHPn7y j2/d8HTC+Ws1kytynSdw3mtkl0xyLgqFFoD18ARPnJg2+KKf/GR9JxdZlEvldZ/fTz6q LpW3QAtV21IXRK2VU+G7A4QpG+Ja04eWowRfi8ZCbgJiH7kjiWaJAcxGC+2X2789MWJF 6Dxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=36Fo3nrBjoWjM4WDiir3vWCMAuOSPdmTYxT8kWTupbw=; b=z6XlO5tRhhSKNfircFfbAYxSSYngYtSBPwaMC2QcbnkoNhibwnK20W7I/7lcOPK/q+ bjHZkoFM5Vf+87OMjvh2yBPkGNE4wUyJsEtN1Y/NcgqoCiqSZwA5bcF2jk8tQ49GfT73 jILMteLnEkM7ABwXric6RI79dWjhbvX4ixXFafbl93wZVfRoLFwSmS1ceWb81sZ2P5wL kHaYrY9vScrk6Ulnpxn/lhA00erKiV7/mb8UpCD29uqX0vDZ76LBpL6m/LRxjWHf2raZ ooirAGxJoLjvL9IhmXxVgz2TbT9KC3yn53Fxni+Vc6sr/q1/KAQsNHWVbuLAxm5plszr gj/Q== X-Gm-Message-State: AJIora/ORDaLgwHK4KovP5jKuGKA9uQNIurtJkS1GkAmK7Ip6UpqIIJp Qk9r9EuKTUZy1IRKPxW+3MWWeg== X-Google-Smtp-Source: AGRyM1sDU5ztSDUAsix5exO9MzhM8q0VzoTIvbDo4k9dJG2fJlMpytyCEXpqIjsC7qZRlcN8VUjoYg== X-Received: by 2002:a2e:8e7c:0:b0:25b:fae1:8a24 with SMTP id t28-20020a2e8e7c000000b0025bfae18a24mr12824152ljk.520.1656949108867; Mon, 04 Jul 2022 08:38:28 -0700 (PDT) Received: from krzk-bin.home ([84.20.121.239]) by smtp.gmail.com with ESMTPSA id d10-20020a0565123d0a00b0048110fd06c4sm4214010lfv.53.2022.07.04.08.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 08:38:28 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH] ASoC: dt-bindings: qcom,sdm845: convert to dtschema Date: Mon, 4 Jul 2022 17:38:24 +0200 Message-Id: <20220704153824.23226-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Convert the Samsung SDM845 sound card bindings to DT schema. Changes during conversion: do not require 'codec' under dai-links - not present in all nodes of examples and DTS; not required by the driver. Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/sound/qcom,sdm845.txt | 91 ---------- .../bindings/sound/qcom,sdm845.yaml | 166 ++++++++++++++++++ 2 files changed, 166 insertions(+), 91 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/qcom,sdm845.txt create mode 100644 Documentation/devicetree/bindings/sound/qcom,sdm845.yaml diff --git a/Documentation/devicetree/bindings/sound/qcom,sdm845.txt b/Documentation/devicetree/bindings/sound/qcom,sdm845.txt deleted file mode 100644 index de4c604641da..000000000000 --- a/Documentation/devicetree/bindings/sound/qcom,sdm845.txt +++ /dev/null @@ -1,91 +0,0 @@ -* Qualcomm Technologies Inc. SDM845 ASoC sound card driver - -This binding describes the SDM845 sound card, which uses qdsp for audio. - -- compatible: - Usage: required - Value type: - Definition: must be one of this - "qcom,sdm845-sndcard" - "qcom,db845c-sndcard" - "lenovo,yoga-c630-sndcard" - -- audio-routing: - Usage: Optional - Value type: - Definition: 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 power supplies, MicBias - of codec and the jacks on the board. - -- model: - Usage: required - Value type: - Definition: The user-visible name of this sound card. - -- aux-devs - Usage: optional - Value type: - Definition: A list of phandles for auxiliary devices (e.g. analog - amplifiers) that do not appear directly within the DAI - links. Should be connected to another audio component - using "audio-routing". - -= dailinks -Each subnode of sndcard represents either a dailink, and subnodes of each -dailinks would be cpu/codec/platform dais. - -- link-name: - Usage: required - Value type: - Definition: User friendly name for dai link - -= CPU, PLATFORM, CODEC dais subnodes -- cpu: - Usage: required - Value type: - Definition: cpu dai sub-node - -- codec: - Usage: required - Value type: - Definition: codec dai sub-node - -- platform: - Usage: Optional - Value type: - Definition: platform dai sub-node - -- sound-dai: - Usage: required - Value type: - Definition: dai phandle/s and port of CPU/CODEC/PLATFORM node. - -Example: - -audio { - compatible = "qcom,sdm845-sndcard"; - model = "sdm845-snd-card"; - pinctrl-names = "default", "sleep"; - pinctrl-0 = <&pri_mi2s_active &pri_mi2s_ws_active>; - pinctrl-1 = <&pri_mi2s_sleep &pri_mi2s_ws_sleep>; - - mm1-dai-link { - link-name = "MultiMedia1"; - cpu { - sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; - }; - }; - - pri-mi2s-dai-link { - link-name = "PRI MI2S Playback"; - cpu { - sound-dai = <&q6afedai PRIMARY_MI2S_RX>; - }; - - platform { - sound-dai = <&q6routing>; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/sound/qcom,sdm845.yaml b/Documentation/devicetree/bindings/sound/qcom,sdm845.yaml new file mode 100644 index 000000000000..5e7e6b051cf0 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/qcom,sdm845.yaml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/qcom,sdm845.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies Inc. SDM845 ASoC sound card + +maintainers: + - Srinivas Kandagatla + +properties: + compatible: + enum: + - qcom,sdm845-sndcard + - qcom,db845c-sndcard + - lenovo,yoga-c630-sndcard + + 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 power supplies, MicBias of + codec and the jacks on the board. + + aux-devs: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: | + List of phandles for auxiliary devices (e.g. analog amplifiers) that do + not appear directly within the DAI links. Should be connected to another + audio component using "audio-routing". + + model: + $ref: /schemas/types.yaml#/definitions/string + description: User-visible sound card name + +patternProperties: + ".*-dai-link$": + type: object + description: + Each subnode represents a dai link. Subnodes of each dai links would be + cpu/codec dais. + + properties: + link-name: + $ref: /schemas/types.yaml#/definitions/string + description: User friendly name for dai link. + + cpu: + type: object + description: CPU DAI subnode. + properties: + sound-dai: + maxItems: 1 + + codec: + type: object + description: Codec DAI subnode. + properties: + sound-dai: + minItems: 1 + maxItems: 4 + + platform: + type: object + description: Platform DAI subnode. + properties: + sound-dai: + maxItems: 1 + + required: + - link-name + - cpu + + additionalProperties: false + +required: + - compatible + - model + +additionalProperties: false + +examples: + - | + #include + #include + + sound { + compatible = "qcom,sdm845-sndcard"; + model = "Samsung-W737"; + + audio-routing = "RX_BIAS", "MCLK", + "AMIC2", "MIC BIAS2", + "SpkrLeft IN", "SPK1 OUT", + "SpkrRight IN", "SPK2 OUT", + "MM_DL1", "MultiMedia1 Playback", + "MM_DL3", "MultiMedia3 Playback", + "MultiMedia2 Capture", "MM_UL2"; + + mm1-dai-link { + link-name = "MultiMedia1"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; + }; + }; + + mm2-dai-link { + link-name = "MultiMedia2"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; + }; + }; + + mm3-dai-link { + link-name = "MultiMedia3"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>; + }; + }; + + slim-dai-link { + link-name = "SLIM Playback"; + cpu { + sound-dai = <&q6afedai SLIMBUS_0_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>; + }; + }; + + slimcap-dai-link { + link-name = "SLIM Capture"; + cpu { + sound-dai = <&q6afedai SLIMBUS_0_TX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 1>; + }; + }; + + slim-wcd-dai-link { + link-name = "SLIM WCD Playback"; + cpu { + sound-dai = <&q6afedai SLIMBUS_1_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&wcd9340 2>; + }; + }; + };