xref: /freebsd/sys/contrib/device-tree/Bindings/sound/qcom,apq8016-sbc-sndcard.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1*b2d2a78aSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*b2d2a78aSEmmanuel Vadot%YAML 1.2
3*b2d2a78aSEmmanuel Vadot---
4*b2d2a78aSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/qcom,apq8016-sbc-sndcard.yaml#
5*b2d2a78aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*b2d2a78aSEmmanuel Vadot
7*b2d2a78aSEmmanuel Vadottitle: Qualcomm APQ8016 and similar sound cards
8*b2d2a78aSEmmanuel Vadot
9*b2d2a78aSEmmanuel Vadotmaintainers:
10*b2d2a78aSEmmanuel Vadot  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11*b2d2a78aSEmmanuel Vadot  - Stephan Gerhold <stephan@gerhold.net>
12*b2d2a78aSEmmanuel Vadot
13*b2d2a78aSEmmanuel Vadotproperties:
14*b2d2a78aSEmmanuel Vadot  compatible:
15*b2d2a78aSEmmanuel Vadot    enum:
16*b2d2a78aSEmmanuel Vadot      - qcom,apq8016-sbc-sndcard
17*b2d2a78aSEmmanuel Vadot      - qcom,msm8916-qdsp6-sndcard
18*b2d2a78aSEmmanuel Vadot
19*b2d2a78aSEmmanuel Vadot  reg:
20*b2d2a78aSEmmanuel Vadot    items:
21*b2d2a78aSEmmanuel Vadot      - description: Microphone I/O mux register address
22*b2d2a78aSEmmanuel Vadot      - description: Speaker I/O mux register address
23*b2d2a78aSEmmanuel Vadot
24*b2d2a78aSEmmanuel Vadot  reg-names:
25*b2d2a78aSEmmanuel Vadot    items:
26*b2d2a78aSEmmanuel Vadot      - const: mic-iomux
27*b2d2a78aSEmmanuel Vadot      - const: spkr-iomux
28*b2d2a78aSEmmanuel Vadot
29*b2d2a78aSEmmanuel Vadot  audio-routing:
30*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
31*b2d2a78aSEmmanuel Vadot    description:
32*b2d2a78aSEmmanuel Vadot      A list of the connections between audio components. Each entry is a
33*b2d2a78aSEmmanuel Vadot      pair of strings, the first being the connection's sink, the second
34*b2d2a78aSEmmanuel Vadot      being the connection's source. Valid names could be power supplies,
35*b2d2a78aSEmmanuel Vadot      MicBias of codec and the jacks on the board.
36*b2d2a78aSEmmanuel Vadot
37*b2d2a78aSEmmanuel Vadot  aux-devs:
38*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle-array
39*b2d2a78aSEmmanuel Vadot    description: |
40*b2d2a78aSEmmanuel Vadot      List of phandles pointing to auxiliary devices, such
41*b2d2a78aSEmmanuel Vadot      as amplifiers, to be added to the sound card.
42*b2d2a78aSEmmanuel Vadot
43*b2d2a78aSEmmanuel Vadot  model:
44*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
45*b2d2a78aSEmmanuel Vadot    description: User visible long sound card name
46*b2d2a78aSEmmanuel Vadot
47*b2d2a78aSEmmanuel Vadot  pin-switches:
48*b2d2a78aSEmmanuel Vadot    description: List of widget names for which pin switches should be created.
49*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string-array
50*b2d2a78aSEmmanuel Vadot
51*b2d2a78aSEmmanuel Vadot  widgets:
52*b2d2a78aSEmmanuel Vadot    description: User specified audio sound widgets.
53*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
54*b2d2a78aSEmmanuel Vadot
55*b2d2a78aSEmmanuel VadotpatternProperties:
56*b2d2a78aSEmmanuel Vadot  ".*-dai-link$":
57*b2d2a78aSEmmanuel Vadot    description:
58*b2d2a78aSEmmanuel Vadot      Each subnode represents a dai link. Subnodes of each dai links would be
59*b2d2a78aSEmmanuel Vadot      cpu/codec dais.
60*b2d2a78aSEmmanuel Vadot
61*b2d2a78aSEmmanuel Vadot    type: object
62*b2d2a78aSEmmanuel Vadot
63*b2d2a78aSEmmanuel Vadot    properties:
64*b2d2a78aSEmmanuel Vadot      link-name:
65*b2d2a78aSEmmanuel Vadot        description: Indicates dai-link name and PCM stream name.
66*b2d2a78aSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/string
67*b2d2a78aSEmmanuel Vadot        maxItems: 1
68*b2d2a78aSEmmanuel Vadot
69*b2d2a78aSEmmanuel Vadot      cpu:
70*b2d2a78aSEmmanuel Vadot        description: Holds subnode which indicates cpu dai.
71*b2d2a78aSEmmanuel Vadot        type: object
72*b2d2a78aSEmmanuel Vadot        additionalProperties: false
73*b2d2a78aSEmmanuel Vadot
74*b2d2a78aSEmmanuel Vadot        properties:
75*b2d2a78aSEmmanuel Vadot          sound-dai:
76*b2d2a78aSEmmanuel Vadot            maxItems: 1
77*b2d2a78aSEmmanuel Vadot
78*b2d2a78aSEmmanuel Vadot      platform:
79*b2d2a78aSEmmanuel Vadot        description: Holds subnode which indicates platform dai.
80*b2d2a78aSEmmanuel Vadot        type: object
81*b2d2a78aSEmmanuel Vadot        additionalProperties: false
82*b2d2a78aSEmmanuel Vadot
83*b2d2a78aSEmmanuel Vadot        properties:
84*b2d2a78aSEmmanuel Vadot          sound-dai:
85*b2d2a78aSEmmanuel Vadot            maxItems: 1
86*b2d2a78aSEmmanuel Vadot
87*b2d2a78aSEmmanuel Vadot      codec:
88*b2d2a78aSEmmanuel Vadot        description: Holds subnode which indicates codec dai.
89*b2d2a78aSEmmanuel Vadot        type: object
90*b2d2a78aSEmmanuel Vadot        additionalProperties: false
91*b2d2a78aSEmmanuel Vadot
92*b2d2a78aSEmmanuel Vadot        properties:
93*b2d2a78aSEmmanuel Vadot          sound-dai:
94*b2d2a78aSEmmanuel Vadot            minItems: 1
95*b2d2a78aSEmmanuel Vadot            maxItems: 8
96*b2d2a78aSEmmanuel Vadot
97*b2d2a78aSEmmanuel Vadot    required:
98*b2d2a78aSEmmanuel Vadot      - link-name
99*b2d2a78aSEmmanuel Vadot      - cpu
100*b2d2a78aSEmmanuel Vadot
101*b2d2a78aSEmmanuel Vadot    additionalProperties: false
102*b2d2a78aSEmmanuel Vadot
103*b2d2a78aSEmmanuel Vadotrequired:
104*b2d2a78aSEmmanuel Vadot  - compatible
105*b2d2a78aSEmmanuel Vadot  - reg
106*b2d2a78aSEmmanuel Vadot  - reg-names
107*b2d2a78aSEmmanuel Vadot  - model
108*b2d2a78aSEmmanuel Vadot
109*b2d2a78aSEmmanuel VadotadditionalProperties: false
110*b2d2a78aSEmmanuel Vadot
111*b2d2a78aSEmmanuel Vadotexamples:
112*b2d2a78aSEmmanuel Vadot  - |
113*b2d2a78aSEmmanuel Vadot    #include <dt-bindings/sound/qcom,lpass.h>
114*b2d2a78aSEmmanuel Vadot    sound@7702000 {
115*b2d2a78aSEmmanuel Vadot        compatible = "qcom,apq8016-sbc-sndcard";
116*b2d2a78aSEmmanuel Vadot        reg = <0x07702000 0x4>, <0x07702004 0x4>;
117*b2d2a78aSEmmanuel Vadot        reg-names = "mic-iomux", "spkr-iomux";
118*b2d2a78aSEmmanuel Vadot
119*b2d2a78aSEmmanuel Vadot        model = "DB410c";
120*b2d2a78aSEmmanuel Vadot        audio-routing =
121*b2d2a78aSEmmanuel Vadot            "AMIC2", "MIC BIAS Internal2",
122*b2d2a78aSEmmanuel Vadot            "AMIC3", "MIC BIAS External1";
123*b2d2a78aSEmmanuel Vadot
124*b2d2a78aSEmmanuel Vadot        pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
125*b2d2a78aSEmmanuel Vadot        pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
126*b2d2a78aSEmmanuel Vadot        pinctrl-names = "default", "sleep";
127*b2d2a78aSEmmanuel Vadot
128*b2d2a78aSEmmanuel Vadot        quaternary-dai-link {
129*b2d2a78aSEmmanuel Vadot            link-name = "ADV7533";
130*b2d2a78aSEmmanuel Vadot            cpu {
131*b2d2a78aSEmmanuel Vadot                sound-dai = <&lpass MI2S_QUATERNARY>;
132*b2d2a78aSEmmanuel Vadot            };
133*b2d2a78aSEmmanuel Vadot            codec {
134*b2d2a78aSEmmanuel Vadot                sound-dai = <&adv_bridge 0>;
135*b2d2a78aSEmmanuel Vadot            };
136*b2d2a78aSEmmanuel Vadot        };
137*b2d2a78aSEmmanuel Vadot
138*b2d2a78aSEmmanuel Vadot        primary-dai-link {
139*b2d2a78aSEmmanuel Vadot            link-name = "WCD";
140*b2d2a78aSEmmanuel Vadot            cpu {
141*b2d2a78aSEmmanuel Vadot                sound-dai = <&lpass MI2S_PRIMARY>;
142*b2d2a78aSEmmanuel Vadot            };
143*b2d2a78aSEmmanuel Vadot            codec {
144*b2d2a78aSEmmanuel Vadot                sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
145*b2d2a78aSEmmanuel Vadot            };
146*b2d2a78aSEmmanuel Vadot        };
147*b2d2a78aSEmmanuel Vadot
148*b2d2a78aSEmmanuel Vadot        tertiary-dai-link {
149*b2d2a78aSEmmanuel Vadot            link-name = "WCD-Capture";
150*b2d2a78aSEmmanuel Vadot            cpu {
151*b2d2a78aSEmmanuel Vadot                sound-dai = <&lpass MI2S_TERTIARY>;
152*b2d2a78aSEmmanuel Vadot            };
153*b2d2a78aSEmmanuel Vadot            codec {
154*b2d2a78aSEmmanuel Vadot                sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
155*b2d2a78aSEmmanuel Vadot            };
156*b2d2a78aSEmmanuel Vadot        };
157*b2d2a78aSEmmanuel Vadot    };
158*b2d2a78aSEmmanuel Vadot
159*b2d2a78aSEmmanuel Vadot  - |
160*b2d2a78aSEmmanuel Vadot    #include <dt-bindings/sound/qcom,q6afe.h>
161*b2d2a78aSEmmanuel Vadot    #include <dt-bindings/sound/qcom,q6asm.h>
162*b2d2a78aSEmmanuel Vadot    sound@7702000 {
163*b2d2a78aSEmmanuel Vadot        compatible = "qcom,msm8916-qdsp6-sndcard";
164*b2d2a78aSEmmanuel Vadot        reg = <0x07702000 0x4>, <0x07702004 0x4>;
165*b2d2a78aSEmmanuel Vadot        reg-names = "mic-iomux", "spkr-iomux";
166*b2d2a78aSEmmanuel Vadot
167*b2d2a78aSEmmanuel Vadot        model = "msm8916";
168*b2d2a78aSEmmanuel Vadot        widgets =
169*b2d2a78aSEmmanuel Vadot            "Speaker", "Speaker",
170*b2d2a78aSEmmanuel Vadot            "Headphone", "Headphones";
171*b2d2a78aSEmmanuel Vadot        pin-switches = "Speaker";
172*b2d2a78aSEmmanuel Vadot        audio-routing =
173*b2d2a78aSEmmanuel Vadot            "Speaker", "Speaker Amp OUT",
174*b2d2a78aSEmmanuel Vadot            "Speaker Amp IN", "HPH_R",
175*b2d2a78aSEmmanuel Vadot            "Headphones", "HPH_L",
176*b2d2a78aSEmmanuel Vadot            "Headphones", "HPH_R",
177*b2d2a78aSEmmanuel Vadot            "AMIC1", "MIC BIAS Internal1",
178*b2d2a78aSEmmanuel Vadot            "AMIC2", "MIC BIAS Internal2",
179*b2d2a78aSEmmanuel Vadot            "AMIC3", "MIC BIAS Internal3";
180*b2d2a78aSEmmanuel Vadot        aux-devs = <&speaker_amp>;
181*b2d2a78aSEmmanuel Vadot
182*b2d2a78aSEmmanuel Vadot        pinctrl-names = "default", "sleep";
183*b2d2a78aSEmmanuel Vadot        pinctrl-0 = <&cdc_pdm_lines_act>;
184*b2d2a78aSEmmanuel Vadot        pinctrl-1 = <&cdc_pdm_lines_sus>;
185*b2d2a78aSEmmanuel Vadot
186*b2d2a78aSEmmanuel Vadot        mm1-dai-link {
187*b2d2a78aSEmmanuel Vadot            link-name = "MultiMedia1";
188*b2d2a78aSEmmanuel Vadot            cpu {
189*b2d2a78aSEmmanuel Vadot                sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
190*b2d2a78aSEmmanuel Vadot            };
191*b2d2a78aSEmmanuel Vadot        };
192*b2d2a78aSEmmanuel Vadot
193*b2d2a78aSEmmanuel Vadot        primary-dai-link {
194*b2d2a78aSEmmanuel Vadot            link-name = "Primary MI2S";
195*b2d2a78aSEmmanuel Vadot            cpu {
196*b2d2a78aSEmmanuel Vadot                sound-dai = <&q6afedai PRIMARY_MI2S_RX>;
197*b2d2a78aSEmmanuel Vadot            };
198*b2d2a78aSEmmanuel Vadot            platform {
199*b2d2a78aSEmmanuel Vadot                sound-dai = <&q6routing>;
200*b2d2a78aSEmmanuel Vadot            };
201*b2d2a78aSEmmanuel Vadot            codec {
202*b2d2a78aSEmmanuel Vadot                sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
203*b2d2a78aSEmmanuel Vadot            };
204*b2d2a78aSEmmanuel Vadot        };
205*b2d2a78aSEmmanuel Vadot    };
206