Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[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         ktd253: backlight {
112                 compatible = "kinetic,ktd253";
113                 /* GPIO 69 */
114                 enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
115                 /* Default to 13/32 brightness */
116                 default-brightness = <13>;
117                 pinctrl-names = "default";
118                 pinctrl-0 = <&gpio_backlight_default_mode>;
119         };
120
121         i2c-gpio-0 {
122                 compatible = "i2c-gpio";
123                 sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
124                 scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
125                 pinctrl-names = "default";
126                 pinctrl-0 = <&i2c_gpio_0_default>;
127                 #address-cells = <1>;
128                 #size-cells = <0>;
129                 /* TODO: this should be used by the NCP6914 Camera power management unit */
130         };
131
132         i2c-gpio-1 {
133                 compatible = "i2c-gpio";
134                 sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
135                 scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
136                 pinctrl-names = "default";
137                 pinctrl-0 = <&i2c_gpio_1_default>;
138                 #address-cells = <1>;
139                 #size-cells = <0>;
140                 magnetometer@c {
141                         compatible = "alps,hscdtd008a";
142                         reg = <0x0c>;
143                         avdd-supply = <&ab8500_ldo_aux1_reg>;
144                         dvdd-supply = <&ab8500_ldo_aux8_reg>;
145                 };
146         };
147
148         soc {
149                 // External Micro SD slot
150                 sdi0_per1@80126000 {
151                         arm,primecell-periphid = <0x10480180>;
152                         max-frequency = <100000000>;
153                         bus-width = <4>;
154                         cap-sd-highspeed;
155                         cap-mmc-highspeed;
156                         /* All direction control is used */
157                         st,sig-dir-cmd;
158                         st,sig-dir-dat0;
159                         st,sig-dir-dat2;
160                         st,sig-dir-dat31;
161                         st,sig-pin-fbclk;
162                         full-pwr-cycle;
163                         vmmc-supply = <&ab8500_ldo_aux3_reg>;
164                         vqmmc-supply = <&sd_level_translator>;
165                         pinctrl-names = "default", "sleep";
166                         pinctrl-0 = <&mc0_a_1_default>;
167                         pinctrl-1 = <&mc0_a_1_sleep>;
168                         status = "okay";
169                 };
170
171                 // WLAN SDIO channel
172                 sdi1_per2@80118000 {
173                         arm,primecell-periphid = <0x10480180>;
174                         max-frequency = <50000000>;
175                         bus-width = <4>;
176                         non-removable;
177                         cap-sd-highspeed;
178                         vmmc-supply = <&wlan_en>;
179                         pinctrl-names = "default", "sleep";
180                         pinctrl-0 = <&mc1_a_2_default>;
181                         pinctrl-1 = <&mc1_a_2_sleep>;
182                         status = "okay";
183                         #address-cells = <1>;
184                         #size-cells = <0>;
185
186                         wifi@1 {
187                                 compatible = "brcm,bcm4329-fmac";
188                                 reg = <1>;
189                                 /* GPIO216 WL_HOST_WAKE */
190                                 interrupt-parent = <&gpio6>;
191                                 interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
192                                 interrupt-names = "host-wake";
193                                 pinctrl-names = "default";
194                                 pinctrl-0 = <&wlan_default_mode>;
195                         };
196                 };
197
198                 // eMMC
199                 sdi2_per3@80005000 {
200                         arm,primecell-periphid = <0x10480180>;
201                         max-frequency = <100000000>;
202                         bus-width = <8>;
203                         non-removable;
204                         cap-mmc-highspeed;
205                         mmc-ddr-1_8v;
206                         vmmc-supply = <&ldo_3v3_reg>;
207                         pinctrl-names = "default", "sleep";
208                         pinctrl-0 = <&mc2_a_1_default>;
209                         pinctrl-1 = <&mc2_a_1_sleep>;
210
211                         status = "okay";
212                 };
213
214                 /* GBF (Bluetooth) UART */
215                 uart@80120000 {
216                         pinctrl-names = "default", "sleep";
217                         pinctrl-0 = <&u0_a_1_default>;
218                         pinctrl-1 = <&u0_a_1_sleep>;
219                         status = "okay";
220
221                         /* FIXME: not quite working yet, probably needs regulators */
222                         bluetooth {
223                                 compatible = "brcm,bcm4330-bt";
224                                 shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
225                                 device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
226                                 host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
227                                 pinctrl-names = "default";
228                                 pinctrl-0 = <&bluetooth_default_mode>;
229                         };
230                 };
231
232                 /* GPF UART */
233                 uart@80121000 {
234                         status = "okay";
235                         pinctrl-names = "default", "sleep";
236                         pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
237                         pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
238                 };
239
240                 /* Debugging console UART connected to AB8505 USB */
241                 uart@80007000 {
242                         status = "okay";
243                         pinctrl-names = "default", "sleep";
244                         pinctrl-0 = <&u2rxtx_c_1_default>;
245                         pinctrl-1 = <&u2rxtx_c_1_sleep>;
246                 };
247
248                 prcmu@80157000 {
249                         ab8505 {
250                                 ab8500_usb {
251                                         pinctrl-names = "default", "sleep";
252                                         pinctrl-0 = <&usb_a_1_default>;
253                                         pinctrl-1 = <&usb_a_1_sleep>;
254                                 };
255
256                                 ab8505-regulators {
257                                         ab8500_ldo_aux1 {
258                                                 /* Used for VDD for sensors */
259                                                 regulator-name = "AUX1";
260                                                 regulator-min-microvolt = <3000000>;
261                                                 regulator-max-microvolt = <3300000>;
262                                         };
263
264                                         ab8500_ldo_aux2 {
265                                                 /* Supplies the Cypress TMA140 touchscreen only with 3.3V */
266                                                 regulator-name = "AUX2";
267                                                 regulator-min-microvolt = <3300000>;
268                                                 regulator-max-microvolt = <3300000>;
269                                         };
270
271                                         ab8500_ldo_aux3 {
272                                                 /* Used for voltage for external MMC/SD card */
273                                                 regulator-name = "AUX3";
274                                                 regulator-min-microvolt = <1100000>;
275                                                 regulator-max-microvolt = <3300000>;
276                                         };
277
278                                         ab8500_ldo_aux4 {
279                                                 regulator-name = "AUX4";
280                                                 /* Hammer to 3.0V for the display */
281                                                 regulator-min-microvolt = <3000000>;
282                                                 regulator-max-microvolt = <3000000>;
283                                         };
284
285                                         ab8500_ldo_aux5 {
286                                                 regulator-name = "AUX5";
287                                                 regulator-min-microvolt = <1050000>;
288                                                 regulator-max-microvolt = <2790000>;
289                                                 regulator-always-on;
290                                         };
291
292                                         ab8500_ldo_aux6 {
293                                                 regulator-name = "AUX6";
294                                                 /* Hammer to 1.8V for the display */
295                                                 regulator-min-microvolt = <1800000>;
296                                                 regulator-max-microvolt = <1800000>;
297                                         };
298
299                                         ab8500_ldo_aux8 {
300                                                 /* Mostly VIO for sensors */
301                                                 regulator-name = "AUX8";
302                                         };
303                                 };
304                         };
305                 };
306
307                 /* I2C0 */
308                 i2c@80004000 {
309                         status = "okay";
310
311                         pinctrl-names = "default", "sleep";
312                         pinctrl-0 = <&i2c0_a_1_default>;
313                         pinctrl-1 = <&i2c0_a_1_sleep>;
314
315                         proximity@44 {
316                                 compatible = "sharp,gp2ap002s00f";
317                                 clock-frequency = <400000>;
318                                 reg = <0x44>;
319
320                                 interrupt-parent = <&gpio4>;
321                                 interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
322                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
323                                 vio-supply = <&ab8500_ldo_aux8_reg>;
324                                 pinctrl-names = "default";
325                                 pinctrl-0 = <&gp2ap002_skomer_default>;
326                                 sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
327                                 sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
328                         };
329                 };
330
331
332                 /* I2C2 */
333                 i2c@80128000 {
334                         status = "okay";
335
336                         pinctrl-names = "default", "sleep";
337                         pinctrl-0 = <&i2c2_b_2_default>;
338                         pinctrl-1 = <&i2c2_b_2_sleep>;
339
340                         accel@18 {
341                                 compatible = "bosch,bma254";
342                                 clock-frequency = <400000>;
343                                 reg = <0x18>;
344
345                                 /* GPIO224 used as "smart alert" interrupt */
346                                 interrupt-parent = <&gpio7>;
347                                 interrupts = <0 IRQ_TYPE_EDGE_RISING>;
348
349                                 mount-matrix = "0", "-1", "0",
350                                               "1", "0", "0",
351                                                "0", "0", "1";
352                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
353                                 vddio-supply = <&ab8500_ldo_aux8_reg>;
354                                 pinctrl-names = "default";
355                                 pinctrl-0 = <&bma254_skomer_default>;
356                         };
357                 };
358
359                 /* I2C3 */
360                 i2c@80110000 {
361                         status = "okay";
362
363                         pinctrl-names = "default", "sleep";
364                         pinctrl-0 = <&i2c3_c_2_default>;
365                         pinctrl-1 = <&i2c3_c_2_sleep>;
366
367                         /* Cypress CY8CTMA140 touchscreen */
368                         touchscreen@20 {
369                                 compatible = "cypress,cy8ctma140";
370                                 clock-frequency = <400000>;
371                                 reg = <0x20>;
372
373                                 touchscreen-size-x = <480>;
374                                 touchscreen-size-y = <800>;
375                                 touchscreen-max-pressure = <255>;
376
377                                 /* GPIO218 for IRQ */
378                                 interrupt-parent = <&gpio6>;
379                                 interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
380
381                                 /* VDD is "digital supply" nominally 1.71-3.6V */
382                                 vdd-supply = <&ab8500_ldo_aux2_reg>;
383                                 /* VCPIN is "analog supply", 2.7-3.6 V */
384                                 vcpin-supply = <&ab8500_ldo_aux2_reg>;
385
386                                 pinctrl-names = "default";
387                                 pinctrl-0 = <&tma140_skomer_default>;
388                         };
389                 };
390
391                 mcde@a0350000 {
392                         status = "okay";
393                         pinctrl-names = "default";
394                         pinctrl-0 = <&dsi_default_mode>;
395
396                         dsi@a0351000 {
397                                 panel {
398                                         /* NT35510-based Hydis HVA40WV1 */
399                                         compatible = "hydis,hva40wv1", "novatek,nt35510";
400                                         reg = <0>;
401                                         /* v_lcd_3v0 2.3-4.8V */
402                                         vdd-supply = <&ab8500_ldo_aux4_reg>;
403                                         /* v_lcd_1v8 1.65-3.3V */
404                                         vddi-supply = <&ab8500_ldo_aux6_reg>;
405                                         /* GPIO 139 */
406                                         reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
407                                         pinctrl-names = "default";
408                                         pinctrl-0 = <&display_default_mode>;
409                                         backlight = <&ktd253>;
410                                 };
411                         };
412                 };
413         };
414 };
415
416 &pinctrl {
417         /*
418          * This extends the MC0 default config to include DAT32DIR
419          * which is used by this machine. If we don't do this the
420          * SD card does not work.
421          */
422         sdi0 {
423                 mc0_a_1_default {
424                         default_mux {
425                                 function = "mc0";
426                                 /* This machine uses the DAT31 pin */
427                                 groups = "mc0_a_1", "mc0dat31dir_a_1";
428                         };
429                         default_cfg5 {
430                                 pins = "GPIO21_AB3"; /* DAT31DIR */
431                                 ste,config = <&out_hi>;
432                         };
433                 };
434         };
435
436         /* The unused FBCLK needs to be pulled down on this machine */
437         sdi2 {
438                 mc2_a_1_default {
439                         default_cfg2 {
440                                 pins = "GPIO130_C8"; /* FBCLK */
441                                 ste,config = <&in_pd>;
442                         };
443                 };
444         };
445
446         mcde {
447                 dsi_default_mode: dsi_default {
448                         default_mux1 {
449                                 /* Mux in VSI0 used for DSI TE */
450                                 function = "lcd";
451                                 groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
452                         };
453                         default_cfg1 {
454                                 pins = "GPIO68_E1"; /* VSI0 */
455                                 ste,config = <&in_nopull>;
456                         };
457                 };
458         };
459
460         /* Two GPIO lines used by the display */
461         display {
462                 display_default_mode: display_default {
463                         skomer_cfg1 {
464                                 /*
465                                  * OLED DETECT or check_pba, this appears to be high
466                                  * on "PBA" which I guess is "prototype board A".
467                                  */
468                                 pins = "GPIO93_B7";
469                                 ste,config = <&gpio_in_nopull>;
470                         };
471                         skomer_cfg2 {
472                                 pins = "GPIO139_C9";
473                                 /*
474                                  * MIPI_DSI0_RESET_N resets the display, leave high
475                                  * (de-asserted) so we only assert reset explicitly
476                                  * from the display driver.
477                                  */
478                                 ste,config = <&gpio_out_hi>;
479                         };
480                 };
481         };
482         backlight {
483                 gpio_backlight_default_mode: backlight_default {
484                         skomer_cfg1 {
485                                 pins = "GPIO69_E2"; /* LCD_BL_CTRL */
486                                 ste,config = <&gpio_out_lo>;
487                         };
488                 };
489         };
490         /* GPIO that enables the 2.9V SD card level translator */
491         sd-level-translator {
492                 sd_level_translator_default: sd_level_translator_default {
493                         /* level shifter on GPIO87 */
494                         skomer_cfg1 {
495                                 pins = "GPIO87_B3";
496                                 ste,config = <&gpio_out_hi>;
497                         };
498                 };
499         };
500         /* GPIO that enables the LDO regulator for the eMMC */
501         emmc-ldo {
502                 emmc_ldo_en_default_mode: emmc_ldo_default {
503                         /* LDO enable on GPIO223 */
504                         skomer_cfg1 {
505                                 pins = "GPIO223_AH9";
506                                 ste,config = <&gpio_out_hi>;
507                         };
508                 };
509         };
510         /* GPIO keys */
511         gpio-keys {
512                 gpio_keys_default_mode: gpio_keys_default {
513                         skomer_cfg1 {
514                                 pins = "GPIO67_G2", /* VOL UP */
515                                        "GPIO91_B6", /* HOME */
516                                        "GPIO92_D6", /* VOL DOWN */
517                                        "GPIO204_AF23", /* MENU */
518                                        "GPIO205_AG23"; /* BACK */
519                                         ste,config = <&gpio_in_pu>;
520                         };
521                 };
522         };
523         /* Interrupt line for BMA254 */
524         bma254 {
525                 bma254_skomer_default: bma254_skomer {
526                         skomer_cfg1 {
527                                 pins = "GPIO224_AG9";
528                                 ste,config = <&gpio_in_pd>;
529                         };
530                 };
531         };
532         /* Interrupt line for light/proximity sensor GP2AP002 */
533         gp2ap002 {
534                 gp2ap002_skomer_default: gp2ap002_skomer {
535                         skomer_cfg1 {
536                                 pins = "GPIO146_D13";
537                                 ste,config = <&gpio_in_nopull>;
538                         };
539                 };
540         };
541         /* GPIO-based I2C bus for NCP6914 */
542         i2c-gpio-0 {
543                 i2c_gpio_0_default: i2c_gpio_0 {
544                         skomer_cfg1 {
545                                 pins = "GPIO143_D12", "GPIO144_B13";
546                                 ste,config = <&gpio_in_nopull>;
547                         };
548                 };
549         };
550         /* GPIO-based I2C bus for ALPS HSCD compass */
551         i2c-gpio-1 {
552                 i2c_gpio_1_default: i2c_gpio_1 {
553                         skomer_cfg1 {
554                                 pins = "GPIO151_B17", "GPIO152_D16";
555                                 ste,config = <&gpio_in_nopull>;
556                         };
557                 };
558         };
559         wlan {
560                 wlan_default_mode: wlan_default {
561                         skomer_cfg1 {
562                                 pins = "GPIO216_AG12";
563                                 ste,config = <&gpio_in_pd>;
564                         };
565                 };
566                 wlan_en_default_mode: wlan_en_default {
567                         skomer_cfg2 {
568                                 pins = "GPIO215_AH13";
569                                 ste,config = <&gpio_out_lo>;
570                         };
571                 };
572         };
573         bluetooth {
574                 bluetooth_default_mode: bluetooth_default {
575                         skomer_cfg1 {
576                                 pins = "GPIO199_AH23", "GPIO222_AJ9";
577                                 ste,config = <&gpio_out_lo>;
578                         };
579                         skomer_cfg2 {
580                                 pins = "GPIO97_D9";
581                                 ste,config = <&gpio_in_nopull>;
582                         };
583                 };
584         };
585         vibrator {
586                 vibrator_default: vibrator_default {
587                         skomer_cfg1 {
588                                 pins = "GPIO195_AG28";  /* MOT_EN */
589                                 ste,config = <&gpio_out_lo>;
590                         };
591                 };
592         };
593         /* Interrupt line for the Cypress TMA140 touchscreen */
594         touchscreen {
595                 tma140_skomer_default: tma140_skomer {
596                         skomer_cfg1 {
597                                 pins = "GPIO218_AH11";
598                                 ste,config = <&gpio_in_nopull>;
599                         };
600                 };
601         };
602 };
603
604 &ab8505_gpio {
605         /* Hog a few default settings */
606         pinctrl-names = "default";
607         pinctrl-0 = <&gpio_default>;
608
609         gpio {
610                 gpio_default: gpio_default {
611                         skomer_mux {
612                                 /* Change unused pins to GPIO mode */
613                                 function = "gpio";
614                                 groups = "gpio3_a_1",   /* default: SysClkReq4 */
615                                          "gpio14_a_1";  /* default: PWMOut1 */
616                         };
617                         skomer_cfg1 {
618                                 pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
619                                 bias-disable;
620                         };
621                 };
622         };
623 };