]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
arm64: dts: qcom: add audio capture support
[karo-tx-linux.git] / arch / arm64 / boot / dts / qcom / apq8016-sbc.dtsi
1 /*
2  * Copyright (c) 2015, The Linux Foundation. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 and
6  * only version 2 as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13
14 #include <dt-bindings/gpio/gpio.h>
15 #include <dt-bindings/input/input.h>
16 #include <dt-bindings/sound/apq8016-lpass.h>
17 #include "msm8916.dtsi"
18 #include "pm8916.dtsi"
19 #include "apq8016-sbc-soc-pins.dtsi"
20 #include "apq8016-sbc-pmic-pins.dtsi"
21 #include "msm8916-mdss.dtsi"
22 / {
23         aliases {
24                 serial0 = &blsp1_uart2;
25                 serial1 = &blsp1_uart1;
26                 usid0 = &pm8916_0;
27                 i2c0    = &blsp_i2c2;
28                 i2c1    = &blsp_i2c6;
29                 i2c3    = &blsp_i2c4;
30         };
31
32         chosen {
33                 stdout-path = "serial0";
34         };
35
36         smd {
37                 rpm {
38                         rpm_requests {
39                                 pm8916-regulators {
40
41                                         vdd_l1_l2_l3-supply = <&pm8916_s3>;
42                                         vdd_l5-supply = <&pm8916_s3>;
43                                         vdd_l4_l5_l6-supply = <&pm8916_s4>;
44                                         vdd_l7-supply = <&pm8916_s4>;
45
46                                         s1 {
47                                                 regulator-min-microvolt = <375000>;
48                                                 regulator-max-microvolt = <1562000>;
49                                                 
50                                         };
51                                         s2 {
52                                                 regulator-min-microvolt = <375000>;
53                                                 regulator-max-microvolt = <1562000>;
54                                                 
55                                         };
56                                         s3 {
57                                                 regulator-min-microvolt = <375000>;
58                                                 regulator-max-microvolt = <1562000>;
59                                                 
60                                         };
61                                         s4 {
62                                                 regulator-min-microvolt = <1800000>;
63                                                 regulator-max-microvolt = <1800000>;
64                                                 
65                                                 regulator-always-on;
66                                                 regulator-boot-on;
67                                         };
68
69                                         l1 {
70                                                 regulator-min-microvolt = <375000>;
71                                                 regulator-max-microvolt = <1525000>;
72                                                 
73                                         };
74                                         l2 {
75                                                 regulator-min-microvolt = <375000>;
76                                                 regulator-max-microvolt = <1525000>;
77                                                 
78                                         };
79                                         l3 {
80                                                 regulator-min-microvolt = <375000>;
81                                                 regulator-max-microvolt = <1525000>;
82                                                 
83                                         };
84                                         l4 {
85                                                 regulator-min-microvolt = <1750000>;
86                                                 regulator-max-microvolt = <3337000>;
87                                                 
88                                         };
89                                         l5 {
90                                                 regulator-min-microvolt = <1750000>;
91                                                 regulator-max-microvolt = <3337000>;
92                                                 
93                                         };
94                                         l6 {
95                                                 regulator-min-microvolt = <1750000>;
96                                                 regulator-max-microvolt = <3337000>;
97                                                 
98                                         };
99                                         l7 {
100                                                 regulator-min-microvolt = <1750000>;
101                                                 regulator-max-microvolt = <3337000>;
102                                                 
103                                         };
104                                         l8 {
105                                                 regulator-min-microvolt = <1750000>;
106                                                 regulator-max-microvolt = <3337000>;
107                                                 
108                                         };
109                                         l9 {
110                                                 regulator-min-microvolt = <1750000>;
111                                                 regulator-max-microvolt = <3337000>;
112                                                 
113                                         };
114                                         l10 {
115                                                 regulator-min-microvolt = <1750000>;
116                                                 regulator-max-microvolt = <3337000>;
117                                                 
118                                         };
119                                         l11 {
120                                                 regulator-min-microvolt = <1750000>;
121                                                 regulator-max-microvolt = <3337000>;
122                                                 
123                                         };
124                                         l12 {
125                                                 regulator-min-microvolt = <1750000>;
126                                                 regulator-max-microvolt = <3337000>;
127                                                 
128                                         };
129                                         l13 {
130                                                 regulator-min-microvolt = <1750000>;
131                                                 regulator-max-microvolt = <3337000>;
132                                                 
133                                         };
134                                         l14 {
135                                                 regulator-min-microvolt = <1750000>;
136                                                 regulator-max-microvolt = <3337000>;
137                                                 
138                                         };
139                                         l15 {
140                                                 regulator-min-microvolt = <1750000>;
141                                                 regulator-max-microvolt = <3337000>;
142                                                 
143                                         };
144                                         l16 {
145                                                 regulator-min-microvolt = <1750000>;
146                                                 regulator-max-microvolt = <3337000>;
147                                                 
148                                         };
149                                         l17 {
150                                                 regulator-min-microvolt = <1750000>;
151                                                 regulator-max-microvolt = <3337000>;
152                                                 
153                                         };
154                                         l18 {
155                                                 regulator-min-microvolt = <1750000>;
156                                                 regulator-max-microvolt = <3337000>;
157                                                 
158                                         };
159                                 };
160                         };
161                 };
162         };
163
164         soc {
165                 serial@78af000 {
166                         label = "LS-UART0";
167                         status = "okay";
168                         pinctrl-names = "default", "sleep";
169                         pinctrl-0 = <&blsp1_uart1_default>;
170                         pinctrl-1 = <&blsp1_uart1_sleep>;
171                 };
172
173                 serial@78b0000 {
174                         label = "LS-UART1";
175                         status = "okay";
176                         pinctrl-names = "default", "sleep";
177                         pinctrl-0 = <&blsp1_uart2_default>;
178                         pinctrl-1 = <&blsp1_uart2_sleep>;
179                 };
180
181                 i2c@78b6000 {
182                 /* On Low speed expansion */
183                         label = "LS-I2C0";
184                         status = "okay";
185                 };
186
187                 i2c@78b8000 {
188                 /* On High speed expansion */
189                         label = "HS-I2C2";
190                         status = "okay";
191                 };
192
193                 i2c@78ba000 {
194                 /* On Low speed expansion */
195                         label = "LS-I2C1";
196                         status = "okay";
197                 };
198
199                 spi@78b7000 {
200                 /* On High speed expansion */
201                         label = "HS-SPI1";
202                         status = "okay";
203                 };
204
205                 spi@78b9000 {
206                 /* On Low speed expansion */
207                         label = "LS-SPI0";
208                         status = "okay";
209                 };
210
211                 leds {
212                         pinctrl-names = "default";
213                         pinctrl-0 = <&msmgpio_leds>,
214                                     <&pm8916_gpios_leds>,
215                                     <&pm8916_mpps_leds>;
216
217                         compatible = "gpio-leds";
218
219                         led@1 {
220                                 label = "apq8016-sbc:green:user1";
221                                 gpios = <&msmgpio 21 GPIO_ACTIVE_HIGH>;
222                                 linux,default-trigger = "heartbeat";
223                                 default-state = "off";
224                         };
225
226                         led@2 {
227                                 label = "apq8016-sbc:green:user2";
228                                 gpios = <&msmgpio 120 GPIO_ACTIVE_HIGH>;
229                                 linux,default-trigger = "mmc0";
230                                 default-state = "off";
231                         };
232
233                         led@3 {
234                                 label = "apq8016-sbc:green:user3";
235                                 gpios = <&pm8916_gpios 1 GPIO_ACTIVE_HIGH>;
236                                 linux,default-trigger = "mmc1";
237                                 default-state = "off";
238                         };
239
240                         led@4 {
241                                 label = "apq8016-sbc:green:user4";
242                                 gpios = <&pm8916_gpios 2 GPIO_ACTIVE_HIGH>;
243                                 linux,default-trigger = "none";
244                                 default-state = "off";
245                         };
246
247                         led@5 {
248                                 label = "apq8016-sbc:yellow:wlan";
249                                 gpios = <&pm8916_mpps 2 GPIO_ACTIVE_HIGH>;
250                                 linux,default-trigger = "wlan";
251                                 default-state = "off";
252                         };
253
254                         led@6 {
255                                 label = "apq8016-sbc:blue:bt";
256                                 gpios = <&pm8916_mpps 3 GPIO_ACTIVE_HIGH>;
257                                 linux,default-trigger = "bt";
258                                 default-state = "off";
259                         };
260                 };
261         };
262
263         usb2513 {
264                 compatible = "smsc,usb3503";
265                 reset-gpios = <&pm8916_gpios 3 GPIO_ACTIVE_LOW>;
266                 initial-mode = <1>;
267         };
268
269         usb_id: usb-id {
270                 interrupt-parent = <&msmgpio>;
271                 compatible = "linux,extcon-usb-gpio";
272                 id-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>;
273                 pinctrl-names = "default";
274                 pinctrl-0 = <&usb_id_default>;
275         };
276
277         gpio_keys {
278                 compatible = "gpio-keys";
279                 #address-cells = <1>;
280                 #size-cells = <0>;
281                 autorepeat;
282
283                 pinctrl-names = "default";
284                 pinctrl-0 = <&msm_key_volp_n_default>;
285
286                 button@0 {
287                         label = "Volume Up";
288                         linux,code = <KEY_VOLUMEUP>;
289                         gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
290                 };
291         };
292 };
293
294 &spmi_pon {
295         // Overwrite RESETIN_N keyboard scan code
296         linux,code = <KEY_VOLUMEDOWN>;
297 };
298
299 &blsp_dma {
300         status = "okay";
301 };
302
303 &blsp_spi3 {
304         status = "okay";
305 };
306
307 &sdhc_1 {
308         vmmc-supply = <&pm8916_l8>;
309         vqmmc-supply = <&pm8916_l5>;
310
311         pinctrl-names = "default", "sleep";
312         pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
313         pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
314         status = "okay";
315 };
316
317 &sdhc_2 {
318         vmmc-supply = <&pm8916_l11>;
319         vqmmc-supply = <&pm8916_l12>;
320
321         pinctrl-names = "default", "sleep";
322         pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
323         pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
324         #address-cells = <0>;
325         interrupt-parent = <&sdhc_2>;
326         interrupts = <0 1 2>;
327         #interrupt-cells = <1>;
328         interrupt-map-mask = <0xffffffff>;
329         interrupt-map = <0 &intc 0 125 0
330                         1 &intc 0 221 0
331                         2 &msmgpio 38 0>;
332         interrupt-names = "hc_irq", "pwr_irq", "status_irq";
333         cd-gpios = <&msmgpio 38 0x1>;
334
335         status = "okay";
336 };
337
338 &usb_dev {
339         extcon = <&usb_id>, <&usb_id>;
340         status = "okay";
341 };
342
343 &usb_host {
344         status = "okay";
345 };
346
347 &sdhc_1 {
348         status = "okay";
349 };
350
351 &usb_otg {
352         extcon = <&usb_id>, <&usb_id>;
353         dr_mode = "otg";
354         status = "okay";
355         switch-gpio = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>; // D+/D- lines: 1 - Routed to HUB, 0 - Device
356         pinctrl-names = "default";
357         pinctrl-0 = <&usb_sw_sel_pm>;
358 };
359
360 &blsp_i2c4 {
361         status = "ok";
362
363         adv_bridge: bridge@39 {
364                 status = "ok";
365                 compatible = "adi,adv7533";
366                 reg = <0x39>;
367                 interrupt-parent = <&msmgpio>;
368                 //interrupts = <31 2>;
369                 avdd-supply = <&pm8916_l6>;
370                 v3p3-supply = <&pm8916_l17>;
371                 adi,dsi-lanes = <4>;
372                 pd-gpios = <&msmgpio 32 0>;
373                 pinctrl-names = "default","sleep";
374                 pinctrl-0 = <&adv7533_int_active &adv7533_switch_active>;
375                 pinctrl-1 = <&adv7533_int_suspend &adv7533_switch_suspend>;
376                 #sound-dai-cells = <1>;
377
378                 port {
379                         adv_in: endpoint {
380                                 remote-endpoint = <&dsi_out>;
381                         };
382                 };
383
384         };
385 };
386
387 &mdss_dsi0 {
388         status = "ok";
389
390         port {
391                 dsi_out: endpoint {
392                         remote-endpoint = <&adv_in>;
393                 };
394         };
395 };
396
397 &lpass {
398         status = "okay";
399 };
400
401 &wcd_codec {
402         status = "okay";
403         clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
404         clock-names = "mclk";
405         digital = <&wcd_digital>;
406 };
407         /*
408         Internal Codec
409                 playback - Primary MI2S
410                 capture - Ter MI2S
411
412         External Primary:
413                 playback - secondary MI2S
414                 capture - Quat MI2S
415
416         External Secondary:
417                 playback - Quat MI2S
418                 capture - Quat MI2S
419
420         */
421 &sound {
422         status = "okay";
423         pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act &cdc_dmic_lines_act>;
424         pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus &cdc_dmic_lines_sus>;
425         pinctrl-names = "default", "sleep";
426         qcom,model = "DB410c";
427         qcom,audio-routing =
428                 "MIC BIAS External", "Handset Mic",
429                 "MIC BIAS Internal2", "Headset Mic",
430                 "MIC BIAS External", "Secondary Mic",
431                 "AMIC1", "MIC BIAS External",
432                 "AMIC2", "MIC BIAS Internal2",
433                 "AMIC3", "MIC BIAS External",
434                 "DMIC1", "MIC BIAS Internal1",
435                 "MIC BIAS Internal1", "Digital Mic1",
436                 "DMIC2", "MIC BIAS Internal1",
437                 "MIC BIAS Internal1", "Digital Mic2";
438
439         /* External Primary or External Secondary -ADV7533 HDMI */
440         external-dai-link@0 {
441                 link-name = "ADV7533";
442
443                 cpu { /* QUAT */
444                         sound-dai = <&lpass MI2S_QUATERNARY>;
445                 };
446                 codec {
447                         sound-dai = <&adv_bridge 0>;
448                 };
449         };
450
451         internal-codec-playback-dai-link@0 {            /* I2S - Internal codec */
452                 link-name = "WCD";
453                 cpu { /* PRIMARY */
454                         sound-dai = <&lpass MI2S_PRIMARY>;
455                 };
456                 codec {
457                         sound-dai = <&wcd_codec 0>;
458                 };
459         };
460
461         internal-codec-capture-dai-link@0 {             /* I2S - Internal codec */
462                 link-name = "WCD-Capture";
463                 cpu { /* PRIMARY */
464                         sound-dai = <&lpass MI2S_TERTIARY>;
465                 };
466                 codec {
467                         sound-dai = <&wcd_codec 1>;
468                 };
469         };
470
471 };
472
473 /* default regulators required for mezzanine boards */
474 &pm8916_l15 {
475         regulator-always-on;
476 };
477
478 &vidc_rproc {
479         status = "okay";
480 };
481
482 &vidc {
483         status = "okay";
484 };