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