Merge tag 'nios2-v4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan...
[sfrench/cifs-2.6.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 "msm8916.dtsi"
15 #include "pm8916.dtsi"
16 #include "apq8016-sbc-soc-pins.dtsi"
17 #include "apq8016-sbc-pmic-pins.dtsi"
18 #include <dt-bindings/gpio/gpio.h>
19 #include <dt-bindings/input/input.h>
20 #include <dt-bindings/sound/apq8016-lpass.h>
21
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         reserved-memory {
39                 ramoops@bff00000{
40                         compatible = "ramoops";
41                         reg = <0x0 0xbff00000 0x0 0x100000>;
42
43                         record-size = <0x20000>;
44                         console-size = <0x20000>;
45                         ftrace-size = <0x20000>;
46                 };
47         };
48
49         soc {
50                 dma@7884000 {
51                         status = "okay";
52                 };
53
54                 serial@78af000 {
55                         label = "LS-UART0";
56                         status = "okay";
57                         pinctrl-names = "default", "sleep";
58                         pinctrl-0 = <&blsp1_uart1_default>;
59                         pinctrl-1 = <&blsp1_uart1_sleep>;
60                 };
61
62                 serial@78b0000 {
63                         label = "LS-UART1";
64                         status = "okay";
65                         pinctrl-names = "default", "sleep";
66                         pinctrl-0 = <&blsp1_uart2_default>;
67                         pinctrl-1 = <&blsp1_uart2_sleep>;
68                 };
69
70                 i2c@78b6000 {
71                 /* On Low speed expansion */
72                         label = "LS-I2C0";
73                         status = "okay";
74                 };
75
76                 i2c@78b8000 {
77                 /* On High speed expansion */
78                         label = "HS-I2C2";
79                         status = "okay";
80
81                         adv_bridge: bridge@39 {
82                                 status = "okay";
83
84                                 compatible = "adi,adv7533";
85                                 reg = <0x39>;
86
87                                 interrupt-parent = <&msmgpio>;
88                                 interrupts = <31 2>;
89
90                                 adi,dsi-lanes = <4>;
91
92                                 pd-gpios = <&msmgpio 32 0>;
93
94                                 avdd-supply = <&pm8916_l6>;
95                                 v1p2-supply = <&pm8916_l6>;
96                                 v3p3-supply = <&pm8916_l17>;
97
98                                 pinctrl-names = "default","sleep";
99                                 pinctrl-0 = <&adv7533_int_active &adv7533_switch_active>;
100                                 pinctrl-1 = <&adv7533_int_suspend &adv7533_switch_suspend>;
101                                 #sound-dai-cells = <1>;
102
103                                 ports {
104                                         #address-cells = <1>;
105                                         #size-cells = <0>;
106
107                                         port@0 {
108                                                 reg = <0>;
109                                                 adv7533_in: endpoint {
110                                                         remote-endpoint = <&dsi0_out>;
111                                                 };
112                                         };
113
114                                         port@1 {
115                                                 reg = <1>;
116                                                 adv7533_out: endpoint {
117                                                         remote-endpoint = <&hdmi_con>;
118                                                 };
119                                         };
120                                 };
121                         };
122                 };
123
124                 i2c@78ba000 {
125                 /* On Low speed expansion */
126                         label = "LS-I2C1";
127                         status = "okay";
128                 };
129
130                 spi@78b7000 {
131                 /* On High speed expansion */
132                         label = "HS-SPI1";
133                         status = "okay";
134                 };
135
136                 spi@78b9000 {
137                 /* On Low speed expansion */
138                         label = "LS-SPI0";
139                         status = "okay";
140                 };
141
142                 leds {
143                         pinctrl-names = "default";
144                         pinctrl-0 = <&msmgpio_leds>,
145                                     <&pm8916_gpios_leds>,
146                                     <&pm8916_mpps_leds>;
147
148                         compatible = "gpio-leds";
149
150                         led@1 {
151                                 label = "apq8016-sbc:green:user1";
152                                 gpios = <&msmgpio 21 GPIO_ACTIVE_HIGH>;
153                                 linux,default-trigger = "heartbeat";
154                                 default-state = "off";
155                         };
156
157                         led@2 {
158                                 label = "apq8016-sbc:green:user2";
159                                 gpios = <&msmgpio 120 GPIO_ACTIVE_HIGH>;
160                                 linux,default-trigger = "mmc0";
161                                 default-state = "off";
162                         };
163
164                         led@3 {
165                                 label = "apq8016-sbc:green:user3";
166                                 gpios = <&pm8916_gpios 1 GPIO_ACTIVE_HIGH>;
167                                 linux,default-trigger = "mmc1";
168                                 default-state = "off";
169                         };
170
171                         led@4 {
172                                 label = "apq8016-sbc:green:user4";
173                                 gpios = <&pm8916_gpios 2 GPIO_ACTIVE_HIGH>;
174                                 linux,default-trigger = "none";
175                                 default-state = "off";
176                         };
177
178                         led@5 {
179                                 label = "apq8016-sbc:yellow:wlan";
180                                 gpios = <&pm8916_mpps 2 GPIO_ACTIVE_HIGH>;
181                                 linux,default-trigger = "wlan";
182                                 default-state = "off";
183                         };
184
185                         led@6 {
186                                 label = "apq8016-sbc:blue:bt";
187                                 gpios = <&pm8916_mpps 3 GPIO_ACTIVE_HIGH>;
188                                 linux,default-trigger = "bt";
189                                 default-state = "off";
190                         };
191                 };
192
193                 sdhci@07824000 {
194                         vmmc-supply = <&pm8916_l8>;
195                         vqmmc-supply = <&pm8916_l5>;
196
197                         pinctrl-names = "default", "sleep";
198                         pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
199                         pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
200                         status = "okay";
201                 };
202
203                 sdhci@07864000 {
204                         vmmc-supply = <&pm8916_l11>;
205                         vqmmc-supply = <&pm8916_l12>;
206
207                         pinctrl-names = "default", "sleep";
208                         pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
209                         pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
210
211                         cd-gpios = <&msmgpio 38 0x1>;
212                         status = "okay";
213                 };
214
215                 usb@78d9000 {
216                         extcon = <&usb_id>, <&usb_id>;
217                         status = "okay";
218                 };
219
220                 ehci@78d9000 {
221                         status = "okay";
222                 };
223
224                 phy@78d9000 {
225                         v1p8-supply = <&pm8916_l7>;
226                         v3p3-supply = <&pm8916_l13>;
227                         vddcx-supply = <&pm8916_s1>;
228                         extcon = <&usb_id>, <&usb_id>;
229                         dr_mode = "otg";
230                         status = "okay";
231                         switch-gpio = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
232                         pinctrl-names = "default";
233                         pinctrl-0 = <&usb_sw_sel_pm>;
234                 };
235
236                 lpass@07708000 {
237                         status = "okay";
238                 };
239
240                 mdss@1a00000 {
241                         status = "okay";
242
243                         mdp@1a01000 {
244                                 status = "okay";
245                         };
246
247                         dsi@1a98000 {
248                                 status = "okay";
249
250                                 vdda-supply = <&pm8916_l2>;
251                                 vddio-supply = <&pm8916_l6>;
252
253                                 ports {
254                                         port@1 {
255                                                 endpoint {
256                                                         remote-endpoint = <&adv7533_in>;
257                                                         data-lanes = <0 1 2 3>;
258                                                 };
259                                         };
260                                 };
261                         };
262
263                         dsi-phy@1a98300 {
264                                 status = "okay";
265
266                                 vddio-supply = <&pm8916_l6>;
267                         };
268                 };
269
270                 lpass_codec: codec{
271                         status = "okay";
272                 };
273
274                 /*
275                 Internal Codec
276                         playback - Primary MI2S
277                         capture - Ter MI2S
278
279                 External Primary:
280                         playback - secondary MI2S
281                         capture - Quat MI2S
282
283                 External Secondary:
284                         playback - Quat MI2S
285                         capture - Quat MI2S
286
287                 */
288
289                 sound: sound {
290                         compatible = "qcom,apq8016-sbc-sndcard";
291                         reg = <0x07702000 0x4>, <0x07702004 0x4>;
292                         reg-names = "mic-iomux", "spkr-iomux";
293
294                         status = "okay";
295                         pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
296                         pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
297                         pinctrl-names = "default", "sleep";
298                         qcom,model = "DB410c";
299                         qcom,audio-routing =
300                                 "AMIC2", "MIC BIAS Internal2",
301                                 "AMIC3", "MIC BIAS External1";
302                         external-dai-link@0 {
303                                 link-name = "ADV7533";
304                                 cpu { /* QUAT */
305                                         sound-dai = <&lpass MI2S_QUATERNARY>;
306                                 };
307                                 codec {
308                                         sound-dai = <&adv_bridge 0>;
309                                 };
310                         };
311
312                         internal-codec-playback-dai-link@0 {            /* I2S - Internal codec */
313                                 link-name = "WCD";
314                                 cpu { /* PRIMARY */
315                                         sound-dai = <&lpass MI2S_PRIMARY>;
316                                 };
317                                 codec {
318                                         sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
319                                 };
320                         };
321
322                         internal-codec-capture-dai-link@0 {             /* I2S - Internal codec */
323                                 link-name = "WCD-Capture";
324                                 cpu { /* PRIMARY */
325                                         sound-dai = <&lpass MI2S_TERTIARY>;
326                                 };
327                                 codec {
328                                         sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
329                                 };
330                         };
331                 };
332
333                 wcnss@a21b000 {
334                         status = "okay";
335                 };
336         };
337
338         usb2513 {
339                 compatible = "smsc,usb3503";
340                 reset-gpios = <&pm8916_gpios 3 GPIO_ACTIVE_LOW>;
341                 initial-mode = <1>;
342         };
343
344         usb_id: usb-id {
345                 compatible = "linux,extcon-usb-gpio";
346                 id-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>;
347                 pinctrl-names = "default";
348                 pinctrl-0 = <&usb_id_default>;
349         };
350
351         hdmi-out {
352                 compatible = "hdmi-connector";
353                 type = "a";
354
355                 port {
356                         hdmi_con: endpoint {
357                                 remote-endpoint = <&adv7533_out>;
358                         };
359                 };
360         };
361
362         gpio_keys {
363                 compatible = "gpio-keys";
364                 #address-cells = <1>;
365                 #size-cells = <0>;
366                 autorepeat;
367
368                 pinctrl-names = "default";
369                 pinctrl-0 = <&msm_key_volp_n_default>;
370
371                 button@0 {
372                         label = "Volume Up";
373                         linux,code = <KEY_VOLUMEUP>;
374                         gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
375                 };
376         };
377 };
378
379 &wcd_codec {
380         status = "okay";
381         clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
382         clock-names = "mclk";
383 };
384
385 &smd_rpm_regulators {
386         vdd_l1_l2_l3-supply = <&pm8916_s3>;
387         vdd_l5-supply = <&pm8916_s3>;
388         vdd_l4_l5_l6-supply = <&pm8916_s4>;
389         vdd_l7-supply = <&pm8916_s4>;
390
391         s1 {
392                 regulator-min-microvolt = <375000>;
393                 regulator-max-microvolt = <1562000>;
394         };
395
396         s3 {
397                 regulator-min-microvolt = <375000>;
398                 regulator-max-microvolt = <1562000>;
399         };
400
401         s4 {
402                 regulator-min-microvolt = <1800000>;
403                 regulator-max-microvolt = <1800000>;
404
405                 regulator-always-on;
406                 regulator-boot-on;
407         };
408
409         l1 {
410                 regulator-min-microvolt = <375000>;
411                 regulator-max-microvolt = <1525000>;
412         };
413
414         l2 {
415                 regulator-min-microvolt = <1200000>;
416                 regulator-max-microvolt = <1200000>;
417         };
418
419         l3 {
420                 regulator-min-microvolt = <375000>;
421                 regulator-max-microvolt = <1525000>;
422         };
423
424         l4 {
425                 regulator-min-microvolt = <1750000>;
426                 regulator-max-microvolt = <3337000>;
427         };
428
429         l5 {
430                 regulator-min-microvolt = <1750000>;
431                 regulator-max-microvolt = <3337000>;
432         };
433
434         l6 {
435                 regulator-min-microvolt = <1800000>;
436                 regulator-max-microvolt = <1800000>;
437         };
438
439         l7 {
440                 regulator-min-microvolt = <1750000>;
441                 regulator-max-microvolt = <3337000>;
442         };
443
444         l8 {
445                 regulator-min-microvolt = <1750000>;
446                 regulator-max-microvolt = <3337000>;
447         };
448
449         l9 {
450                 regulator-min-microvolt = <1750000>;
451                 regulator-max-microvolt = <3337000>;
452         };
453
454         l10 {
455                 regulator-min-microvolt = <1750000>;
456                 regulator-max-microvolt = <3337000>;
457         };
458
459         l11 {
460                 regulator-min-microvolt = <1750000>;
461                 regulator-max-microvolt = <3337000>;
462         };
463
464         l12 {
465                 regulator-min-microvolt = <1750000>;
466                 regulator-max-microvolt = <3337000>;
467         };
468
469         l13 {
470                 regulator-min-microvolt = <1750000>;
471                 regulator-max-microvolt = <3337000>;
472         };
473
474         l14 {
475                 regulator-min-microvolt = <1750000>;
476                 regulator-max-microvolt = <3337000>;
477         };
478
479         /**
480          * 1.8v required on LS expansion
481          * for mezzanine boards
482          */
483         l15 {
484                 regulator-min-microvolt = <1750000>;
485                 regulator-max-microvolt = <3337000>;
486                 regulator-always-on;
487         };
488
489         l16 {
490                 regulator-min-microvolt = <1750000>;
491                 regulator-max-microvolt = <3337000>;
492         };
493
494         l17 {
495                 regulator-min-microvolt = <3300000>;
496                 regulator-max-microvolt = <3300000>;
497         };
498
499         l18 {
500                 regulator-min-microvolt = <1750000>;
501                 regulator-max-microvolt = <3337000>;
502         };
503 };