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
16allOf:
17  - $ref: sound-card-common.yaml#
18
19properties:
20  compatible:
21    enum:
22      - google,sc7280-herobrine
23
24  "#address-cells":
25    const: 1
26
27  "#size-cells":
28    const: 0
29
30patternProperties:
31  "^dai-link@[0-9a-f]$":
32    description:
33      Each subnode represents a dai link. Subnodes of each dai links would be
34      cpu/codec dais.
35
36    type: object
37
38    properties:
39      link-name:
40        description: Indicates dai-link name and PCM stream name.
41        $ref: /schemas/types.yaml#/definitions/string
42        maxItems: 1
43
44      reg:
45        maxItems: 1
46        description: dai link address.
47
48      cpu:
49        description: Holds subnode which indicates cpu dai.
50        type: object
51        properties:
52          sound-dai: true
53
54        required:
55          - sound-dai
56
57        additionalProperties: false
58
59      codec:
60        description: Holds subnode which indicates codec dai.
61        type: object
62        properties:
63          sound-dai: true
64
65        required:
66          - sound-dai
67
68        additionalProperties: false
69
70      platform:
71        description: Holds subnode which includes the phandle of q6apm platform device.
72        type: object
73        properties:
74          sound-dai:
75            maxItems: 1
76
77        required:
78          - sound-dai
79
80        additionalProperties: false
81
82    required:
83      - link-name
84      - cpu
85      - codec
86      - reg
87
88    additionalProperties: false
89
90required:
91  - compatible
92  - "#address-cells"
93  - "#size-cells"
94
95unevaluatedProperties: false
96
97examples:
98
99  - |
100    #include <dt-bindings/sound/qcom,lpass.h>
101    sound {
102        compatible = "google,sc7280-herobrine";
103        model = "sc7280-wcd938x-max98360a-4dmic";
104
105        audio-routing =
106            "IN1_HPHL", "HPHL_OUT",
107            "IN2_HPHR", "HPHR_OUT",
108            "AMIC1", "MIC BIAS1",
109            "AMIC2", "MIC BIAS2",
110            "VA DMIC0", "MIC BIAS3",
111            "VA DMIC1", "MIC BIAS3",
112            "VA DMIC2", "MIC BIAS4",
113            "VA DMIC3", "MIC BIAS4",
114            "TX SWR_ADC0", "ADC1_OUTPUT",
115            "TX SWR_ADC1", "ADC2_OUTPUT",
116            "TX SWR_ADC2", "ADC3_OUTPUT",
117            "TX SWR_DMIC0", "DMIC1_OUTPUT",
118            "TX SWR_DMIC1", "DMIC2_OUTPUT",
119            "TX SWR_DMIC2", "DMIC3_OUTPUT",
120            "TX SWR_DMIC3", "DMIC4_OUTPUT";
121
122        #address-cells = <1>;
123        #size-cells = <0>;
124
125        dai-link@0 {
126            link-name = "WCD Playback";
127            reg = <LPASS_CDC_DMA_RX0>;
128            cpu {
129                sound-dai = <&lpass_cpu LPASS_CDC_DMA_RX0>;
130            };
131
132            codec {
133                sound-dai = <&wcd938x 0>, <&swr0 0>, <&rxmacro 0>;
134            };
135        };
136        dai-link@1 {
137            link-name = "WCD Capture";
138            reg = <LPASS_CDC_DMA_TX3>;
139            cpu {
140                sound-dai = <&lpass_cpu LPASS_CDC_DMA_TX3>;
141            };
142
143            codec {
144                sound-dai = <&wcd938x 1>, <&swr1 0>, <&txmacro 0>;
145            };
146        };
147
148        dai-link@2 {
149            link-name = "MI2S Playback";
150            reg = <MI2S_SECONDARY>;
151            cpu {
152                sound-dai = <&lpass_cpu MI2S_SECONDARY>;
153            };
154
155            codec {
156                sound-dai = <&max98360a>;
157            };
158        };
159
160        dai-link@3 {
161            link-name = "DMIC Capture";
162            reg = <LPASS_CDC_DMA_VA_TX0>;
163            cpu {
164                sound-dai = <&lpass_cpu LPASS_CDC_DMA_VA_TX0>;
165            };
166
167            codec {
168                sound-dai = <&vamacro 0>;
169            };
170        };
171
172        dai-link@5 {
173            link-name = "DP Playback";
174            reg = <LPASS_DP_RX>;
175            cpu {
176                sound-dai = <&lpass_cpu LPASS_DP_RX>;
177            };
178
179            codec {
180                sound-dai = <&mdss_dp>;
181            };
182        };
183    };
184