Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4368003ybz; Mon, 20 Apr 2020 22:22:02 -0700 (PDT) X-Google-Smtp-Source: APiQypKUxSADMH/nz0E8m1lcScl3hLLXNylpCLN9rVOP56AWu7hkE3HjeDgzXQBm1F3hmxEXAQaU X-Received: by 2002:a50:a642:: with SMTP id d60mr17230255edc.351.1587446522371; Mon, 20 Apr 2020 22:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587446522; cv=none; d=google.com; s=arc-20160816; b=kSkrH1xfb3TvoTNTVU/9Nq/6iHxY/7sozysSha2n2MwjRJrHPppVO2mck+m0kXUef2 0s+x9MR8Dvd+LfWGPwTl7A72Yf9dQfjDBQBwCT8El404N/0poapMENKez7ZnMCy/1VpO ZhuKw9llF9vcxiQd1wJpooQRbJ0z4o80RN7a6GrVDX4/VsbZ07Xd/LiUOusL7T9d0xWb hj8i9acBJLkTZhCoWMelQ5n1m5oOyeLIedqdm7+7GPLEOqLYR4jo3FxeR+YR42kF1C7W Vqf9sYNTOlANE3UVgLBfgNzPSYpYLi1lmEwUiFyQvD2I1SgOGpI7VYJ1Cb4FubstkctD L3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:cc:to:user-agent:subject :from:message-id:date; bh=qI0sErAe20XxSPwj5KbLdJMtCIJWy/do/JE+gDGte+0=; b=d2EhuPRKhl3FBcj3MgRMoBKHHVzsmbEoZz3pzB3+7DyX//mmLT2+QMF/FBi4lSqT5V d/wH458scXLSSZjago78RSSLQ6L1vqjKfh7w6WkUWlHL53Qow/L2szL/jXYufMBqY98D I9sysfvkT+cTE3royhz9UrH0Z7aTfN1lOYuUvfs084Sf/IRZDvvd5I5+SuNqgZIQYNnJ lB5XY3C6PIUSikG+GNkCP41TB4ZAZMNaL4UgyxZ7LpObz6w/9F19TKAHW/nQwuW7WQxx 3f+PvCcVGDv3Uk/t2BDlNQPKRLkR0qHsRZP+B3UAkhkE2V9J4PwIuwMq+W5uWIvVyqmi rwQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si929638eds.399.2020.04.20.22.21.39; Mon, 20 Apr 2020 22:22:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726577AbgDUFSR (ORCPT + 99 others); Tue, 21 Apr 2020 01:18:17 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:11285 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725881AbgDUFSQ (ORCPT ); Tue, 21 Apr 2020 01:18:16 -0400 Date: 21 Apr 2020 14:18:15 +0900 X-IronPort-AV: E=Sophos;i="5.72,409,1580742000"; d="scan'208";a="45062989" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 21 Apr 2020 14:18:15 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id A3BFD41AEF58; Tue, 21 Apr 2020 14:18:15 +0900 (JST) Message-ID: <87ftcxv2lk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] ASoC: dt-bindings: audio-graph-card: switch to yaml base Documentation User-Agent: Wanderlust/2.15.9 Emacs/25.2 Mule/6.0 To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuninori Morimoto This patch switches from .txt base to .yaml base Document. Signed-off-by: Kuninori Morimoto --- .../bindings/sound/audio-graph-card.txt | 337 -------------- .../bindings/sound/audio-graph-card.yaml | 416 ++++++++++++++++++ 2 files changed, 416 insertions(+), 337 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card.txt create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card.yaml diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.txt b/Documentation/devicetree/bindings/sound/audio-graph-card.txt deleted file mode 100644 index 269682619a70..000000000000 --- a/Documentation/devicetree/bindings/sound/audio-graph-card.txt +++ /dev/null @@ -1,337 +0,0 @@ -Audio Graph Card: - -Audio Graph Card specifies audio DAI connections of SoC <-> codec. -It is based on common bindings for device graphs. -see ${LINUX}/Documentation/devicetree/bindings/graph.txt - -Basically, Audio Graph Card property is same as Simple Card. -see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.txt - -Below are same as Simple-Card. - -- label -- widgets -- routing -- dai-format -- frame-master -- bitclock-master -- bitclock-inversion -- frame-inversion -- mclk-fs -- hp-det-gpio -- mic-det-gpio -- dai-tdm-slot-num -- dai-tdm-slot-width -- clocks / system-clock-frequency - -Required properties: - -- compatible : "audio-graph-card"; -- dais : list of CPU DAI port{s} - -Optional properties: -- pa-gpios: GPIO used to control external amplifier. - ------------------------ -Example: Single DAI case ------------------------ - - sound_card { - compatible = "audio-graph-card"; - - dais = <&cpu_port>; - }; - - dai-controller { - ... - cpu_port: port { - cpu_endpoint: endpoint { - remote-endpoint = <&codec_endpoint>; - - dai-format = "left_j"; - ... - }; - }; - }; - - audio-codec { - ... - port { - codec_endpoint: endpoint { - remote-endpoint = <&cpu_endpoint>; - }; - }; - }; - ------------------------ -Example: Multi DAI case ------------------------ - - sound-card { - compatible = "audio-graph-card"; - - label = "sound-card"; - - dais = <&cpu_port0 - &cpu_port1 - &cpu_port2>; - }; - - audio-codec@0 { - ... - port { - codec0_endpoint: endpoint { - remote-endpoint = <&cpu_endpoint0>; - }; - }; - }; - - audio-codec@1 { - ... - port { - codec1_endpoint: endpoint { - remote-endpoint = <&cpu_endpoint1>; - }; - }; - }; - - audio-codec@2 { - ... - port { - codec2_endpoint: endpoint { - remote-endpoint = <&cpu_endpoint2>; - }; - }; - }; - - dai-controller { - ... - ports { - cpu_port0: port@0 { - cpu_endpoint0: endpoint { - remote-endpoint = <&codec0_endpoint>; - - dai-format = "left_j"; - ... - }; - }; - cpu_port1: port@1 { - cpu_endpoint1: endpoint { - remote-endpoint = <&codec1_endpoint>; - - dai-format = "i2s"; - ... - }; - }; - cpu_port2: port@2 { - cpu_endpoint2: endpoint { - remote-endpoint = <&codec2_endpoint>; - - dai-format = "i2s"; - ... - }; - }; - }; - }; - - ------------------------ -Example: Sampling Rate Conversion ------------------------ - - sound_card { - compatible = "audio-graph-card"; - - label = "sound-card"; - prefix = "codec"; - routing = "codec Playback", "DAI0 Playback", - "DAI0 Capture", "codec Capture"; - convert-rate = <48000>; - - dais = <&cpu_port>; - }; - - audio-codec { - ... - port { - codec_endpoint: endpoint { - remote-endpoint = <&cpu_endpoint>; - }; - }; - }; - - dai-controller { - ... - cpu_port: port { - cpu_endpoint: endpoint { - remote-endpoint = <&codec_endpoint>; - - dai-format = "left_j"; - ... - }; - }; - }; - ------------------------ -Example: 2 CPU 1 Codec (Mixing) ------------------------ - - sound_card { - compatible = "audio-graph-card"; - - label = "sound-card"; - routing = "codec Playback", "DAI0 Playback", - "codec Playback", "DAI1 Playback", - "DAI0 Capture", "codec Capture"; - - dais = <&cpu_port>; - }; - - audio-codec { - ... - - audio-graph-card,prefix = "codec"; - audio-graph-card,convert-rate = <48000>; - port { - reg = <0>; - codec_endpoint0: endpoint@0 { - remote-endpoint = <&cpu_endpoint0>; - }; - codec_endpoint1: endpoint@1 { - remote-endpoint = <&cpu_endpoint1>; - }; - }; - }; - - dai-controller { - ... - cpu_port: port { - cpu_endpoint0: endpoint@0 { - remote-endpoint = <&codec_endpoint0>; - - dai-format = "left_j"; - ... - }; - cpu_endpoint1: endpoint@1 { - remote-endpoint = <&codec_endpoint1>; - - dai-format = "left_j"; - ... - }; - }; - }; - ------------------------ -Example: Multi DAI with DPCM ------------------------ - - CPU0 ------ ak4613 - CPU1 ------ HDMI - CPU2 ------ PCM3168A-p /* DPCM 1ch/2ch */ - CPU3 --/ /* DPCM 3ch/4ch */ - CPU4 --/ /* DPCM 5ch/6ch */ - CPU5 --/ /* DPCM 7ch/8ch */ - CPU6 ------ PCM3168A-c - - sound_card: sound { - compatible = "audio-graph-card"; - - label = "sound-card"; - - routing = "pcm3168a Playback", "DAI2 Playback", - "pcm3168a Playback", "DAI3 Playback", - "pcm3168a Playback", "DAI4 Playback", - "pcm3168a Playback", "DAI5 Playback"; - - dais = <&snd_port0 /* ak4613 */ - &snd_port1 /* HDMI0 */ - &snd_port2 /* pcm3168a playback */ - &snd_port3 /* pcm3168a capture */ - >; - }; - - ak4613: codec@10 { - ... - port { - ak4613_endpoint: endpoint { - remote-endpoint = <&rsnd_endpoint0>; - }; - }; - }; - - pcm3168a: audio-codec@44 { - ... - audio-graph-card,prefix = "pcm3168a"; - audio-graph-card,convert-channels = <8>; /* TDM Split */ - ports { - port@0 { - reg = <0>; - pcm3168a_endpoint_p1: endpoint@1 { - remote-endpoint = <&rsnd_endpoint2>; - ... - }; - pcm3168a_endpoint_p2: endpoint@2 { - remote-endpoint = <&rsnd_endpoint3>; - ... - }; - pcm3168a_endpoint_p3: endpoint@3 { - remote-endpoint = <&rsnd_endpoint4>; - ... - }; - pcm3168a_endpoint_p4: endpoint@4 { - remote-endpoint = <&rsnd_endpoint5>; - ... - }; - }; - port@1 { - reg = <1>; - pcm3168a_endpoint_c: endpoint { - remote-endpoint = <&rsnd_endpoint6>; - ... - }; - }; - }; - }; - - &sound { - ports { - snd_port0: port@0 { - rsnd_endpoint0: endpoint { - remote-endpoint = <&ak4613_endpoint>; - ... - }; - }; - snd_port1: port@1 { - rsnd_endpoint1: endpoint { - remote-endpoint = <&dw_hdmi0_snd_in>; - ... - }; - }; - snd_port2: port@2 { - #address-cells = <1>; - #size-cells = <0>; - rsnd_endpoint2: endpoint@2 { - remote-endpoint = <&pcm3168a_endpoint_p1>; - ... - }; - rsnd_endpoint3: endpoint@3 { - remote-endpoint = <&pcm3168a_endpoint_p2>; - ... - }; - rsnd_endpoint4: endpoint@4 { - remote-endpoint = <&pcm3168a_endpoint_p3>; - ... - }; - rsnd_endpoint5: endpoint@5 { - remote-endpoint = <&pcm3168a_endpoint_p4>; - ... - }; - }; - snd_port3: port@6 { - rsnd_endpoint6: endpoint { - remote-endpoint = <&pcm3168a_endpoint_c>; - ... - }; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card.yaml new file mode 100644 index 000000000000..fd0ac87ee2ed --- /dev/null +++ b/Documentation/devicetree/bindings/sound/audio-graph-card.yaml @@ -0,0 +1,416 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/audio-graph-card.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Audio Graph Card Driver Device Tree Bindings + +maintainers: + - Kuninori Morimoto + +definitions: + endpoint: + type: object + properties: + remote-endpoint: + maxItems: 1 + mclk-fs: + $ref: "simple-card.yaml#/definitions/mclk-fs" + frame-inversion: + $ref: "simple-card.yaml#/definitions/frame-inversion" + bitclock-inversion: + $ref: "simple-card.yaml#/definitions/bitclock-inversion" + frame-master: + $ref: "simple-card.yaml#/definitions/frame-master" + bitclock-master: + $ref: "simple-card.yaml#/definitions/bitclock-master" + dai-format: + $ref: "simple-card.yaml#/definitions/format" + convert-rate: + $ref: "simple-card.yaml#/definitions/convert-rate" + convert-channels: + $ref: "simple-card.yaml#/definitions/convert-channels" + required: + - remote-endpoint + + port: + description: single OF-Graph subnode + type: object + properties: + prefix: + $ref: "simple-card.yaml#/definitions/prefix" + convert-rate: + $ref: "simple-card.yaml#/definitions/convert-rate" + convert-channels: + $ref: "simple-card.yaml#/definitions/convert-channels" + endpoint: + $ref: "#/definitions/endpoint" + + ports: + description: multi OF-Graph subnode + type: object + properties: + prefix: + $ref: "simple-card.yaml#/definitions/prefix" + convert-rate: + $ref: "simple-card.yaml#/definitions/convert-rate" + convert-channels: + $ref: "simple-card.yaml#/definitions/convert-channels" + patternProperties: + "^port(@[0-9a-f]+)$": + $ref: "#/definitions/port" + additionalProperties: false + +properties: + compatible: + contains: + enum: + - audio-graph-card + - audio-graph-scu-card + + dais: + $ref: /schemas/types.yaml#/definitions/phandle-array + label: + maxItems: 1 + prefix: + $ref: "simple-card.yaml#/definitions/prefix" + routing: + $ref: "simple-card.yaml#/definitions/routing" + widgets: + $ref: "simple-card.yaml#/definitions/widgets" + convert-rate: + $ref: "simple-card.yaml#/definitions/convert-rate" + convert-channels: + $ref: "simple-card.yaml#/definitions/convert-channels" + pa-gpios: + maxItems: 1 + hp-det-gpio: + maxItems: 1 + mic-det-gpio: + maxItems: 1 + +required: + - compatible + +additionalProperties: false + +examples: +#----------------------- +# Single DAI (_s) +#----------------------- + - | + sound { + compatible = "audio-graph-card"; + + dais = <&cpu_port_a>; + }; + + dai-controller { + /* + * dai-controller own settings + */ + + cpu_port_s: port { + cpu_endpoint_s: endpoint { + remote-endpoint = <&codec_endpoint_s>; + dai-format = "left_j"; + /* ... */ + }; + }; + }; + + codec { + /* + * codec own settings + */ + + port { + codec_endpoint_s: endpoint { + remote-endpoint = <&cpu_endpoint_s>; + }; + }; + }; + +#----------------------- +# Multi DAI (_m) +#----------------------- + - | + sound { + compatible = "audio-graph-card"; + + label = "sound-card"; + + dais = <&cpu_port0 + &cpu_port1 + &cpu_port2>; + }; + + audio-codec@0 { + /* + * codec0 own settings + */ + + port { + codec_endpoint_m0: endpoint { + remote-endpoint = <&cpu_endpoint_m0>; + }; + }; + }; + + audio-codec@1 { + /* + * codec1 own settings + */ + + port { + codec_endpoint_m1: endpoint { + remote-endpoint = <&cpu_endpoint_m1>; + }; + }; + }; + + audio-codec@2 { + /* + * codec2 own settings + */ + + port { + codec_endpoint_m2: endpoint { + remote-endpoint = <&cpu_endpoint_m2>; + }; + }; + }; + + dai-controller { + /* + * dai-controller own settings + */ + + ports { + cpu_port_m0: port@0 { + cpu_endpoint_m0: endpoint { + remote-endpoint = <&codec_endpoint_m0>; + dai-format = "left_j"; + }; + }; + + cpu_port_m1: port@1 { + cpu_endpoint_m1: endpoint { + remote-endpoint = <&codec_endpoint_m1>; + dai-format = "i2s"; + }; + }; + + cpu_port_m2: port@2 { + cpu_endpoint_m2: endpoint { + remote-endpoint = <&codec_endpoint_m2>; + dai-format = "i2s"; + }; + }; + }; + }; + +#----------------------- +# Sampling Rate Conversion (_r) +#----------------------- + + - | + sound { + compatible = "audio-graph-card"; + + label = "sound-card"; + prefix = "codec"; + routing = "codec Playback", "DAI0 Playback", + "DAI0 Capture", "codec Capture"; + convert-rate = <48000>; + + dais = <&cpu_port_x>; + }; + + codec { + /* + * codec own settings + */ + + port { + codec_endpoint_r: endpoint { + remote-endpoint = <&cpu_endpoint_r>; + }; + }; + }; + + dai-controller { + /* + * dai-controller own settings + */ + + cpu_port_r: port { + cpu_endpoint_r: endpoint { + remote-endpoint = <&codec_endpoint_r>; + dai-format = "left_j"; + }; + }; + }; + +#----------------------- +# 2 CPU 1 Codec (Mixing) (_x) +#----------------------- + + - | + sound { + compatible = "audio-graph-card"; + + label = "sound-card"; + routing = "codec Playback", "DAI0 Playback", + "codec Playback", "DAI1 Playback", + "DAI0 Capture", "codec Capture"; + + dais = <&cpu_port_y>; + }; + + codec { + /* + * codec own settings + */ + + audio-graph-card,prefix = "codec"; + audio-graph-card,convert-rate = <48000>; + + port { + codec_endpoint_x0: endpoint@0 { + remote-endpoint = <&cpu_endpoint_x0>; + }; + codec_endpoint_x1: endpoint@1 { + remote-endpoint = <&cpu_endpoint_x1>; + }; + }; + }; + + dai-controller { + /* + * dai-controller own settings + */ + + port { + cpu_endpoint_x0: endpoint@0 { + remote-endpoint = <&codec_endpoint_x0>; + dai-format = "left_j"; + }; + cpu_endpoint_x1: endpoint@1 { + remote-endpoint = <&codec_endpoint_x1>; + dai-format = "left_j"; + }; + }; + }; + +#----------------------- +# Multi DAI with DPCM +# +# CPU0 ------ ak4613 +# CPU1 ------ HDMI +# CPU2 ------ PCM3168A-p /* DPCM 1ch/2ch */ +# CPU3 --/ /* DPCM 3ch/4ch */ +# CPU4 --/ /* DPCM 5ch/6ch */ +# CPU5 --/ /* DPCM 7ch/8ch */ +# CPU6 ------ PCM3168A-c +#----------------------- + - | + + sound { + compatible = "audio-graph-card"; + label = "sound-card"; + routing = "pcm3168a Playback", "DAI2 Playback", + "pcm3168a Playback", "DAI3 Playback", + "pcm3168a Playback", "DAI4 Playback", + "pcm3168a Playback", "DAI5 Playback"; + + dais = <&snd_port0 /* ak4613 */ + &snd_port1 /* HDMI0 */ + &snd_port2 /* pcm3168a playback */ + &snd_port3>; /* pcm3168a capture */ + }; + + ak4613: codec { + /* + * ak4613 own settings + */ + + port { + ak4613_endpoint: endpoint { + remote-endpoint = <&rsnd_endpoint0>; + }; + }; + }; + + pcm3168a: audio-codec@44 { + /* + * pcm3168a own settings + */ + + audio-graph-card,prefix = "pcm3168a"; + audio-graph-card,convert-channels = <8>; /* TDM Split */ + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pcm3168a_endpoint_p1: endpoint@1 { + remote-endpoint = <&rsnd_endpoint2>; + }; + pcm3168a_endpoint_p2: endpoint@2 { + remote-endpoint = <&rsnd_endpoint3>; + }; + pcm3168a_endpoint_p3: endpoint@3 { + remote-endpoint = <&rsnd_endpoint4>; + }; + pcm3168a_endpoint_p4: endpoint@4 { + remote-endpoint = <&rsnd_endpoint5>; + }; + }; + port@1 { + reg = <1>; + pcm3168a_endpoint_c: endpoint { + remote-endpoint = <&rsnd_endpoint6>; + }; + }; + }; + }; + + dai-controller { + /* + * dai-controller own settings + */ + + ports { + snd_port0: port@0 { + rsnd_endpoint0: endpoint { + remote-endpoint = <&ak4613_endpoint>; + }; + }; + snd_port1: port@1 { + rsnd_endpoint1: endpoint { + remote-endpoint = <&dw_hdmi0_snd_in>; + }; + }; + snd_port2: port@2 { + rsnd_endpoint2: endpoint@2 { + remote-endpoint = <&pcm3168a_endpoint_p1>; + }; + rsnd_endpoint3: endpoint@3 { + remote-endpoint = <&pcm3168a_endpoint_p2>; + }; + rsnd_endpoint4: endpoint@4 { + remote-endpoint = <&pcm3168a_endpoint_p3>; + }; + rsnd_endpoint5: endpoint@5 { + remote-endpoint = <&pcm3168a_endpoint_p4>; + }; + }; + snd_port3: port@6 { + rsnd_endpoint6: endpoint { + remote-endpoint = <&pcm3168a_endpoint_c>; + }; + }; + }; + }; -- 2.17.1