1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/google,sc7280-herobrine.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Google SC7280-Herobrine ASoC sound card driver
8
9maintainers:
10  - Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
11  - Judy Hsiao <judyhsiao@chromium.org>
12
13description:
14  This binding describes the SC7280 sound card which uses LPASS for audio.
15
16properties:
17  compatible:
18    enum:
19      - google,sc7280-herobrine
20
21  audio-routing:
22    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
23    description:
24      A list of the connections between audio components. Each entry is a
25      pair of strings, the first being the connection's sink, the second
26      being the connection's source.
27
28  model:
29    $ref: /schemas/types.yaml#/definitions/string
30    description: User specified audio sound card name
31
32  "#address-cells":
33    const: 1
34
35  "#size-cells":
36    const: 0
37
38patternProperties:
39  "^dai-link@[0-9a-f]$":
40    description:
41      Each subnode represents a dai link. Subnodes of each dai links would be
42      cpu/codec dais.
43
44    type: object
45
46    properties:
47      link-name:
48        description: Indicates dai-link name and PCM stream name.
49        $ref: /schemas/types.yaml#/definitions/string
50        maxItems: 1
51
52      reg:
53        maxItems: 1
54        description: dai link address.
55
56      cpu:
57        description: Holds subnode which indicates cpu dai.
58        type: object
59        properties:
60          sound-dai: true
61
62        required:
63          - sound-dai
64
65        additionalProperties: false
66
67      codec:
68        description: Holds subnode which indicates codec dai.
69        type: object
70        properties:
71          sound-dai: true
72
73        required:
74          - sound-dai
75
76        additionalProperties: false
77
78    required:
79      - link-name
80      - cpu
81      - codec
82      - reg
83
84    additionalProperties: false
85
86required:
87  - compatible
88  - model
89  - "#address-cells"
90  - "#size-cells"
91
92additionalProperties: false
93
94examples:
95
96  - |
97    #include <dt-bindings/sound/qcom,lpass.h>
98    sound {
99        compatible = "google,sc7280-herobrine";
100        model = "sc7280-wcd938x-max98360a-4dmic";
101
102        audio-routing =
103            "IN1_HPHL", "HPHL_OUT",
104            "IN2_HPHR", "HPHR_OUT",
105            "AMIC1", "MIC BIAS1",
106            "AMIC2", "MIC BIAS2",
107            "VA DMIC0", "MIC BIAS3",
108            "VA DMIC1", "MIC BIAS3",
109            "VA DMIC2", "MIC BIAS4",
110            "VA DMIC3", "MIC BIAS4",
111            "TX SWR_ADC0", "ADC1_OUTPUT",
112            "TX SWR_ADC1", "ADC2_OUTPUT",
113            "TX SWR_ADC2", "ADC3_OUTPUT",
114            "TX SWR_DMIC0", "DMIC1_OUTPUT",
115            "TX SWR_DMIC1", "DMIC2_OUTPUT",
116            "TX SWR_DMIC2", "DMIC3_OUTPUT",
117            "TX SWR_DMIC3", "DMIC4_OUTPUT";
118
119        #address-cells = <1>;
120        #size-cells = <0>;
121
122        dai-link@0 {
123            link-name = "WCD Playback";
124            reg = <LPASS_CDC_DMA_RX0>;
125            cpu {
126                sound-dai = <&lpass_cpu LPASS_CDC_DMA_RX0>;
127            };
128
129            codec {
130                sound-dai = <&wcd938x 0>, <&swr0 0>, <&rxmacro 0>;
131            };
132        };
133        dai-link@1 {
134            link-name = "WCD Capture";
135            reg = <LPASS_CDC_DMA_TX3>;
136            cpu {
137                sound-dai = <&lpass_cpu LPASS_CDC_DMA_TX3>;
138            };
139
140            codec {
141                sound-dai = <&wcd938x 1>, <&swr1 0>, <&txmacro 0>;
142            };
143        };
144
145        dai-link@2 {
146            link-name = "MI2S Playback";
147            reg = <MI2S_SECONDARY>;
148            cpu {
149                sound-dai = <&lpass_cpu MI2S_SECONDARY>;
150            };
151
152            codec {
153                sound-dai = <&max98360a>;
154            };
155        };
156
157        dai-link@3 {
158            link-name = "DMIC Capture";
159            reg = <LPASS_CDC_DMA_VA_TX0>;
160            cpu {
161                sound-dai = <&lpass_cpu LPASS_CDC_DMA_VA_TX0>;
162            };
163
164            codec {
165                sound-dai = <&vamacro 0>;
166            };
167        };
168
169        dai-link@5 {
170            link-name = "DP Playback";
171            reg = <LPASS_DP_RX>;
172            cpu {
173                sound-dai = <&lpass_cpu LPASS_DP_RX>;
174            };
175
176            codec {
177                sound-dai = <&mdss_dp>;
178            };
179        };
180    };
181