Merge remote-tracking branch 'regulator/for-5.7' into regulator-linus
[linux-2.6-microblaze.git] / arch / arm / boot / dts / ste-ux500-samsung-skomer.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Devicetree for the Samsung XCover 2 GT-S7710 also known as Skomer.
4  */
5
6 /dts-v1/;
7 #include "ste-db8500.dtsi"
8 #include "ste-ab8505.dtsi"
9 #include "ste-dbx5x0-pinctrl.dtsi"
10 #include <dt-bindings/gpio/gpio.h>
11 #include <dt-bindings/input/input.h>
12 #include <dt-bindings/interrupt-controller/irq.h>
13
14 / {
15         model = "Samsung XCover 2 (GT-S7710)";
16         compatible = "samsung,skomer", "st-ericsson,u8500";
17
18         chosen {
19                 stdout-path = &serial2;
20         };
21
22         /* TI TXS0206 level translator for 2.9 V */
23         sd_level_translator: regulator-gpio {
24                 compatible = "regulator-fixed";
25
26                 /* GPIO87 EN */
27                 gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
28                 enable-active-high;
29
30                 regulator-name = "sd-level-translator";
31                 regulator-min-microvolt = <2900000>;
32                 regulator-max-microvolt = <2900000>;
33                 regulator-type = "voltage";
34
35                 startup-delay-us = <200>;
36
37                 pinctrl-names = "default";
38                 pinctrl-0 = <&sd_level_translator_default>;
39         };
40
41         /* External LDO MIC5366-3.3YMT for eMMC */
42         ldo_3v3_reg: regulator-gpio-ldo-3v3 {
43                 compatible = "regulator-fixed";
44                 regulator-name = "en-3v3-fixed-supply";
45                 regulator-min-microvolt = <3300000>;
46                 regulator-max-microvolt = <3300000>;
47                 gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
48                 startup-delay-us = <5000>;
49                 enable-active-high;
50                 pinctrl-names = "default";
51                 pinctrl-0 = <&emmc_ldo_en_default_mode>;
52         };
53
54         wlan_en: regulator-gpio-wlan-en {
55                 compatible = "regulator-fixed";
56                 regulator-name = "wl-reg-on";
57                 regulator-min-microvolt = <3000000>;
58                 regulator-max-microvolt = <3000000>;
59                 startup-delay-us = <200000>;
60                 /* GPIO215 WLAN_EN */
61                 gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
62                 enable-active-high;
63                 pinctrl-names = "default";
64                 pinctrl-0 = <&wlan_en_default_mode>;
65         };
66
67         vibrator {
68                 compatible = "gpio-vibrator";
69                 enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
70                 pinctrl-names = "default";
71                 pinctrl-0 = <&vibrator_default>;
72         };
73
74         gpio-keys {
75                 compatible = "gpio-keys";
76                 pinctrl-names = "default";
77                 pinctrl-0 = <&gpio_keys_default_mode>;
78
79                 button-home {
80                         linux,code = <KEY_HOME>;
81                         label = "HOME";
82                         /* GPIO91 */
83                         gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
84                 };
85                 button-volup {
86                         linux,code = <KEY_VOLUMEUP>;
87                         label = "VOL+";
88                         /* GPIO67 */
89                         gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
90                 };
91                 button-voldown {
92                         linux,code = <KEY_VOLUMEDOWN>;
93                         label = "VOL-";
94                         /* GPIO92 */
95                         gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
96                 };
97                 button-menu {
98                         linux,code = <KEY_MENU>;
99                         label = "MENU";
100                         /* GPIO204 */
101                         gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
102                 };
103                 button-back {
104                         linux,code = <KEY_BACK>;
105                         label = "BACK";
106                         /* GPIO205 */
107                         gpios = <&gpio6 13 GPIO_ACTIVE_LOW>;
108                 };
109         };
110
111         /*
112          * FIXME: this is not quite GPIO backlight. This is a
113          * KTD253 one-wire GPIO-controlled backlight. It can
114          * work as a GPIO backlight.
115          */
116         gpio_bl: backlight {
117                 compatible = "gpio-backlight";
118                 /* GPIO 69 */
119                 gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
120                 pinctrl-names = "default";
121                 pinctrl-0 = <&gpio_backlight_default_mode>;
122         };
123
124         i2c-gpio-0 {
125                 compatible = "i2c-gpio";
126                 sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
127                 scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
128                 pinctrl-names = "default";
129                 pinctrl-0 = <&i2c_gpio_0_default>;
130                 #address-cells = <1>;
131                 #size-cells = <0>;
132                 /* TODO: this should be used by the NCP6914 Camera power management unit */
133         };
134
135         i2c-gpio-1 {
136                 compatible = "i2c-gpio";
137                 sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
138                 scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
139                 pinctrl-names = "default";
140                 pinctrl-0 = <&i2c_gpio_1_default>;
141                 #address-cells = <1>;
142                 #size-cells = <0>;
143                 /* TODO: this should be used by the ALPS HSCDTD008A compass sensor */
144         };
145
146         soc {
147                 // External Micro SD slot
148                 sdi0_per1@80126000 {
149                         arm,primecell-periphid = <0x10480180>;
150                         max-frequency = <100000000>;
151                         bus-width = <4>;
152                         cap-sd-highspeed;
153                         cap-mmc-highspeed;
154                         /* All direction control is used */
155                         st,sig-dir-cmd;
156                         st,sig-dir-dat0;
157                         st,sig-dir-dat2;
158                         st,sig-dir-dat31;
159                         st,sig-pin-fbclk;
160                         full-pwr-cycle;
161                         vmmc-supply = <&ab8500_ldo_aux3_reg>;
162                         vqmmc-supply = <&sd_level_translator>;
163                         pinctrl-names = "default", "sleep";
164                         pinctrl-0 = <&mc0_a_1_default>;
165                         pinctrl-1 = <&mc0_a_1_sleep>;
166                         status = "okay";
167                 };
168
169                 // WLAN SDIO channel
170                 sdi1_per2@80118000 {
171                         arm,primecell-periphid = <0x10480180>;
172                         max-frequency = <50000000>;
173                         bus-width = <4>;
174                         non-removable;
175                         cap-sd-highspeed;
176                         vmmc-supply = <&wlan_en>;
177                         pinctrl-names = "default", "sleep";
178                         pinctrl-0 = <&mc1_a_2_default>;
179                         pinctrl-1 = <&mc1_a_2_sleep>;
180                         status = "okay";
181                         #address-cells = <1>;
182                         #size-cells = <0>;
183
184                         wifi@1 {
185                                 compatible = "brcm,bcm4329-fmac";
186                                 reg = <1>;
187                                 /* GPIO216 WL_HOST_WAKE */
188                                 interrupt-parent = <&gpio6>;
189                                 interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
190                                 interrupt-names = "host-wake";
191                                 pinctrl-names = "default";
192                                 pinctrl-0 = <&wlan_default_mode>;
193                         };
194                 };
195
196                 // eMMC
197                 sdi2_per3@80005000 {
198                         arm,primecell-periphid = <0x10480180>;
199                         max-frequency = <100000000>;
200                         bus-width = <8>;
201                         non-removable;
202                         cap-mmc-highspeed;
203                         mmc-ddr-1_8v;
204                         vmmc-supply = <&ldo_3v3_reg>;
205                         pinctrl-names = "default", "sleep";
206                         pinctrl-0 = <&mc2_a_1_default>;
207                         pinctrl-1 = <&mc2_a_1_sleep>;
208
209                         status = "okay";
210                 };
211
212                 /* GBF (Bluetooth) UART */
213                 uart@80120000 {
214                         pinctrl-names = "default", "sleep";
215                         pinctrl-0 = <&u0_a_1_default>;
216                         pinctrl-1 = <&u0_a_1_sleep>;
217                         status = "okay";
218
219                         /* FIXME: not quite working yet, probably needs regulators */
220                         bluetooth {
221                                 compatible = "brcm,bcm4330-bt";
222                                 shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
223                                 device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
224                                 host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
225                                 pinctrl-names = "default";
226                                 pinctrl-0 = <&bluetooth_default_mode>;
227                         };
228                 };
229
230                 /* GPF UART */
231                 uart@80121000 {
232                         status = "okay";
233                         pinctrl-names = "default", "sleep";
234                         pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
235                         pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
236                 };
237
238                 /* Debugging console UART connected to AB8505 USB */
239                 uart@80007000 {
240                         status = "okay";
241                         pinctrl-names = "default", "sleep";
242                         pinctrl-0 = <&u2rxtx_c_1_default>;
243                         pinctrl-1 = <&u2rxtx_c_1_sleep>;
244                 };
245
246                 prcmu@80157000 {
247                         ab8505 {
248                                 ab8500_usb {
249                                         pinctrl-names = "default", "sleep";
250                                         pinctrl-0 = <&usb_a_1_default>;
251                                         pinctrl-1 = <&usb_a_1_sleep>;
252                                 };
253
254                                 ab8505-regulators {
255                                         ab8500_ldo_aux1 {
256                                                 /* Used for VDD for sensors */
257                                                 regulator-name = "AUX1";
258                                                 regulator-min-microvolt = <3000000>;
259                                                 regulator-max-microvolt = <3300000>;
260                                         };
261
262                                         ab8500_ldo_aux2 {
263                                                 /* Supplies the Cypress TMA140 touchscreen only with 3.3V */
264                                                 regulator-name = "AUX2";
265                                                 regulator-min-microvolt = <3300000>;
266                                                 regulator-max-microvolt = <3300000>;
267                                         };
268
269                                         ab8500_ldo_aux3 {
270                                                 /* Used for voltage for external MMC/SD card */
271                                                 regulator-name = "AUX3";
272                                                 regulator-min-microvolt = <1100000>;
273                                                 regulator-max-microvolt = <3300000>;
274                                         };
275
276                                         ab8500_ldo_aux4 {
277                                                 regulator-name = "AUX4";
278                                                 /* Hammer to 3.0V for the display */
279                                                 regulator-min-microvolt = <3000000>;
280                                                 regulator-max-microvolt = <3000000>;
281                                         };
282
283                                         ab8500_ldo_aux5 {
284                                                 regulator-name = "AUX5";
285                                                 regulator-min-microvolt = <1050000>;
286                                                 regulator-max-microvolt = <2790000>;
287                                                 regulator-always-on;
288                                         };
289
290                                         ab8500_ldo_aux6 {
291                                                 regulator-name = "AUX6";
292                                                 /* Hammer to 1.8V for the display */
293                                                 regulator-min-microvolt = <1800000>;
294                                                 regulator-max-microvolt = <1800000>;
295                                         };
296
297                                         ab8500_ldo_aux8 {
298                                                 /* Mostly VIO for sensors */
299                                                 regulator-name = "AUX8";
300                                         };
301                                 };
302                         };
303                 };
304
305                 /* I2C0 */
306                 i2c@80004000 {
307                         status = "okay";
308
309                         pinctrl-names = "default", "sleep";
310                         pinctrl-0 = <&i2c0_a_1_default>;
311                         pinctrl-1 = <&i2c0_a_1_sleep>;
312
313                         proximity@44 {
314                                 compatible = "sharp,gp2ap002s00f";
315                                 clock-frequency = <400000>;
316                                 reg = <0x44>;
317
318                                 interrupt-parent = <&gpio4>;
319                                 interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
320                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
321                                 vio-supply = <&ab8500_ldo_aux8_reg>;
322                                 pinctrl-names = "default";
323                                 pinctrl-0 = <&gp2ap002_skomer_default>;
324                                 sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
325                                 sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
326                         };
327                 };
328
329
330                 /* I2C2 */
331                 i2c@80128000 {
332                         status = "okay";
333
334                         pinctrl-names = "default", "sleep";
335                         pinctrl-0 = <&i2c2_b_2_default>;
336                         pinctrl-1 = <&i2c2_b_2_sleep>;
337
338                         accel@18 {
339                                 compatible = "bosch,bma254";
340                                 clock-frequency = <400000>;
341                                 reg = <0x18>;
342
343                                 /* GPIO224 used as "smart alert" interrupt */
344                                 interrupt-parent = <&gpio7>;
345                                 interrupts = <0 IRQ_TYPE_EDGE_RISING>;
346
347                                 mount-matrix = "0", "1", "0",
348                                                "-1", "0", "0",
349                                                "0", "0", "1";
350                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
351                                 vddio-supply = <&ab8500_ldo_aux8_reg>;
352                                 pinctrl-names = "default";
353                                 pinctrl-0 = <&bma254_skomer_default>;
354                         };
355                 };
356
357                 /* I2C3 */
358                 i2c@80110000 {
359                         status = "okay";
360
361                         pinctrl-names = "default", "sleep";
362                         pinctrl-0 = <&i2c3_c_2_default>;
363                         pinctrl-1 = <&i2c3_c_2_sleep>;
364
365                         /* TODO: this should be used by the Cypress TMA140 touchscreen */
366                 };
367
368                 mcde@a0350000 {
369                         status = "okay";
370                         pinctrl-names = "default";
371                         pinctrl-0 = <&dsi_default_mode>;
372
373                         dsi-controller@a0351000 {
374                                 panel {
375                                         /* NT35510-based Hydis HVA40WV1 */
376                                         compatible = "hydis,hva40wv1", "novatek,nt35510";
377                                         reg = <0>;
378                                         /* v_lcd_3v0 2.3-4.8V */
379                                         vdd-supply = <&ab8500_ldo_aux4_reg>;
380                                         /* v_lcd_1v8 1.65-3.3V */
381                                         vddi-supply = <&ab8500_ldo_aux6_reg>;
382                                         /* GPIO 139 */
383                                         reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
384                                         pinctrl-names = "default";
385                                         pinctrl-0 = <&display_default_mode>;
386                                         backlight = <&gpio_bl>;
387                                 };
388                         };
389                 };
390         };
391 };
392
393 &pinctrl {
394         /*
395          * This extends the MC0 default config to include DAT32DIR
396          * which is used by this machine. If we don't do this the
397          * SD card does not work.
398          */
399         sdi0 {
400                 mc0_a_1_default {
401                         default_mux {
402                                 function = "mc0";
403                                 /* This machine uses the DAT31 pin */
404                                 groups = "mc0_a_1", "mc0dat31dir_a_1";
405                         };
406                         default_cfg5 {
407                                 pins = "GPIO21_AB3"; /* DAT31DIR */
408                                 ste,config = <&out_hi>;
409                         };
410                 };
411         };
412
413         mcde {
414                 dsi_default_mode: dsi_default {
415                         default_mux1 {
416                                 /* Mux in VSI0 used for DSI TE */
417                                 function = "lcd";
418                                 groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
419                         };
420                         default_cfg1 {
421                                 pins = "GPIO68_E1"; /* VSI0 */
422                                 ste,config = <&in_nopull>;
423                         };
424                 };
425         };
426
427         /* Two GPIO lines used by the display */
428         display {
429                 display_default_mode: display_default {
430                         skomer_cfg1 {
431                                 /*
432                                  * OLED DETECT or check_pba, this appears to be high
433                                  * on "PBA" which I guess is "prototype board A".
434                                  */
435                                 pins = "GPIO93_B7";
436                                 ste,config = <&gpio_in_nopull>;
437                         };
438                         skomer_cfg2 {
439                                 pins = "GPIO139_C9";
440                                 /*
441                                  * MIPI_DSI0_RESET_N resets the display, leave high
442                                  * (de-asserted) so we only assert reset explicitly
443                                  * from the display driver.
444                                  */
445                                 ste,config = <&gpio_out_hi>;
446                         };
447                 };
448         };
449         backlight {
450                 gpio_backlight_default_mode: backlight_default {
451                         skomer_cfg1 {
452                                 pins = "GPIO69_E2"; /* LCD_BL_CTRL */
453                                 ste,config = <&gpio_out_lo>;
454                         };
455                 };
456         };
457         /* GPIO that enables the 2.9V SD card level translator */
458         sd-level-translator {
459                 sd_level_translator_default: sd_level_translator_default {
460                         /* level shifter on GPIO87 */
461                         skomer_cfg1 {
462                                 pins = "GPIO87_B3";
463                                 ste,config = <&gpio_out_hi>;
464                         };
465                 };
466         };
467         /* GPIO that enables the LDO regulator for the eMMC */
468         emmc-ldo {
469                 emmc_ldo_en_default_mode: emmc_ldo_default {
470                         /* LDO enable on GPIO223 */
471                         skomer_cfg1 {
472                                 pins = "GPIO223_AH9";
473                                 ste,config = <&gpio_out_hi>;
474                         };
475                 };
476         };
477         /* GPIO keys */
478         gpio-keys {
479                 gpio_keys_default_mode: gpio_keys_default {
480                         skomer_cfg1 {
481                                 pins = "GPIO67_G2", /* VOL UP */
482                                        "GPIO91_B6", /* HOME */
483                                        "GPIO92_D6", /* VOL DOWN */
484                                        "GPIO204_AF23", /* MENU */
485                                        "GPIO205_AG23"; /* BACK */
486                                         ste,config = <&gpio_in_pu>;
487                         };
488                 };
489         };
490         /* Interrupt line for BMA254 */
491         bma254 {
492                 bma254_skomer_default: bma254_skomer {
493                         skomer_cfg1 {
494                                 pins = "GPIO224_AG9";
495                                 ste,config = <&gpio_in_pd>;
496                         };
497                 };
498         };
499         /* Interrupt line for light/proximity sensor GP2AP002 */
500         gp2ap002 {
501                 gp2ap002_skomer_default: gp2ap002_skomer {
502                         skomer_cfg1 {
503                                 pins = "GPIO146_D13";
504                                 ste,config = <&gpio_in_nopull>;
505                         };
506                 };
507         };
508         /* GPIO-based I2C bus for NCP6914 */
509         i2c-gpio-0 {
510                 i2c_gpio_0_default: i2c_gpio_0 {
511                         skomer_cfg1 {
512                                 pins = "GPIO143_D12", "GPIO144_B13";
513                                 ste,config = <&gpio_in_nopull>;
514                         };
515                 };
516         };
517         /* GPIO-based I2C bus for ALPS HSCD compass */
518         i2c-gpio-1 {
519                 i2c_gpio_1_default: i2c_gpio_1 {
520                         skomer_cfg1 {
521                                 pins = "GPIO151_B17", "GPIO152_D16";
522                                 ste,config = <&gpio_in_nopull>;
523                         };
524                 };
525         };
526         wlan {
527                 wlan_default_mode: wlan_default {
528                         skomer_cfg1 {
529                                 pins = "GPIO216_AG12";
530                                 ste,config = <&gpio_in_pd>;
531                         };
532                 };
533                 wlan_en_default_mode: wlan_en_default {
534                         skomer_cfg2 {
535                                 pins = "GPIO215_AH13";
536                                 ste,config = <&gpio_out_lo>;
537                         };
538                 };
539         };
540         bluetooth {
541                 bluetooth_default_mode: bluetooth_default {
542                         skomer_cfg1 {
543                                 pins = "GPIO199_AH23", "GPIO222_AJ9";
544                                 ste,config = <&gpio_out_lo>;
545                         };
546                         skomer_cfg2 {
547                                 pins = "GPIO97_D9";
548                                 ste,config = <&gpio_in_nopull>;
549                         };
550                 };
551         };
552         vibrator {
553                 vibrator_default: vibrator_default {
554                         skomer_cfg1 {
555                                 pins = "GPIO195_AG28";  /* MOT_EN */
556                                 ste,config = <&gpio_out_lo>;
557                         };
558                 };
559         };
560 };
561
562 &ab8505_gpio {
563         /* Hog a few default settings */
564         pinctrl-names = "default";
565         pinctrl-0 = <&gpio_default>;
566
567         gpio {
568                 gpio_default: gpio_default {
569                         skomer_mux {
570                                 /* Change unused pins to GPIO mode */
571                                 function = "gpio";
572                                 groups = "gpio3_a_1",   /* default: SysClkReq4 */
573                                          "gpio14_a_1";  /* default: PWMOut1 */
574                         };
575                         skomer_cfg1 {
576                                 pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
577                                 bias-disable;
578                         };
579                 };
580         };
581 };