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