GNU Linux-libre 5.19-rc6-gnu
[releases.git] / arch / arm / boot / dts / ste-ux500-samsung-codina.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Devicetree for the Samsung Galaxy Ace 2 GT-I8160 also known as Codina.
4  *
5  * NOTE: this is the most common variant according to the vendor tree, known
6  * as "R0.0". There appears to be a "R0.4" variant with backlight on GPIO69,
7  * AB8505 and other changes. There is also talk about some variants having a
8  * Samsung S6D27A1 display, indicated by passing a different command line from
9  * the boot loader.
10  *
11  * The Samsung tree further talks about GT-I8160P and GT-I8160chn (China).
12  * The GT-I8160 plain is known as the "europe" variant.
13  * The GT-I8160P is the CDMA version and it appears to not use the ST
14  * Microelectronics accelerometer and reportedly has NFC mounted.
15  * The GT-I8160chn appears to be the same as the europe variant.
16  *
17  * There is also the Codina-TMO, Samsung SGH-T599, which has its own device
18  * tree.
19  */
20
21 /dts-v1/;
22 #include "ste-db8500.dtsi"
23 #include "ste-ab8500.dtsi"
24 #include "ste-dbx5x0-pinctrl.dtsi"
25 #include <dt-bindings/gpio/gpio.h>
26 #include <dt-bindings/leds/common.h>
27 #include <dt-bindings/input/input.h>
28 #include <dt-bindings/interrupt-controller/irq.h>
29
30 / {
31         model = "Samsung Galaxy Ace 2 (GT-I8160)";
32         compatible = "samsung,codina", "st-ericsson,u8500";
33
34         cpus {
35                 cpu@300 {
36                         /*
37                          * This has a frequency cap at ~800 MHz in the firmware.
38                          * (Changing this number here will not overclock it.)
39                          */
40                         operating-points = <798720 0
41                                             399360 0
42                                             199680 0>;
43                 };
44         };
45
46         chosen {
47                 stdout-path = &serial2;
48         };
49
50         battery: battery {
51                 compatible = "samsung,eb425161lu";
52         };
53
54         thermal-zones {
55                 battery-thermal {
56                         /* This zone will be polled by the battery temperature code */
57                         polling-delay = <0>;
58                         polling-delay-passive = <0>;
59                         thermal-sensors = <&bat_therm>;
60                 };
61         };
62
63         bat_therm: thermistor {
64                 compatible = "samsung,1404-001221";
65                 io-channels = <&gpadc 0x02>; /* BatTemp */
66                 pullup-uv = <1800000>;
67                 pullup-ohm = <230000>;
68                 pulldown-ohm = <0>;
69                 #thermal-sensor-cells = <0>;
70         };
71
72         /* TI TXS0206 level translator for 2.9 V */
73         sd_level_translator: regulator-gpio {
74                 compatible = "regulator-fixed";
75
76                 /* GPIO87 EN */
77                 gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
78                 enable-active-high;
79
80                 regulator-name = "sd-level-translator";
81                 regulator-min-microvolt = <2900000>;
82                 regulator-max-microvolt = <2900000>;
83                 regulator-type = "voltage";
84
85                 startup-delay-us = <200>;
86
87                 pinctrl-names = "default";
88                 pinctrl-0 = <&sd_level_translator_default>;
89         };
90
91         /* External LDO MIC5366-3.3YMT for eMMC */
92         ldo_3v3_reg: regulator-gpio-ldo-3v3 {
93                 compatible = "regulator-fixed";
94                 /* Supplied in turn by VBAT */
95                 regulator-name = "VMEM_3V3";
96                 regulator-min-microvolt = <3300000>;
97                 regulator-max-microvolt = <3300000>;
98                 gpios = <&gpio6 31 GPIO_ACTIVE_HIGH>;
99                 startup-delay-us = <5000>;
100                 enable-active-high;
101                 pinctrl-names = "default";
102                 pinctrl-0 = <&emmc_ldo_en_default_mode>;
103         };
104
105         /*
106          * External Ricoh "TSP" regulator for the touchscreen.
107          * One GPIO line controls two voltages of 3.3V and 1.8V
108          * this line is known as "TSP_LDO_ON1" in the schematics.
109          */
110         ldo_tsp_3v3_reg: regulator-gpio-tsp-ldo-3v3 {
111                 compatible = "regulator-fixed";
112                 /* Supplied in turn by VBAT */
113                 regulator-name = "LDO_TSP_A3V3";
114                 regulator-min-microvolt = <3300000>;
115                 regulator-max-microvolt = <3300000>;
116                 /* GPIO94 controls this regulator */
117                 gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
118                 /* 70 ms power-on delay */
119                 startup-delay-us = <70000>;
120                 enable-active-high;
121                 pinctrl-names = "default";
122                 pinctrl-0 = <&tsp_ldo_en_default_mode>;
123         };
124         ldo_tsp_1v8_reg: regulator-gpio-tsp-ldo-1v8 {
125                 compatible = "regulator-fixed";
126                 /* Supplied in turn by VBAT */
127                 regulator-name = "VREG_TSP_1V8";
128                 regulator-min-microvolt = <1800000>;
129                 regulator-max-microvolt = <1800000>;
130                 /* GPIO94 controls this regulator */
131                 gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
132                 /* 70 ms power-on delay */
133                 startup-delay-us = <70000>;
134                 enable-active-high;
135                 pinctrl-names = "default";
136                 pinctrl-0 = <&tsp_ldo_en_default_mode>;
137         };
138
139         /*
140          * External Ricoh RP152L010B-TR LCD LDO regulator for the display.
141          * LCD_PWR_EN controls both a 3.0V and 1.8V output.
142          */
143         lcd_3v0_reg: regulator-gpio-lcd-3v0 {
144                 compatible = "regulator-fixed";
145                 /* Supplied in turn by VBAT */
146                 regulator-name = "VREG_LCD_3.0V";
147                 regulator-min-microvolt = <3000000>;
148                 regulator-max-microvolt = <3000000>;
149                 /* GPIO219 controls this regulator */
150                 gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
151                 enable-active-high;
152                 pinctrl-names = "default";
153                 pinctrl-0 = <&lcd_pwr_en_default_mode>;
154         };
155         lcd_1v8_reg: regulator-gpio-lcd-1v8 {
156                 compatible = "regulator-fixed";
157                 /* Supplied in turn by VBAT */
158                 regulator-name = "VREG_LCD_1.8V";
159                 regulator-min-microvolt = <1800000>;
160                 regulator-max-microvolt = <1800000>;
161                 /* GPIO219 controls this regulator too */
162                 gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
163                 enable-active-high;
164                 pinctrl-names = "default";
165                 pinctrl-0 = <&lcd_pwr_en_default_mode>;
166         };
167
168         /*
169          * This regulator is a GPIO line that drives the Broadcom WLAN
170          * line WL_REG_ON high and enables the internal regulators
171          * inside the chip. Unfortunatley it is erroneously named
172          * WLAN_RST_N on the schematic but it is not a reset line.
173          *
174          * The voltage specified here is only used to determine the OCR mask,
175          * the for the SDIO connector, the chip is actually connected
176          * directly to VBAT.
177          */
178         wl_reg: regulator-gpio-wlan {
179                 compatible = "regulator-fixed";
180                 regulator-name = "WL_REG_ON";
181                 regulator-min-microvolt = <3000000>;
182                 regulator-max-microvolt = <3000000>;
183                 startup-delay-us = <100000>;
184                 /* GPIO215 (WLAN_RST_N to WL_REG_ON) */
185                 gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
186                 enable-active-high;
187                 pinctrl-names = "default";
188                 pinctrl-0 = <&wlan_ldo_en_default>;
189         };
190
191         vibrator {
192                 compatible = "gpio-vibrator";
193                 /* GPIO195 "MOT_EN" */
194                 enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
195                 pinctrl-names = "default";
196                 pinctrl-0 = <&vibrator_default>;
197         };
198
199         gpio-keys {
200                 compatible = "gpio-keys";
201                 pinctrl-names = "default";
202                 pinctrl-0 = <&gpio_keys_default_mode>;
203
204                 button-home {
205                         linux,code = <KEY_HOME>;
206                         label = "HOME";
207                         /* GPIO91 */
208                         gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
209                 };
210                 button-volup {
211                         linux,code = <KEY_VOLUMEUP>;
212                         label = "VOL+";
213                         /* GPIO67 */
214                         gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
215                 };
216                 button-voldown {
217                         linux,code = <KEY_VOLUMEDOWN>;
218                         label = "VOL-";
219                         /* GPIO92 */
220                         gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
221                 };
222         };
223
224         gpio-leds {
225                 compatible = "gpio-leds";
226                 pinctrl-names = "default";
227                 pinctrl-0 = <&gpio_leds_default_mode>;
228                 touchkey-led {
229                         label = "touchkeys";
230                         /*
231                          * GPIO194 on R0.0, R0.4 does not use this at all, it
232                          * will instead turn LDO AUX4 on/off for key led backlighy.
233                          * (Line is pulled down on R0.4)
234                          */
235                         gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>;
236                         default-state = "on";
237                 };
238         };
239
240         ktd253: backlight {
241                 compatible = "kinetic,ktd253";
242                 /*
243                  * GPIO68 is for R0.0, the board file talks about a TMO variant
244                  * (R0.4) using GPIO69.
245                  */
246                 enable-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
247                 /* Default to 13/32 brightness */
248                 default-brightness = <13>;
249                 pinctrl-names = "default";
250                 pinctrl-0 = <&ktd253_backlight_default_mode>;
251         };
252
253         /* Richtek RT8515GQW Flash LED Driver IC */
254         flash {
255                 compatible = "richtek,rt8515";
256                 /* GPIO 140 */
257                 enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
258                 /* GPIO 141 */
259                 ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
260                 /*
261                  * RFS is 16 kOhm and RTS is 100 kOhm giving
262                  * the flash max current 343mA and torch max
263                  * current 55 mA.
264                  */
265                 richtek,rfs-ohms = <16000>;
266                 richtek,rts-ohms = <100000>;
267                 pinctrl-names = "default";
268                 pinctrl-0 = <&gpio_flash_default_mode>;
269
270                 led {
271                         function = LED_FUNCTION_FLASH;
272                         color = <LED_COLOR_ID_WHITE>;
273                         flash-max-timeout-us = <250000>;
274                         flash-max-microamp = <343750>;
275                         led-max-microamp = <55000>;
276                 };
277         };
278
279         /* Bit-banged I2C on GPIO143 and GPIO144 also called "SUBPMU I2C" */
280         i2c-gpio-0 {
281                 compatible = "i2c-gpio";
282                 sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
283                 scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
284                 pinctrl-names = "default";
285                 pinctrl-0 = <&i2c_gpio_0_default>;
286                 #address-cells = <1>;
287                 #size-cells = <0>;
288
289                 magnetometer@c {
290                         compatible = "alps,hscdtd008a";
291                         reg = <0x0c>;
292                         clock-frequency = <400000>;
293
294                         avdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
295                         dvdd-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
296                 };
297                 /* TODO: this should also be used by the SM5103 Camera power management unit */
298         };
299
300         /* Bit-banged I2C on GPIO151 and GPIO152 also called "NFC I2C" */
301         i2c-gpio-1 {
302                 compatible = "i2c-gpio";
303                 sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
304                 scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
305                 pinctrl-names = "default";
306                 pinctrl-0 = <&i2c_gpio_1_default>;
307                 #address-cells = <1>;
308                 #size-cells = <0>;
309
310                 nfc@2b {
311                         /* NXP NFC circuit PN544 C1 marked NXP 44501  */
312                         compatible = "nxp,pn544-i2c";
313                         /* IF0, IF1 high, gives I2C address 0x2B */
314                         reg = <0x2b>;
315                         clock-frequency = <400000>;
316                         /* NFC IRQ on GPIO32 */
317                         interrupt-parent = <&gpio1>;
318                         interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
319                         /* GPIO 31 */
320                         firmware-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
321                         /* GPIO88 */
322                         enable-gpios = <&gpio2 24 GPIO_ACTIVE_HIGH>;
323                         pinctrl-names = "default";
324                         pinctrl-0 = <&pn544_codina_default>;
325                 };
326         };
327
328         spi-gpio-0 {
329                 compatible = "spi-gpio";
330                 /* Clock on GPIO220, pin SCL */
331                 sck-gpios = <&gpio6 28 GPIO_ACTIVE_HIGH>;
332                 /* MOSI on GPIO224, pin SDI "slave data in" */
333                 mosi-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
334                 /* MISO on GPIO225, pin SDO "slave data out" */
335                 miso-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
336                 /* Chip select on GPIO201 */
337                 cs-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>;
338                 num-chipselects = <1>;
339
340                 pinctrl-names = "default";
341                 pinctrl-0 = <&spi_gpio_0_default>;
342                 #address-cells = <1>;
343                 #size-cells = <0>;
344
345                 /*
346                  * Some Codinas (90%) have a WideChips WS2401-based LMS380KF01
347                  * display mounted and some 10% has a Samsung S6D27A1 instead.
348                  * The boot loader needs to modify this compatible to
349                  * correspond to whatever is passed from the early Samsung boot.
350                  */
351                 panel@0 {
352                         compatible = "samsung,lms380kf01";
353                         spi-max-frequency = <1200000>;
354                         /* TYPE 3: inverse clock polarity and phase */
355                         spi-cpha;
356                         spi-cpol;
357
358                         reg = <0>;
359                         vci-supply = <&lcd_3v0_reg>;
360                         vccio-supply = <&lcd_1v8_reg>;
361
362                         /* Reset on GPIO139 */
363                         reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
364                         /* LCD_VGH/LCD_DETECT, ESD IRQ on GPIO93 */
365                         interrupt-parent = <&gpio2>;
366                         interrupts = <29 IRQ_TYPE_EDGE_RISING>;
367
368                         pinctrl-names = "default";
369                         pinctrl-0 = <&panel_default_mode>;
370                         backlight = <&ktd253>;
371
372                         port {
373                                 panel_in: endpoint {
374                                         remote-endpoint = <&display_out>;
375                                 };
376                         };
377                 };
378         };
379
380         soc {
381                 /* External Micro SD slot */
382                 mmc@80126000 {
383                         arm,primecell-periphid = <0x10480180>;
384                         max-frequency = <100000000>;
385                         bus-width = <4>;
386                         cap-sd-highspeed;
387                         cap-mmc-highspeed;
388                         st,sig-pin-fbclk;
389                         full-pwr-cycle;
390                         /* MMC is powered by AUX3 1.2V .. 2.91V */
391                         vmmc-supply = <&ab8500_ldo_aux3_reg>;
392                         /* 2.9 V level translator is using AUX3 at 2.9 V as well */
393                         vqmmc-supply = <&sd_level_translator>;
394                         pinctrl-names = "default", "sleep";
395                         pinctrl-0 = <&mc0_a_2_default>;
396                         pinctrl-1 = <&mc0_a_2_sleep>;
397                         cd-gpios  = <&gpio6 25 GPIO_ACTIVE_LOW>; // GPIO217
398                         status = "okay";
399                 };
400
401                 /* WLAN SDIO channel */
402                 mmc@80118000 {
403                         arm,primecell-periphid = <0x10480180>;
404                         max-frequency = <50000000>;
405                         bus-width = <4>;
406                         non-removable;
407                         cap-sd-highspeed;
408                         pinctrl-names = "default", "sleep";
409                         pinctrl-0 = <&mc1_a_2_default>;
410                         pinctrl-1 = <&mc1_a_2_sleep>;
411                         /*
412                          * GPIO-controlled voltage enablement: this drives
413                          * the WL_REG_ON line high when we use this device.
414                          * Represented as regulator to fill OCR mask.
415                          */
416                         vmmc-supply = <&wl_reg>;
417
418                         #address-cells = <1>;
419                         #size-cells = <0>;
420                         status = "okay";
421
422                         wifi@1 {
423                                 /* Actually BRCM4330 */
424                                 compatible = "brcm,bcm4330-fmac", "brcm,bcm4329-fmac";
425                                 reg = <1>;
426                                 /* GPIO216 WL_HOST_WAKE */
427                                 interrupt-parent = <&gpio6>;
428                                 interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
429                                 interrupt-names = "host-wake";
430                                 pinctrl-names = "default";
431                                 pinctrl-0 = <&wlan_default_mode>;
432                         };
433                 };
434
435                 /* eMMC */
436                 mmc@80005000 {
437                         arm,primecell-periphid = <0x10480180>;
438                         max-frequency = <100000000>;
439                         bus-width = <8>;
440                         non-removable;
441                         cap-mmc-highspeed;
442                         mmc-ddr-1_8v;
443                         no-sdio;
444                         no-sd;
445                         vmmc-supply = <&ldo_3v3_reg>;
446                         pinctrl-names = "default", "sleep";
447                         /*
448                          * GPIO130 will be set to input no pull-up resulting in a resistor
449                          * pulling the reset high and taking the memory out of reset.
450                          */
451                         pinctrl-0 = <&mc2_a_1_default>;
452                         pinctrl-1 = <&mc2_a_1_sleep>;
453                         status = "okay";
454                 };
455
456                 /* GBF (Bluetooth) UART */
457                 uart@80120000 {
458                         pinctrl-names = "default", "sleep";
459                         pinctrl-0 = <&u0_a_1_default>;
460                         pinctrl-1 = <&u0_a_1_sleep>;
461                         status = "okay";
462
463                         bluetooth {
464                                 compatible = "brcm,bcm4330-bt";
465                                 /* GPIO222 rail BT_VREG_EN to BT_REG_ON */
466                                 shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
467                                 /* BT_WAKE on GPIO199 */
468                                 device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
469                                 /* BT_HOST_WAKE on GPIO97 */
470                                 /* FIXME: convert to interrupt */
471                                 host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
472                                 /* BT_RST_N on GPIO209 */
473                                 reset-gpios = <&gpio6 17 GPIO_ACTIVE_LOW>;
474                                 pinctrl-names = "default";
475                                 pinctrl-0 = <&bluetooth_default_mode>;
476                         };
477                 };
478
479                 /* GPS UART */
480                 uart@80121000 {
481                         status = "okay";
482                         pinctrl-names = "default", "sleep";
483                         pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
484                         pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
485
486                         gnss {
487                                 compatible = "brcm,bcm4751";
488                                 /* GPS_RSTN on GPIO21 */
489                                 reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
490                                 /* GPS_ON_OFF on GPIO86 */
491                                 enable-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
492                                 /* GPS_1V8 (VSMPS2) */
493                                 vddio-supply = <&db8500_vsmps2_reg>;
494                                 pinctrl-names = "default";
495                                 pinctrl-0 = <&bcm4751_codina_default>;
496                         };
497                 };
498
499                 /* Debugging console UART connected to TSU6111RSVR (FSA880) */
500                 uart@80007000 {
501                         status = "okay";
502                         pinctrl-names = "default", "sleep";
503                         pinctrl-0 = <&u2rxtx_c_1_default>;
504                         pinctrl-1 = <&u2rxtx_c_1_sleep>;
505                 };
506
507                 prcmu@80157000 {
508                         ab8500 {
509                                 phy {
510                                         pinctrl-names = "default", "sleep";
511                                         pinctrl-0 = <&usb_a_1_default>;
512                                         pinctrl-1 = <&usb_a_1_sleep>;
513                                 };
514
515                                 ab8500_fg {
516                                         line-impedance-micro-ohms = <36000>;
517                                 };
518
519                                 regulator {
520                                         ab8500_ldo_aux1 {
521                                                 /* Used for VDD for sensors */
522                                                 regulator-name = "V-SENSORS-VDD";
523                                                 regulator-min-microvolt = <3000000>;
524                                                 regulator-max-microvolt = <3000000>;
525                                         };
526
527                                         ab8500_ldo_aux2 {
528                                                 /* Used for VIO for sensors */
529                                                 regulator-name = "V-SENSORS-VIO";
530                                                 regulator-min-microvolt = <1800000>;
531                                                 regulator-max-microvolt = <1800000>;
532                                         };
533
534                                         ab8500_ldo_aux3 {
535                                                 /* Used for voltage for external MMC/SD card */
536                                                 regulator-name = "V-MMC-SD";
537                                                 regulator-min-microvolt = <1200000>;
538                                                 regulator-max-microvolt = <2910000>;
539                                         };
540                                 };
541                         };
542                 };
543
544                 /* I2C0 also known as "AGC I2C" */
545                 i2c@80004000 {
546                         status = "okay";
547                         pinctrl-names = "default", "sleep";
548                         pinctrl-0 = <&i2c0_a_1_default>;
549                         pinctrl-1 = <&i2c0_a_1_sleep>;
550
551                         proximity@39 {
552                                 /* Codina has the Amstaos TMD2672 */
553                                 compatible = "amstaos,tmd2672";
554                                 clock-frequency = <400000>;
555                                 reg = <0x39>;
556
557                                 /* IRQ on GPIO146 "PS_INT" */
558                                 interrupt-parent = <&gpio4>;
559                                 interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
560                                 /* FIXME: needs a VDDIO supply that is connected to a pull-up resistor */
561                                 vdd-supply = <&ab8500_ldo_aux1_reg>;
562                                 pinctrl-names = "default";
563                                 pinctrl-0 = <&tms2672_codina_default>;
564                         };
565                 };
566
567                 /* I2C1 on GPIO16 and GPIO17 also called "MUS I2C" */
568                 i2c@80122000 {
569                         status = "okay";
570                         pinctrl-names = "default","sleep";
571                         /* FIXME: If it doesn't work try what we use on Gavini */
572                         pinctrl-0 = <&i2c1_b_2_default>;
573                         pinctrl-1 = <&i2c1_b_2_sleep>;
574
575                         /* Texas Instruments TSU6111 micro USB switch */
576                         usb-switch@25 {
577                                 compatible = "ti,tsu6111";
578                                 reg = <0x25>;
579                                 /* Interrupt JACK_INT_N on GPIO95 */
580                                 interrupt-parent = <&gpio2>;
581                                 interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
582                                 pinctrl-names = "default";
583                                 pinctrl-0 = <&tsu6111_codina_default>;
584                         };
585                 };
586
587                 /* I2C2 on GPIO10 and GPIO11 also called "SENSORS I2C" */
588                 i2c@80128000 {
589                         status = "okay";
590                         pinctrl-names = "default", "sleep";
591                         pinctrl-0 = <&i2c2_b_2_default>;
592                         pinctrl-1 = <&i2c2_b_2_sleep>;
593
594                         lisd3dh@19 {
595                                 /* ST Microelectronics Accelerometer */
596                                 compatible = "st,lis3dh-accel";
597                                 st,drdy-int-pin = <1>;
598                                 reg = <0x19>;
599                                 vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
600                                 vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
601                                 mount-matrix = "0", "-1", "0",
602                                                "1", "0", "0",
603                                                "0", "0", "1";
604                         };
605                 };
606
607                 /* I2C3 */
608                 i2c@80110000 {
609                         status = "okay";
610
611                         pinctrl-names = "default", "sleep";
612                         pinctrl-0 = <&i2c3_c_2_default>;
613                         pinctrl-1 = <&i2c3_c_2_sleep>;
614
615                         /* TODO: write bindings and driver for this touchscreen */
616
617                         /* Zinitix BT404 ISP part */
618                         isp@50 {
619                                 compatible = "zinitix,bt404-isp";
620                                 reg = <0x50>;
621                                 pinctrl-names = "default";
622                                 pinctrl-0 = <&tsp_default>;
623                         };
624
625                         /* Zinitix BT404 touchscreen, also has the touchkeys for menu and back */
626                         touchscreen@20 {
627                                 compatible = "zinitix,bt404";
628                                 reg = <0x20>;
629                                 /* GPIO218 (TSP_INT_1V8) */
630                                 interrupt-parent = <&gpio6>;
631                                 interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
632                                 vcca-supply = <&ldo_tsp_3v3_reg>;
633                                 vdd-supply = <&ldo_tsp_1v8_reg>;
634                                 zinitix,mode = <2>;
635                                 touchscreen-size-x = <480>;
636                                 touchscreen-size-y = <800>;
637                                 pinctrl-names = "default";
638                                 pinctrl-0 = <&tsp_default>;
639                         };
640                 };
641
642                 mcde@a0350000 {
643                         status = "okay";
644                         pinctrl-names = "default";
645                         pinctrl-0 = <&dpi_default_mode>;
646
647                         port {
648                                 display_out: endpoint {
649                                         remote-endpoint = <&panel_in>;
650                                 };
651                         };
652                 };
653         };
654 };
655
656 &pinctrl {
657         /*
658          * This extends the MC0_A_2 default config to include
659          * the card detect GPIO217 line.
660          */
661         sdi0 {
662                 mc0_a_2_default {
663                         default_cfg4 {
664                                 pins = "GPIO217_AH12"; /* card detect */
665                                 ste,config = <&gpio_in_pd>;
666                         };
667                 };
668         };
669         sdi2 {
670                 /*
671                  * This will make the resistor mounted in R0.0 pull up
672                  * the reset line and take the eMMC out of reset. On
673                  * R0.4 variants, GPIO130 should be set in GPIO mode and
674                  * pulled down. (Not connected.)
675                  */
676                 mc2_a_1_default {
677                         default_cfg2 {
678                                 pins = "GPIO130_C8"; /* FBCLK */
679                                 ste,config = <&in_nopull>;
680                         };
681                 };
682         };
683         /* GPIO that enables the 2.9V SD card level translator */
684         sd-level-translator {
685                 sd_level_translator_default: sd_level_translator_default {
686                         /* level shifter on GPIO87 */
687                         codina_cfg1 {
688                                 pins = "GPIO87_B3";
689                                 ste,config = <&gpio_out_hi>;
690                         };
691                 };
692         };
693         /* GPIO that enables the LDO regulator for the eMMC */
694         emmc-ldo {
695                 emmc_ldo_en_default_mode: emmc_ldo_default {
696                         /* LDO enable on GPIO223 */
697                         codina_cfg1 {
698                                 pins = "GPIO223_AH9";
699                                 ste,config = <&gpio_out_hi>;
700                         };
701                 };
702         };
703         /* GPIOs for panel control */
704         panel {
705                 panel_default_mode: panel_default {
706                         codina_cfg1 {
707                                 /* Reset line */
708                                 pins = "GPIO139_C9";
709                                 ste,config = <&gpio_out_lo>;
710                         };
711                         codina_cfg2 {
712                                 /* ESD IRQ line "LCD detect" */
713                                 pins = "GPIO93_B7";
714                                 ste,config = <&gpio_in_nopull>;
715                         };
716                 };
717         };
718         /* GPIO that enables the LDO regulator for the touchscreen */
719         tsp-ldo {
720                 tsp_ldo_en_default_mode: tsp_ldo_default {
721                         /* LDO enable on GPIO94 */
722                         gavini_cfg1 {
723                                 pins = "GPIO94_D7";
724                                 ste,config = <&gpio_out_hi>;
725                         };
726                 };
727         };
728         /* GPIO that enables the LDO regulator for the LCD display */
729         lcd-ldo {
730                 lcd_pwr_en_default_mode: lcd_pwr_en_default {
731                         /* LCD_PWR_EN on GPIO219 */
732                         codina_cfg1 {
733                                 pins = "GPIO219_AG10";
734                                 ste,config = <&gpio_out_hi>;
735                         };
736                 };
737         };
738         /* GPIO that enables the LDO regulator for the key LED */
739         key-led {
740                 gpio_leds_default_mode: en_led_ldo_default {
741                         /* EN_LED_LDO on GPIO194 */
742                         codina_cfg1 {
743                                 pins = "GPIO194_AF27";
744                                 ste,config = <&gpio_out_hi>;
745                         };
746                 };
747         };
748         /* GPIO that enables the WLAN internal LDO regulators */
749         wlan-ldo {
750                 wlan_ldo_en_default: wlan_ldo_default {
751                         /* GPIO215 named WLAN_RST_N */
752                         codina_cfg1 {
753                                 pins = "GPIO215_AH13";
754                                 ste,config = <&gpio_out_lo>;
755                         };
756                 };
757         };
758         /* Backlight GPIO */
759         backlight {
760                 ktd253_backlight_default_mode: backlight_default {
761                         skomer_cfg1 {
762                                 pins = "GPIO68_E1"; /* LCD_BL_CTRL */
763                                 ste,config = <&gpio_out_lo>;
764                         };
765                 };
766         };
767         /* Flash and torch */
768         flash {
769                 gpio_flash_default_mode: flash_default {
770                         codina_cfg1 {
771                                 pins = "GPIO140_B11", "GPIO141_C12";
772                                 ste,config = <&gpio_out_lo>;
773                         };
774                 };
775         };
776         /* GPIO keys */
777         gpio-keys {
778                 gpio_keys_default_mode: gpio_keys_default {
779                         skomer_cfg1 {
780                                 pins = "GPIO67_G2", /* VOL UP */
781                                        "GPIO91_B6", /* HOME */
782                                        "GPIO92_D6"; /* VOL DOWN */
783                                 ste,config = <&gpio_in_pu>;
784                         };
785                 };
786         };
787         /* Interrupt line for the Zinitix BT404 touchscreen */
788         tsp {
789                 tsp_default: tsp_default {
790                         codina_cfg1 {
791                                 pins = "GPIO218_AH11";  /* TSP_INT_1V8 */
792                                 ste,config = <&gpio_in_nopull>;
793                         };
794                 };
795         };
796         /* Interrupt line for light/proximity sensor TMS2672 */
797         tms2672 {
798                 tms2672_codina_default: tms2672_codina {
799                         codina_cfg1 {
800                                 pins = "GPIO146_D13";
801                                 ste,config = <&gpio_in_nopull>;
802                         };
803                 };
804         };
805         /* GPIO-based I2C bus for subpmu */
806         i2c-gpio-0 {
807                 i2c_gpio_0_default: i2c_gpio_0 {
808                         codina_cfg1 {
809                                 pins = "GPIO143_D12", "GPIO144_B13";
810                                 ste,config = <&gpio_in_nopull>;
811                         };
812                 };
813         };
814         /* GPIO-based I2C bus for the NFC */
815         i2c-gpio-1 {
816                 i2c_gpio_1_default: i2c_gpio_1 {
817                         codina_cfg1 {
818                                 pins = "GPIO151_D17", "GPIO152_D16";
819                                 ste,config = <&gpio_in_nopull>;
820                         };
821                 };
822         };
823         /* GPIO-based SPI bus for the display */
824         spi-gpio-0 {
825                 spi_gpio_0_default: spi_gpio_0_d {
826                         codina_cfg1 {
827                                 pins = "GPIO220_AH10", "GPIO201_AF24", "GPIO224_AG9";
828                                 ste,config = <&gpio_out_hi>;
829                         };
830                         codina_cfg2 {
831                                 pins = "GPIO225_AG8";
832                                 /* Needs pull down, no pull down resistor on board */
833                                 ste,config = <&gpio_in_pd>;
834                         };
835                 };
836                 spi_gpio_0_sleep: spi_gpio_0_s {
837                         codina_cfg1 {
838                                 pins = "GPIO220_AH10", "GPIO201_AF24",
839                                        "GPIO224_AG9", "GPIO225_AG8";
840                                 ste,config = <&gpio_out_hi>;
841                         };
842                 };
843         };
844         wlan {
845                 wlan_default_mode: wlan_default {
846                         /* GPIO216 for WL_HOST_WAKE */
847                         codina_cfg2 {
848                                 pins = "GPIO216_AG12";
849                                 ste,config = <&gpio_in_pd>;
850                         };
851                 };
852         };
853         bluetooth {
854                 bluetooth_default_mode: bluetooth_default {
855                         /* GPIO199 BT_WAKE and GPIO222 BT_VREG_ON */
856                         codina_cfg1 {
857                                 pins = "GPIO199_AH23", "GPIO222_AJ9";
858                                 ste,config = <&gpio_out_lo>;
859                         };
860                         /* GPIO97 BT_HOST_WAKE */
861                         codina_cfg2 {
862                                 pins = "GPIO97_D9";
863                                 ste,config = <&gpio_in_nopull>;
864                         };
865                         /* GPIO209 BT_RST_N */
866                         codina_cfg3 {
867                                 pins = "GPIO209_AG15";
868                                 ste,config = <&gpio_out_hi>;
869                         };
870                 };
871         };
872         /* Interrupt line for TI TSU6111 Micro USB switch */
873         tsu6111 {
874                 tsu6111_codina_default: tsu6111_codina {
875                         codina_cfg1 {
876                                 /* GPIO95 used for IRQ */
877                                 pins = "GPIO95_E8";
878                                 ste,config = <&gpio_in_nopull>;
879                         };
880                 };
881         };
882         nfc {
883                 pn544_codina_default: pn544_codina {
884                         /* Interrupt line */
885                         codina_cfg1 {
886                                 pins = "GPIO32_V2";
887                                 ste,config = <&gpio_in_nopull>;
888                         };
889                         /* Enable and firmware GPIOs */
890                         codina_cfg2 {
891                                 pins = "GPIO31_V3", "GPIO88_C4";
892                                 ste,config = <&gpio_out_lo>;
893                         };
894                 };
895         };
896         bcm4751 {
897                 bcm4751_codina_default: bcm4751_codina {
898                         /* Reset line, start out asserted */
899                         codina_cfg1 {
900                                 pins = "GPIO21_AB3";
901                                 ste,config = <&gpio_out_lo>;
902                         };
903                         /* GPS_ON_OFF, start out deasserted (off) */
904                         codina_cfg2 {
905                                 pins = "GPIO86_C6";
906                                 ste,config = <&gpio_out_lo>;
907                         };
908                 };
909         };
910         vibrator {
911                 vibrator_default: vibrator_default {
912                         codina_cfg1 {
913                                 pins = "GPIO195_AG28";  /* MOT_EN */
914                                 ste,config = <&gpio_out_lo>;
915                         };
916                 };
917         };
918         mcde {
919                 dpi_default_mode: dpi_default {
920                         default_mux1 {
921                                 /* Mux in all the data lines */
922                                 function = "lcd";
923                                 groups =
924                                         /* Data lines D0-D7 GPIO70..GPIO77 */
925                                         "lcd_d0_d7_a_1",
926                                         /* Data lines D8-D11 GPIO78..GPIO81 */
927                                         "lcd_d8_d11_a_1",
928                                         /* Data lines D12-D15 GPIO82..GPIO85 */
929                                         "lcd_d12_d15_a_1",
930                                         /* Data lines D16-D23 GPIO161..GPIO168 */
931                                         "lcd_d16_d23_b_1";
932                         };
933                         default_mux2 {
934                                 function = "lcda";
935                                 /* Clock line on GPIO150, DE, VSO, HSO on GPIO169..GPIO171 */
936                                 groups = "lcdaclk_b_1", "lcda_b_1";
937                         };
938                         /* Input, no pull-up is the default state for pins used for an alt function */
939                         default_cfg1 {
940                                 pins = "GPIO150_C14", "GPIO169_D22", "GPIO170_C23", "GPIO171_D23";
941                                 ste,config = <&in_nopull>;
942                         };
943                 };
944         };
945 };