Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: dt-bindings: meson: convert axg sound card control to schema

Convert the DT binding documentation for the Amlogic axg sound card to
schema.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230208093520.52843-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jerome Brunet and committed by
Mark Brown
65f0a8ea 677e3ab7

+183 -124
-124
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt
··· 1 - Amlogic AXG sound card: 2 - 3 - Required properties: 4 - 5 - - compatible: "amlogic,axg-sound-card" 6 - - model : User specified audio sound card name, one string 7 - 8 - Optional properties: 9 - 10 - - audio-aux-devs : List of phandles pointing to auxiliary devices 11 - - audio-widgets : Please refer to widgets.txt. 12 - - audio-routing : A list of the connections between audio components. 13 - 14 - Subnodes: 15 - 16 - - dai-link: Container for dai-link level properties and the CODEC 17 - sub-nodes. There should be at least one (and probably more) 18 - subnode of this type. 19 - 20 - Required dai-link properties: 21 - 22 - - sound-dai: phandle and port of the CPU DAI. 23 - 24 - Required TDM Backend dai-link properties: 25 - - dai-format : CPU/CODEC common audio format 26 - 27 - Optional TDM Backend dai-link properties: 28 - - dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks 29 - - dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks 30 - When omitted, mask is assumed to have to no 31 - slots. A valid must have at one slot, so at 32 - least one these mask should be provided with 33 - an enabled slot. 34 - - dai-tdm-slot-num : Please refer to tdm-slot.txt. 35 - If omitted, slot number is set to accommodate the largest 36 - mask provided. 37 - - dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted. 38 - - mclk-fs : Multiplication factor between stream rate and mclk 39 - 40 - Backend dai-link subnodes: 41 - 42 - - codec: dai-link representing backend links should have at least one subnode. 43 - One subnode for each codec of the dai-link. 44 - dai-link representing frontend links have no codec, therefore have no 45 - subnodes 46 - 47 - Required codec subnodes properties: 48 - 49 - - sound-dai: phandle and port of the CODEC DAI. 50 - 51 - Optional codec subnodes properties: 52 - 53 - - dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt. 54 - - dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt. 55 - 56 - Example: 57 - 58 - sound { 59 - compatible = "amlogic,axg-sound-card"; 60 - model = "AXG-S420"; 61 - audio-aux-devs = <&tdmin_a>, <&tdmout_c>; 62 - audio-widgets = "Line", "Lineout", 63 - "Line", "Linein", 64 - "Speaker", "Speaker1 Left", 65 - "Speaker", "Speaker1 Right"; 66 - "Speaker", "Speaker2 Left", 67 - "Speaker", "Speaker2 Right"; 68 - audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2", 69 - "SPDIFOUT IN 0", "FRDDR_A OUT 3", 70 - "TDM_C Playback", "TDMOUT_C OUT", 71 - "TDMIN_A IN 2", "TDM_C Capture", 72 - "TDMIN_A IN 5", "TDM_C Loopback", 73 - "TODDR_A IN 0", "TDMIN_A OUT", 74 - "Lineout", "Lineout AOUTL", 75 - "Lineout", "Lineout AOUTR", 76 - "Speaker1 Left", "SPK1 OUT_A", 77 - "Speaker2 Left", "SPK2 OUT_A", 78 - "Speaker1 Right", "SPK1 OUT_B", 79 - "Speaker2 Right", "SPK2 OUT_B", 80 - "Linein AINL", "Linein", 81 - "Linein AINR", "Linein"; 82 - 83 - dai-link@0 { 84 - sound-dai = <&frddr_a>; 85 - }; 86 - 87 - dai-link@1 { 88 - sound-dai = <&toddr_a>; 89 - }; 90 - 91 - dai-link@2 { 92 - sound-dai = <&tdmif_c>; 93 - dai-format = "i2s"; 94 - dai-tdm-slot-tx-mask-2 = <1 1>; 95 - dai-tdm-slot-tx-mask-3 = <1 1>; 96 - dai-tdm-slot-rx-mask-1 = <1 1>; 97 - mclk-fs = <256>; 98 - 99 - codec@0 { 100 - sound-dai = <&lineout>; 101 - }; 102 - 103 - codec@1 { 104 - sound-dai = <&speaker_amp1>; 105 - }; 106 - 107 - codec@2 { 108 - sound-dai = <&speaker_amp2>; 109 - }; 110 - 111 - codec@3 { 112 - sound-dai = <&linein>; 113 - }; 114 - 115 - }; 116 - 117 - dai-link@3 { 118 - sound-dai = <&spdifout>; 119 - 120 - codec { 121 - sound-dai = <&spdif_dit>; 122 - }; 123 - }; 124 - };
+183
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/sound/amlogic,axg-sound-card.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Amlogic AXG sound card 8 + 9 + maintainers: 10 + - Jerome Brunet <jbrunet@baylibre.com> 11 + 12 + properties: 13 + compatible: 14 + const: amlogic,axg-sound-card 15 + 16 + audio-aux-devs: 17 + $ref: /schemas/types.yaml#/definitions/phandle-array 18 + description: list of auxiliary devices 19 + 20 + audio-routing: 21 + $ref: /schemas/types.yaml#/definitions/non-unique-string-array 22 + description: 23 + A list of the connections between audio components. Each entry is a 24 + pair of strings, the first being the connection's sink, the second 25 + being the connection's source. 26 + 27 + audio-widgets: 28 + $ref: /schemas/types.yaml#/definitions/non-unique-string-array 29 + description: 30 + A list off component DAPM widget. Each entry is a pair of strings, 31 + the first being the widget type, the second being the widget name 32 + 33 + model: 34 + $ref: /schemas/types.yaml#/definitions/string 35 + description: User specified audio sound card name 36 + 37 + patternProperties: 38 + "^dai-link-[0-9]+$": 39 + type: object 40 + additionalProperties: false 41 + description: 42 + Container for dai-link level properties and the CODEC sub-nodes. 43 + There should be at least one (and probably more) subnode of this type 44 + 45 + properties: 46 + dai-format: 47 + $ref: /schemas/types.yaml#/definitions/string 48 + enum: [ i2s, left-j, dsp_a ] 49 + 50 + dai-tdm-slot-num: 51 + $ref: /schemas/types.yaml#/definitions/uint32 52 + description: 53 + Number of slots in use. If omitted, slot number is set to 54 + accommodate the largest mask provided. 55 + maximum: 32 56 + 57 + dai-tdm-slot-width: 58 + $ref: /schemas/types.yaml#/definitions/uint32 59 + description: Width in bits for each slot 60 + enum: [ 8, 16, 20, 24, 32 ] 61 + default: 32 62 + 63 + mclk-fs: 64 + $ref: /schemas/types.yaml#/definitions/uint32 65 + description: 66 + Multiplication factor between the frame rate and master clock 67 + rate 68 + 69 + sound-dai: 70 + maxItems: 1 71 + description: phandle of the CPU DAI 72 + 73 + patternProperties: 74 + "^dai-tdm-slot-(t|r)x-mask-[0-3]$": 75 + $ref: /schemas/types.yaml#/definitions/uint32-array 76 + minItems: 1 77 + maxItems: 32 78 + description: 79 + Transmit and receive cpu slot masks of each TDM lane 80 + When omitted, mask is assumed to have to no slots. A valid 81 + interface must have at least one slot, so at least one these 82 + mask should be provided with an enabled slot. 83 + 84 + "^codec(-[0-9]+)?$": 85 + type: object 86 + additionalProperties: false 87 + description: 88 + dai-link representing backend links should have at least one subnode. 89 + One subnode for each codec of the dai-link. dai-link representing 90 + frontend links have no codec, therefore have no subnodes 91 + 92 + properties: 93 + sound-dai: 94 + maxItems: 1 95 + description: phandle of the codec DAI 96 + 97 + patternProperties: 98 + "^dai-tdm-slot-(t|r)x-mask$": 99 + $ref: /schemas/types.yaml#/definitions/uint32-array 100 + minItems: 1 101 + maxItems: 32 102 + description: Transmit and receive codec slot masks 103 + 104 + required: 105 + - sound-dai 106 + 107 + required: 108 + - sound-dai 109 + 110 + required: 111 + - model 112 + - dai-link-0 113 + 114 + unevaluatedProperties: false 115 + 116 + examples: 117 + - | 118 + sound { 119 + compatible = "amlogic,axg-sound-card"; 120 + model = "AXG-S420"; 121 + audio-aux-devs = <&tdmin_a>, <&tdmout_c>; 122 + audio-widgets = "Line", "Lineout", 123 + "Line", "Linein", 124 + "Speaker", "Speaker1 Left", 125 + "Speaker", "Speaker1 Right", 126 + "Speaker", "Speaker2 Left", 127 + "Speaker", "Speaker2 Right"; 128 + audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2", 129 + "SPDIFOUT IN 0", "FRDDR_A OUT 3", 130 + "TDM_C Playback", "TDMOUT_C OUT", 131 + "TDMIN_A IN 2", "TDM_C Capture", 132 + "TDMIN_A IN 5", "TDM_C Loopback", 133 + "TODDR_A IN 0", "TDMIN_A OUT", 134 + "Lineout", "Lineout AOUTL", 135 + "Lineout", "Lineout AOUTR", 136 + "Speaker1 Left", "SPK1 OUT_A", 137 + "Speaker2 Left", "SPK2 OUT_A", 138 + "Speaker1 Right", "SPK1 OUT_B", 139 + "Speaker2 Right", "SPK2 OUT_B", 140 + "Linein AINL", "Linein", 141 + "Linein AINR", "Linein"; 142 + 143 + dai-link-0 { 144 + sound-dai = <&frddr_a>; 145 + }; 146 + 147 + dai-link-1 { 148 + sound-dai = <&toddr_a>; 149 + }; 150 + 151 + dai-link-2 { 152 + sound-dai = <&tdmif_c>; 153 + dai-format = "i2s"; 154 + dai-tdm-slot-tx-mask-2 = <1 1>; 155 + dai-tdm-slot-tx-mask-3 = <1 1>; 156 + dai-tdm-slot-rx-mask-1 = <1 1>; 157 + mclk-fs = <256>; 158 + 159 + codec-0 { 160 + sound-dai = <&lineout>; 161 + }; 162 + 163 + codec-1 { 164 + sound-dai = <&speaker_amp1>; 165 + }; 166 + 167 + codec-2 { 168 + sound-dai = <&speaker_amp2>; 169 + }; 170 + 171 + codec-3 { 172 + sound-dai = <&linein>; 173 + }; 174 + }; 175 + 176 + dai-link-3 { 177 + sound-dai = <&spdifout>; 178 + 179 + codec { 180 + sound-dai = <&spdif_dit>; 181 + }; 182 + }; 183 + };