Merge tag 'regmap-fix-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / arm / boot / dts / qcom-apq8060-dragonboard.dts
1 /*
2  * Copyright 2016 Linaro Ltd
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22
23 #include <dt-bindings/input/input.h>
24 #include <dt-bindings/gpio/gpio.h>
25 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
26 #include "qcom-msm8660.dtsi"
27
28 / {
29         model = "Qualcomm APQ8060 Dragonboard";
30         compatible = "qcom,apq8060-dragonboard", "qcom,msm8660";
31
32         aliases {
33                 serial0 = &gsbi12_serial;
34         };
35
36         chosen {
37                 stdout-path = "serial0:115200n8";
38         };
39
40         regulators {
41                 compatible = "simple-bus";
42
43                 /* Main power of the board: 3.7V */
44                 vph: regulator-fixed {
45                         compatible = "regulator-fixed";
46                         regulator-min-microvolt = <3700000>;
47                         regulator-max-microvolt = <3700000>;
48                         regulator-name = "VPH";
49                         regulator-type = "voltage";
50                         regulator-always-on;
51                         regulator-boot-on;
52                 };
53
54                 /* This is a levelshifter for SDCC5 */
55                 dragon_vio_txb: txb0104rgyr {
56                         compatible = "regulator-fixed";
57                         regulator-name = "Dragon SDCC levelshifter";
58                         vin-supply = <&pm8058_l14>;
59                         regulator-always-on;
60                 };
61         };
62
63         soc {
64                 pinctrl@800000 {
65                         /* eMMMC pins, all 8 data lines connected */
66                         dragon_sdcc1_pins: sdcc1 {
67                                 mux {
68                                         pins = "gpio159", "gpio160", "gpio161",
69                                              "gpio162", "gpio163", "gpio164",
70                                              "gpio165", "gpio166", "gpio167",
71                                              "gpio168";
72                                              function = "sdc1";
73                                 };
74                                 clk {
75                                         pins = "gpio167"; /* SDC5 CLK */
76                                         drive-strength = <16>;
77                                         bias-disable;
78                                 };
79                                 cmd {
80                                         pins = "gpio168"; /* SDC5 CMD */
81                                         drive-strength = <10>;
82                                         bias-pull-up;
83                                 };
84                                 data {
85                                         /* SDC5 D0 to D7 */
86                                         pins = "gpio159", "gpio160", "gpio161", "gpio162",
87                                              "gpio163", "gpio164", "gpio165", "gpio166";
88                                         drive-strength = <10>;
89                                         bias-pull-up;
90                                 };
91                         };
92
93                         /*
94                          * The SDCC3 pins are hardcoded (non-muxable) but need some pin
95                          * configuration.
96                          */
97                         dragon_sdcc3_pins: sdcc3 {
98                                 clk {
99                                         pins = "sdc3_clk";
100                                         drive-strength = <8>;
101                                         bias-disable;
102                                 };
103                                 cmd {
104                                         pins = "sdc3_cmd";
105                                         drive-strength = <8>;
106                                         bias-pull-up;
107                                 };
108                                 data {
109                                         pins = "sdc3_data";
110                                         drive-strength = <8>;
111                                         bias-pull-up;
112                                 };
113                         };
114
115                         /* Second SD card slot pins */
116                         dragon_sdcc5_pins: sdcc5 {
117                                 mux {
118                                         pins = "gpio95", "gpio96", "gpio97",
119                                             "gpio98", "gpio99", "gpio100";
120                                         function = "sdc5";
121                                 };
122                                 clk {
123                                         pins = "gpio97"; /* SDC5 CLK */
124                                         drive-strength = <16>;
125                                         bias-disable;
126                                 };
127                                 cmd {
128                                         pins = "gpio95"; /* SDC5 CMD */
129                                         drive-strength = <10>;
130                                         bias-pull-up;
131                                 };
132                                 data {
133                                         /* SDC5 D0 to D3 */
134                                         pins = "gpio96", "gpio98", "gpio99", "gpio100";
135                                         drive-strength = <10>;
136                                         bias-pull-up;
137                                 };
138                         };
139
140                         dragon_gsbi12_i2c_pins: gsbi12_i2c {
141                                 mux {
142                                         pins = "gpio115", "gpio116";
143                                         function = "gsbi12";
144                                 };
145                                 pinconf {
146                                         pins = "gpio115", "gpio116";
147                                         drive-strength = <16>;
148                                         /* These have external pull-up 4.7kOhm to 1.8V */
149                                         bias-disable;
150                                 };
151                         };
152
153                         /* Primary serial port uart 0 pins */
154                         dragon_gsbi12_serial_pins: gsbi12_serial {
155                                 mux {
156                                         pins = "gpio117", "gpio118";
157                                         function = "gsbi12";
158                                 };
159                                 tx {
160                                         pins = "gpio117";
161                                         drive-strength = <8>;
162                                         bias-disable;
163                                 };
164                                 rx {
165                                         pins = "gpio118";
166                                         drive-strength = <2>;
167                                         bias-pull-up;
168                                 };
169                         };
170                 };
171
172                 qcom,ssbi@500000 {
173                         pmic@0 {
174                                 keypad@148 {
175                                         linux,keymap = <
176                                         MATRIX_KEY(0, 0, KEY_MENU)
177                                         MATRIX_KEY(0, 2, KEY_1)
178                                         MATRIX_KEY(0, 3, KEY_4)
179                                         MATRIX_KEY(0, 4, KEY_7)
180                                         MATRIX_KEY(1, 0, KEY_UP)
181                                         MATRIX_KEY(1, 1, KEY_LEFT)
182                                         MATRIX_KEY(1, 2, KEY_DOWN)
183                                         MATRIX_KEY(1, 3, KEY_5)
184                                         MATRIX_KEY(1, 3, KEY_8)
185                                         MATRIX_KEY(2, 0, KEY_HOME)
186                                         MATRIX_KEY(2, 1, KEY_REPLY)
187                                         MATRIX_KEY(2, 2, KEY_2)
188                                         MATRIX_KEY(2, 3, KEY_6)
189                                         MATRIX_KEY(3, 0, KEY_VOLUMEUP)
190                                         MATRIX_KEY(3, 1, KEY_RIGHT)
191                                         MATRIX_KEY(3, 2, KEY_3)
192                                         MATRIX_KEY(3, 3, KEY_9)
193                                         MATRIX_KEY(3, 4, KEY_SWITCHVIDEOMODE)
194                                         MATRIX_KEY(4, 0, KEY_VOLUMEDOWN)
195                                         MATRIX_KEY(4, 1, KEY_BACK)
196                                         MATRIX_KEY(4, 2, KEY_CAMERA)
197                                         MATRIX_KEY(4, 3, KEY_KBDILLUMTOGGLE)
198                                         >;
199                                         keypad,num-rows = <6>;
200                                         keypad,num-columns = <5>;
201                                 };
202
203                                 gpio@150 {
204                                         dragon_bmp085_gpios: bmp085-gpios {
205                                                 pinconf {
206                                                         pins = "gpio16";
207                                                         function = "normal";
208                                                         input-enable;
209                                                         bias-disable;
210                                                         power-source = <PM8058_GPIO_S3>;
211                                                 };
212                                         };
213                                         dragon_sdcc3_gpios: sdcc3-gpios {
214                                                 pinconf {
215                                                         pins = "gpio22";
216                                                         function = "normal";
217                                                         input-enable;
218                                                         bias-disable;
219                                                         power-source = <PM8058_GPIO_S3>;
220                                                 };
221                                         };
222                                         dragon_sdcc5_gpios: sdcc5-gpios {
223                                                 pinconf {
224                                                         pins = "gpio26";
225                                                         function = "normal";
226                                                         input-enable;
227                                                         bias-pull-up;
228                                                         qcom,pull-up-strength = <PMIC_GPIO_PULL_UP_30>;
229                                                         power-source = <PM8058_GPIO_S3>;
230                                                 };
231                                         };
232                                         dragon_ak8975_gpios: ak8975-gpios {
233                                                 pinconf {
234                                                         pins = "gpio33";
235                                                         function = "normal";
236                                                         input-enable;
237                                                         bias-disable;
238                                                         power-source = <PM8058_GPIO_S3>;
239                                                 };
240                                         };
241                                 };
242                         };
243                 };
244
245                 gsbi@19c00000 {
246                         status = "ok";
247                         qcom,mode = <GSBI_PROT_I2C_UART>;
248
249                         serial@19c40000 {
250                                 status = "ok";
251                                 pinctrl-names = "default";
252                                 pinctrl-0 = <&dragon_gsbi12_serial_pins>;
253                         };
254
255                         i2c@19c80000 {
256                                 status = "ok";
257                                 pinctrl-names = "default";
258                                 pinctrl-0 = <&dragon_gsbi12_i2c_pins>;
259
260                                 ak8975@0c {
261                                         compatible = "asahi-kasei,ak8975";
262                                         reg = <0x0c>;
263                                         /* GPIO33 has interrupt 224 on the PM8058 */
264                                         interrupt-parent = <&pm8058_gpio>;
265                                         interrupts = <224 IRQ_TYPE_EDGE_RISING>;
266                                         pinctrl-names = "default";
267                                         pinctrl-0 = <&dragon_ak8975_gpios>;
268                                         vid-supply = <&pm8058_lvs0>; // 1.8V
269                                         vdd-supply = <&pm8058_l14>; // 2.85V
270                                 };
271                                 bmp085@77 {
272                                         compatible = "bosch,bmp085";
273                                         reg = <0x77>;
274                                         /* GPIO16 has interrupt 207 on the PM8058 */
275                                         interrupt-parent = <&pm8058_gpio>;
276                                         interrupts = <207 IRQ_TYPE_EDGE_RISING>;
277                                         reset-gpios = <&tlmm 86 GPIO_ACTIVE_LOW>;
278                                         pinctrl-names = "default";
279                                         pinctrl-0 = <&dragon_bmp085_gpios>;
280                                         vddd-supply = <&pm8058_lvs0>; // 1.8V
281                                         vdda-supply = <&pm8058_l14>; // 2.85V
282                                 };
283                         };
284                 };
285
286                 rpm@104000 {
287                         /*
288                          * Set up of the PMIC RPM regulators for this board
289                          * PM8901 supplies "preliminary regulators" whatever
290                          * that means
291                          */
292                         pm8901-regulators {
293                                 vdd_l0-supply = <&pm8901_s4>;
294                                 vdd_l1-supply = <&vph>;
295                                 vdd_l2-supply = <&vph>;
296                                 vdd_l3-supply = <&vph>;
297                                 vdd_l4-supply = <&vph>;
298                                 vdd_l5-supply = <&vph>;
299                                 vdd_l6-supply = <&vph>;
300                                 /* vdd_s0-supply, vdd_s1-supply: SAW regulators */
301                                 vdd_s2-supply = <&vph>;
302                                 vdd_s3-supply = <&vph>;
303                                 vdd_s4-supply = <&vph>;
304                                 lvs0_in-supply = <&pm8058_s3>;
305                                 lvs1_in-supply = <&pm8901_s4>;
306                                 lvs2_in-supply = <&pm8058_l0>;
307                                 lvs3_in-supply = <&pm8058_s2>;
308                                 mvs_in-supply = <&pm8058_s3>;
309
310                                 l0 {
311                                         regulator-min-microvolt = <1200000>;
312                                         regulator-max-microvolt = <1200000>;
313                                         bias-pull-down;
314                                 };
315                                 l1 {
316                                         regulator-min-microvolt = <3300000>;
317                                         regulator-max-microvolt = <3300000>;
318                                         bias-pull-down;
319                                 };
320                                 l2 {
321                                         regulator-min-microvolt = <2850000>;
322                                         regulator-max-microvolt = <3300000>;
323                                         bias-pull-down;
324                                 };
325                                 l3 {
326                                         regulator-min-microvolt = <3300000>;
327                                         regulator-max-microvolt = <3300000>;
328                                         bias-pull-down;
329                                 };
330                                 l4 {
331                                         regulator-min-microvolt = <2600000>;
332                                         regulator-max-microvolt = <2600000>;
333                                         bias-pull-down;
334                                 };
335                                 l5 {
336                                         regulator-min-microvolt = <2850000>;
337                                         regulator-max-microvolt = <2850000>;
338                                         bias-pull-down;
339                                 };
340                                 l6 {
341                                         regulator-min-microvolt = <2200000>;
342                                         regulator-max-microvolt = <2200000>;
343                                         bias-pull-down;
344                                 };
345
346                                 /* s0 and s1 are SAW regulators controlled over SPM */
347                                 s2 {
348                                         regulator-min-microvolt = <1300000>;
349                                         regulator-max-microvolt = <1300000>;
350                                         qcom,switch-mode-frequency = <1600000>;
351                                         bias-pull-down;
352                                 };
353                                 s3 {
354                                         regulator-min-microvolt = <1100000>;
355                                         regulator-max-microvolt = <1100000>;
356                                         qcom,switch-mode-frequency = <1600000>;
357                                         bias-pull-down;
358                                 };
359                                 s4 {
360                                         regulator-min-microvolt = <1225000>;
361                                         regulator-max-microvolt = <1225000>;
362                                         qcom,switch-mode-frequency = <1600000>;
363                                         bias-pull-down;
364                                 };
365
366                                 /* LVS0 thru 3 and mvs0 are just switches */
367                                 lvs0 {
368                                         regulator-always-on;
369                                 };
370                                 lvs1 { };
371                                 lvs2 { };
372                                 lvs3 { };
373                                 mvs0 {};
374
375                         };
376
377                         pm8058-regulators {
378                                 vdd_l0_l1_lvs-supply = <&pm8058_s3>;
379                                 vdd_l2_l11_l12-supply = <&vph>;
380                                 vdd_l3_l4_l5-supply = <&vph>;
381                                 vdd_l6_l7-supply = <&vph>;
382                                 vdd_l8-supply = <&vph>;
383                                 vdd_l9-supply = <&vph>;
384                                 vdd_l10-supply = <&vph>;
385                                 vdd_l13_l16-supply = <&pm8058_s4>;
386                                 vdd_l14_l15-supply = <&vph>;
387                                 vdd_l17_l18-supply = <&vph>;
388                                 vdd_l19_l20-supply = <&vph>;
389                                 vdd_l21-supply = <&pm8058_s3>;
390                                 vdd_l22-supply = <&pm8058_s3>;
391                                 vdd_l23_l24_l25-supply = <&pm8058_s3>;
392                                 vdd_s0-supply = <&vph>;
393                                 vdd_s1-supply = <&vph>;
394                                 vdd_s2-supply = <&vph>;
395                                 vdd_s3-supply = <&vph>;
396                                 vdd_s4-supply = <&vph>;
397                                 vdd_ncp-supply = <&vph>;
398
399                                 l0 {
400                                         regulator-min-microvolt = <1200000>;
401                                         regulator-max-microvolt = <1200000>;
402                                         bias-pull-down;
403                                 };
404                                 l1 {
405                                         regulator-min-microvolt = <1200000>;
406                                         regulator-max-microvolt = <1200000>;
407                                         bias-pull-down;
408                                 };
409                                 l2 {
410                                         regulator-min-microvolt = <1800000>;
411                                         regulator-max-microvolt = <2600000>;
412                                         bias-pull-down;
413                                 };
414                                 l3 {
415                                         regulator-min-microvolt = <1800000>;
416                                         regulator-max-microvolt = <1800000>;
417                                         bias-pull-down;
418                                 };
419                                 l4 {
420                                         regulator-min-microvolt = <2850000>;
421                                         regulator-max-microvolt = <2850000>;
422                                         bias-pull-down;
423                                 };
424                                 l5 {
425                                         regulator-min-microvolt = <2850000>;
426                                         regulator-max-microvolt = <2850000>;
427                                         bias-pull-down;
428                                 };
429                                 l6 {
430                                         regulator-min-microvolt = <3000000>;
431                                         regulator-max-microvolt = <3600000>;
432                                         bias-pull-down;
433                                 };
434                                 l7 {
435                                         regulator-min-microvolt = <1800000>;
436                                         regulator-max-microvolt = <1800000>;
437                                         bias-pull-down;
438                                 };
439                                 l8 {
440                                         regulator-min-microvolt = <2900000>;
441                                         regulator-max-microvolt = <3050000>;
442                                         bias-pull-down;
443                                 };
444                                 l9 {
445                                         regulator-min-microvolt = <1800000>;
446                                         regulator-max-microvolt = <1800000>;
447                                         bias-pull-down;
448                                 };
449                                 l10 {
450                                         regulator-min-microvolt = <2600000>;
451                                         regulator-max-microvolt = <2600000>;
452                                         bias-pull-down;
453                                 };
454                                 l11 {
455                                         regulator-min-microvolt = <1500000>;
456                                         regulator-max-microvolt = <1500000>;
457                                         bias-pull-down;
458                                 };
459                                 l12 {
460                                         regulator-min-microvolt = <2900000>;
461                                         regulator-max-microvolt = <2900000>;
462                                         bias-pull-down;
463                                 };
464                                 l13 {
465                                         regulator-min-microvolt = <2050000>;
466                                         regulator-max-microvolt = <2050000>;
467                                         bias-pull-down;
468                                 };
469                                 l14 {
470                                         regulator-min-microvolt = <2850000>;
471                                         regulator-max-microvolt = <2850000>;
472                                 };
473                                 l15 {
474                                         regulator-min-microvolt = <2850000>;
475                                         regulator-max-microvolt = <2850000>;
476                                         bias-pull-down;
477                                 };
478                                 l16 {
479                                         regulator-min-microvolt = <1800000>;
480                                         regulator-max-microvolt = <1800000>;
481                                         bias-pull-down;
482                                         regulator-always-on;
483                                 };
484                                 l17 {
485                                         // 1.5V according to schematic
486                                         regulator-min-microvolt = <2600000>;
487                                         regulator-max-microvolt = <2600000>;
488                                         bias-pull-down;
489                                 };
490                                 l18 {
491                                         regulator-min-microvolt = <2200000>;
492                                         regulator-max-microvolt = <2200000>;
493                                         bias-pull-down;
494                                 };
495                                 l19 {
496                                         regulator-min-microvolt = <2500000>;
497                                         regulator-max-microvolt = <2500000>;
498                                         bias-pull-down;
499                                 };
500                                 l20 {
501                                         regulator-min-microvolt = <1800000>;
502                                         regulator-max-microvolt = <1800000>;
503                                         bias-pull-down;
504                                 };
505                                 l21 {
506                                         // 1.1 V according to schematic
507                                         regulator-min-microvolt = <1200000>;
508                                         regulator-max-microvolt = <1200000>;
509                                         bias-pull-down;
510                                         regulator-always-on;
511                                 };
512                                 l22 {
513                                         // 1.2 V according to schematic
514                                         regulator-min-microvolt = <1150000>;
515                                         regulator-max-microvolt = <1150000>;
516                                         bias-pull-down;
517                                 };
518                                 l23 {
519                                         // Unused
520                                         regulator-min-microvolt = <1200000>;
521                                         regulator-max-microvolt = <1200000>;
522                                         bias-pull-down;
523                                 };
524                                 l24 {
525                                         // Unused
526                                         regulator-min-microvolt = <1200000>;
527                                         regulator-max-microvolt = <1200000>;
528                                         bias-pull-down;
529                                 };
530                                 l25 {
531                                         regulator-min-microvolt = <1200000>;
532                                         regulator-max-microvolt = <1200000>;
533                                         bias-pull-down;
534                                 };
535
536                                 s0 {
537                                         // regulator-min-microvolt = <500000>;
538                                         // regulator-max-microvolt = <1325000>;
539                                         regulator-min-microvolt = <1100000>;
540                                         regulator-max-microvolt = <1100000>;
541                                         qcom,switch-mode-frequency = <1600000>;
542                                         bias-pull-down;
543                                 };
544                                 s1 {
545                                         // regulator-min-microvolt = <500000>;
546                                         // regulator-max-microvolt = <1250000>;
547                                         regulator-min-microvolt = <1100000>;
548                                         regulator-max-microvolt = <1100000>;
549                                         qcom,switch-mode-frequency = <1600000>;
550                                         bias-pull-down;
551                                 };
552                                 s2 {
553                                         // 1.3 V according to schematic
554                                         regulator-min-microvolt = <1200000>;
555                                         regulator-max-microvolt = <1400000>;
556                                         qcom,switch-mode-frequency = <1600000>;
557                                         bias-pull-down;
558                                 };
559                                 s3 {
560                                         regulator-min-microvolt = <1800000>;
561                                         regulator-max-microvolt = <1800000>;
562                                         qcom,switch-mode-frequency = <1600000>;
563                                         regulator-always-on;
564                                         bias-pull-down;
565                                 };
566                                 s4 {
567                                         regulator-min-microvolt = <2200000>;
568                                         regulator-max-microvolt = <2200000>;
569                                         qcom,switch-mode-frequency = <1600000>;
570                                         regulator-always-on;
571                                         bias-pull-down;
572                                 };
573
574                                 /* LVS0 and LVS1 are just switches */
575                                 lvs0 {
576                                         bias-pull-down;
577                                 };
578                                 lvs1 {
579                                         bias-pull-down;
580                                 };
581
582                                 ncp {
583                                         regulator-min-microvolt = <1800000>;
584                                         regulator-max-microvolt = <1800000>;
585                                         qcom,switch-mode-frequency = <1600000>;
586                                 };
587                         };
588                 };
589                 amba {
590                         /* Internal 3.69 GiB eMMC */
591                         sdcc@12400000 {
592                                 status = "okay";
593                                 pinctrl-names = "default";
594                                 pinctrl-0 = <&dragon_sdcc1_pins>;
595                                 vmmc-supply = <&pm8901_l5>;
596                                 vqmmc-supply = <&pm8901_lvs0>;
597                         };
598
599                         /* External micro SD card, directly connected, pulled up to 2.85 V */
600                         sdcc@12180000 {
601                                 status = "okay";
602                                 /* Enable SSBI GPIO 22 as input, use for card detect */
603                                 pinctrl-names = "default";
604                                 pinctrl-0 = <&dragon_sdcc3_pins>, <&dragon_sdcc3_gpios>;
605                                 cd-gpios = <&pm8058_gpio 22 GPIO_ACTIVE_LOW>;
606                                 wp-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
607                                 vmmc-supply = <&pm8058_l14>;
608                         };
609
610                         /*
611                          * Second external micro SD card, using two TXB104RGYR levelshifters
612                          * to lift from 1.8 V to 2.85 V
613                          */
614                         sdcc@12200000 {
615                                 status = "okay";
616                                 /* Enable SSBI GPIO 26 as input, use for card detect */
617                                 pinctrl-names = "default";
618                                 pinctrl-0 = <&dragon_sdcc5_pins>, <&dragon_sdcc5_gpios>;
619                                 cd-gpios = <&pm8058_gpio 26 GPIO_ACTIVE_LOW>;
620                                 wp-gpios = <&tlmm 106 GPIO_ACTIVE_HIGH>;
621                                 vmmc-supply = <&pm8058_l14>;
622                                 vqmmc-supply = <&dragon_vio_txb>;
623                         };
624                 };
625         };
626 };