1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Devicetree for the Samsung Galaxy S Advance GT-I9070 also known as Janice.
4 */
5
6/dts-v1/;
7#include "ste-db8500.dtsi"
8#include "ste-ab8500.dtsi"
9#include "ste-dbx5x0-pinctrl.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/interrupt-controller/irq.h>
14
15/ {
16	model = "Samsung Galaxy S Advance (GT-I9070)";
17	compatible = "samsung,janice", "st-ericsson,u8500";
18
19	chosen {
20		stdout-path = &serial2;
21	};
22
23	battery: battery {
24		compatible = "samsung,eb535151vu";
25	};
26
27	thermal-zones {
28		battery-thermal {
29			/* This zone will be polled by the battery temperature code */
30			polling-delay = <0>;
31			polling-delay-passive = <0>;
32			thermal-sensors = <&bat_therm>;
33
34			trips {
35				battery-crit-hi {
36					temperature = <70000>;
37					hysteresis = <2000>;
38					type = "critical";
39				};
40			};
41		};
42	};
43
44	bat_therm: thermistor {
45		compatible = "samsung,1404-001221";
46		io-channels = <&gpadc 0x02>; /* BatTemp */
47		pullup-uv = <1800000>;
48		pullup-ohm = <230000>;
49		pulldown-ohm = <0>;
50		#thermal-sensor-cells = <0>;
51	};
52
53	/* External LDO for eMMC LDO VMEM_3V3 controlled by GPIO6 */
54	ldo_3v3_reg: regulator-gpio-ldo-3v3 {
55		compatible = "regulator-fixed";
56		/* Supplied in turn by VBAT */
57		regulator-name = "VMEM_3V3";
58		regulator-min-microvolt = <3300000>;
59		regulator-max-microvolt = <3300000>;
60		gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
61		startup-delay-us = <5000>; // FIXME
62		enable-active-high;
63		pinctrl-names = "default";
64		pinctrl-0 = <&emmc_ldo_en_default_mode>;
65	};
66
67	/*
68	 * External Ricoh "TSP" regulator for the touchscreen.
69	 * One GPIO line controls two voltages of 3.3V and 1.8V
70	 * this line is known as "TSP_LDO_ON1" in the schematics.
71	 */
72	ldo_tsp_3v3_reg: regulator-gpio-tsp-ldo-3v3 {
73		compatible = "regulator-fixed";
74		/* Supplied in turn by VBAT */
75		regulator-name = "LDO_TSP_A3V3";
76		regulator-min-microvolt = <3300000>;
77		regulator-max-microvolt = <3300000>;
78		/* GPIO94 controls this regulator */
79		gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
80		/* 70 ms power-on delay */
81		startup-delay-us = <70000>;
82		enable-active-high;
83		pinctrl-names = "default";
84		pinctrl-0 = <&tsp_ldo_en_default_mode>;
85	};
86	ldo_tsp_1v8_reg: regulator-gpio-tsp-ldo-1v8 {
87		compatible = "regulator-fixed";
88		/* Supplied in turn by VBAT */
89		regulator-name = "VREG_TSP_1V8";
90		regulator-min-microvolt = <1800000>;
91		regulator-max-microvolt = <1800000>;
92		/* GPIO94 controls this regulator */
93		gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
94		/* 70 ms power-on delay */
95		startup-delay-us = <70000>;
96		enable-active-high;
97		pinctrl-names = "default";
98		pinctrl-0 = <&tsp_ldo_en_default_mode>;
99	};
100
101	/*
102	 * External Ricoh "TSP" regulator for the touchkeys.
103	 * Two GPIO lines controls two voltages of 3.3V and 1.8V
104	 * TSP_LDO_ON2 controls VREG_TOUCHKEY_1V8
105	 * EN_LED_LDO controls VREG_KLED_3V3 (key LED)
106	 */
107	ldo_kled_3v3_reg: regulator-gpio-vreg-kled-3v3 {
108		compatible = "regulator-fixed";
109		/* Supplied in turn by VBAT */
110		regulator-name = "VREG_KLED_3V3";
111		regulator-min-microvolt = <3300000>;
112		regulator-max-microvolt = <3300000>;
113		/* GPIO68 controls this regulator */
114		gpio = <&gpio2 4 GPIO_ACTIVE_HIGH>;
115		/* 70 ms power-on delay */
116		startup-delay-us = <70000>;
117		enable-active-high;
118		pinctrl-names = "default";
119		pinctrl-0 = <&en_led_ldo_default_mode>;
120	};
121	ldo_touchkey_1v8_reg: regulator-gpio-vreg-touchkey-1v8 {
122		compatible = "regulator-fixed";
123		/* Supplied in turn by VBAT */
124		regulator-name = "VREG_TOUCHKEY_1V8";
125		regulator-min-microvolt = <1800000>;
126		regulator-max-microvolt = <1800000>;
127		/* GPIO89 controls this regulator */
128		gpio = <&gpio2 25 GPIO_ACTIVE_HIGH>;
129		/* 70 ms power-on delay */
130		startup-delay-us = <70000>;
131		enable-active-high;
132		pinctrl-names = "default";
133		pinctrl-0 = <&tsp_ldo_on2_default_mode>;
134	};
135
136
137	/*
138	 * External Ricoh RP152L010B-TR LCD LDO regulator for the display.
139	 * LCD_PWR_EN controls a 3.0V and 1.8V output.
140	 */
141	lcd_3v0_reg: regulator-gpio-lcd-3v0 {
142		compatible = "regulator-fixed";
143		/* Supplied in turn by VBAT */
144		regulator-name = "VREG_LCD_3V0";
145		regulator-min-microvolt = <3000000>;
146		regulator-max-microvolt = <3000000>;
147		/* GPIO219 controls this regulator */
148		gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
149		enable-active-high;
150		pinctrl-names = "default";
151		pinctrl-0 = <&lcd_pwr_en_default_mode>;
152	};
153	lcd_1v8_reg: regulator-gpio-lcd-1v8 {
154		compatible = "regulator-fixed";
155		/* Supplied in turn by VBAT */
156		regulator-name = "VREG_LCD_1V8";
157		regulator-min-microvolt = <1800000>;
158		regulator-max-microvolt = <1800000>;
159		/* GPIO219 controls this regulator */
160		gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
161		enable-active-high;
162		pinctrl-names = "default";
163		pinctrl-0 = <&lcd_pwr_en_default_mode>;
164	};
165
166	/*
167	 * This regulator is a GPIO line that drives the Broadcom WLAN
168	 * line WL_REG_ON high and enables the internal regulators
169	 * inside the chip. Unfortunatley it is erroneously named
170	 * WLAN_RST_N on the schematic but it is not a reset line.
171	 *
172	 * The voltage specified here is only used to determine the OCR mask,
173	 * the for the SDIO connector, the chip is actually connected
174	 * directly to VBAT.
175	 */
176	wl_reg: regulator-gpio-wlan {
177		compatible = "regulator-fixed";
178		regulator-name = "WL_REG_ON";
179		regulator-min-microvolt = <3000000>;
180		regulator-max-microvolt = <3000000>;
181		startup-delay-us = <100000>;
182		/* GPIO215 (WLAN_RST_N to WL_REG_ON) */
183		gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
184		enable-active-high;
185		pinctrl-names = "default";
186		pinctrl-0 = <&wlan_ldo_en_default>;
187	};
188
189
190	gpio-keys {
191		compatible = "gpio-keys";
192		pinctrl-names = "default";
193		pinctrl-0 = <&gpio_keys_default_mode>;
194
195		button-home {
196			linux,code = <KEY_HOME>;
197			label = "HOME";
198			/* GPIO91 */
199			gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
200		};
201		button-volup {
202			linux,code = <KEY_VOLUMEUP>;
203			label = "VOL+";
204			/* GPIO67 */
205			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
206		};
207		button-voldown {
208			linux,code = <KEY_VOLUMEDOWN>;
209			label = "VOL-";
210			/* GPIO92 */
211			gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
212		};
213	};
214
215	/* Richtek RT8515GQW Flash LED Driver IC */
216	flash {
217		compatible = "richtek,rt8515";
218		/* GPIO 140 */
219		enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
220		/* GPIO 141 */
221		ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
222		/*
223		 * RFS is 16 kOhm and RTS is 100 kOhm giving
224		 * the flash max current 343mA and torch max
225		 * current 55 mA.
226		 */
227		richtek,rfs-ohms = <16000>;
228		richtek,rts-ohms = <100000>;
229		pinctrl-names = "default";
230		pinctrl-0 = <&gpio_flash_default_mode>;
231
232		led {
233			function = LED_FUNCTION_FLASH;
234			color = <LED_COLOR_ID_WHITE>;
235			flash-max-timeout-us = <250000>;
236			flash-max-microamp = <343750>;
237			led-max-microamp = <55000>;
238		};
239	};
240
241	/* Bit-banged I2C on GPIO143 and GPIO144 also called "SUBPMU I2C" */
242	i2c-gpio-0 {
243		compatible = "i2c-gpio";
244		sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
245		scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
246		pinctrl-names = "default";
247		pinctrl-0 = <&i2c_gpio_0_default>;
248		#address-cells = <1>;
249		#size-cells = <0>;
250
251		/* Yamaha YAS530 magnetometer */
252		magnetometer@2e {
253			compatible = "yamaha,yas530";
254			reg = <0x2e>;
255			/* VDD 3V */
256			vdd-supply = <&ab8500_ldo_aux1_reg>;
257			/* IOVDD 1.8V */
258			iovdd-supply = <&ab8500_ldo_aux2_reg>;
259			/* GPIO204 COMPASS_RST_N */
260			reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
261			pinctrl-names = "default";
262			pinctrl-0 = <&yas529_default>;
263		};
264		/* TODO: this should also be used by the NCP6914 Camera power management unit */
265	};
266
267	/*
268	 * These pins do have an spi controller, however the controller on
269	 * these pins is not the fully featured PL022 SSP/SPI block but the
270	 * ST Micro diet "PL023" version. One of the lacking features in
271	 * this derivative is 3wire support, so it cannot be used to drive
272	 * this panel interface. We have to use GPIO bit-banging instead.
273	 */
274	spi-gpio-0 {
275		compatible = "spi-gpio";
276		/* Clock on GPIO220 */
277		sck-gpios = <&gpio6 28 GPIO_ACTIVE_HIGH>;
278		/* MISO/MOSI on GPIO224 (no separate MISO pin) */
279		mosi-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
280		/* Chip select on GPIO223 */
281		cs-gpios = <&gpio6 31 GPIO_ACTIVE_LOW>;
282		num-chipselects = <1>;
283
284		pinctrl-names = "default";
285		pinctrl-0 = <&spi_gpio_0_default>;
286		#address-cells = <1>;
287		#size-cells = <0>;
288
289		panel@0 {
290			compatible = "samsung,s6e63m0";
291			reg = <0>;
292			vdd3-supply = <&lcd_3v0_reg>;
293			vci-supply = <&lcd_1v8_reg>;
294			/* Reset on GPIO139 */
295			reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
296			pinctrl-names = "default";
297			pinctrl-0 = <&panel_default_mode>;
298			spi-3wire;
299			/* TYPE 3: inverse clock polarity and phase */
300			spi-cpha;
301			spi-cpol;
302
303			port {
304				panel_in: endpoint {
305					remote-endpoint = <&display_out>;
306				};
307			};
308		};
309	};
310
311	/*
312	 * Current sense amplifier on the light sensor to convert current to
313	 * voltage. We do not know if this is the actual configuration. The
314	 * sense resistor value was found by calibrating in a room ambient
315	 * light with a second mobile phone light sensor as reference. If you
316	 * pry a Janice phone apart and inspect it you may figure this out.
317	 */
318	gp2a_shunt: current-sense-shunt {
319		compatible = "current-sense-shunt";
320		io-channels = <&gpadc 0x07>;
321		shunt-resistor-micro-ohms = <15000000>; /* 15 ohms c:a */
322		#io-channel-cells = <0>;
323		io-channel-ranges;
324	};
325
326	/* Bit-banged I2C on GPIO196 and GPIO197 also called "TOUCHKEY_I2C" */
327	i2c-gpio-1 {
328		compatible = "i2c-gpio";
329		sda-gpios = <&gpio6 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
330		scl-gpios = <&gpio6 4 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
331		clock-frequency = <400000>;
332		pinctrl-names = "default";
333		pinctrl-0 = <&i2c_gpio_1_default>;
334		#address-cells = <1>;
335		#size-cells = <0>;
336
337		touchkey@20 {
338			compatible = "coreriver,tc360-touchkey";
339			reg = <0x20>;
340			vdd-supply = <&ldo_kled_3v3_reg>;
341			vcc-supply = <&ldo_touchkey_1v8_reg>;
342			vddio-supply = <&ldo_touchkey_1v8_reg>;
343
344			/* Interrupt on GPIO 198 */
345			interrupt-parent = <&gpio6>;
346			interrupts = <6 IRQ_TYPE_EDGE_RISING>;
347
348			pinctrl-names = "default";
349			pinctrl-0 = <&touchkey_default_mode>;
350			linux,keycodes = <KEY_MENU KEY_BACK>;
351		};
352	};
353
354	/* Bit-banged I2C on GPIO201 and GPIO202 also called "MOT_I2C" */
355	i2c-gpio-2 {
356		compatible = "i2c-gpio";
357		sda-gpios = <&gpio6 10 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
358		scl-gpios = <&gpio6 9 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
359		pinctrl-names = "default";
360		pinctrl-0 = <&i2c_gpio_2_default>;
361		#address-cells = <1>;
362		#size-cells = <0>;
363		/* TODO: add the Immersion ISA1200 I2C device here */
364	};
365
366	/* Bit-banged I2C on GPIO151 and GPIO152 also called "NFC_I2C" */
367	i2c-gpio-3 {
368		compatible = "i2c-gpio";
369		sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
370		scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
371		pinctrl-names = "default";
372		pinctrl-0 = <&i2c_gpio_3_default>;
373		#address-cells = <1>;
374		#size-cells = <0>;
375
376		nfc@30 {
377			compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
378			reg = <0x30>;
379			/* NFC IRQ on GPIO32 */
380			interrupt-parent = <&gpio1>;
381			interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
382			/* GPIO 31 */
383			firmware-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
384			/* GPIO88 */
385			enable-gpios = <&gpio2 24 GPIO_ACTIVE_HIGH>;
386			pinctrl-names = "default";
387			pinctrl-0 = <&pn547_janice_default>;
388		};
389	};
390
391	soc {
392		/* External Micro SD slot */
393		mmc@80126000 {
394			arm,primecell-periphid = <0x10480180>;
395			max-frequency = <50000000>;
396			bus-width = <4>;
397			cap-sd-highspeed;
398			cap-mmc-highspeed;
399			st,sig-dir-cmd;
400			st,sig-dir-dat0;
401			st,sig-dir-dat2;
402			st,sig-pin-fbclk;
403			full-pwr-cycle;
404			/* MMC is powered by AUX3 1.2V .. 2.91V */
405			vmmc-supply = <&ab8500_ldo_aux3_reg>;
406			/* 2.9 V level translator is using AUX3 at 2.9 V as well */
407			vqmmc-supply = <&ab8500_ldo_aux3_reg>;
408			pinctrl-names = "default", "sleep";
409			pinctrl-0 = <&mc0_a_2_default>;
410			pinctrl-1 = <&mc0_a_2_sleep>;
411			cd-gpios  = <&gpio6 25 GPIO_ACTIVE_LOW>; // GPIO217
412			status = "okay";
413		};
414
415		/* WLAN SDIO channel */
416		mmc@80118000 {
417			arm,primecell-periphid = <0x10480180>;
418			max-frequency = <50000000>;
419			bus-width = <4>;
420			non-removable;
421			cap-sd-highspeed;
422			pinctrl-names = "default", "sleep";
423			pinctrl-0 = <&mc1_a_2_default>;
424			pinctrl-1 = <&mc1_a_2_sleep>;
425			/*
426			 * GPIO-controlled voltage enablement: this drives
427			 * the WL_REG_ON line high when we use this device.
428			 * Represented as regulator to fill OCR mask.
429			 */
430			vmmc-supply = <&wl_reg>;
431
432			#address-cells = <1>;
433			#size-cells = <0>;
434			status = "okay";
435
436			wifi@1 {
437				compatible = "brcm,bcm4330-fmac", "brcm,bcm4329-fmac";
438				reg = <1>;
439				/* GPIO216 WL_HOST_WAKE */
440				interrupt-parent = <&gpio6>;
441				interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
442				interrupt-names = "host-wake";
443				pinctrl-names = "default";
444				pinctrl-0 = <&wlan_default_mode>;
445			};
446		};
447
448		/* eMMC */
449		mmc@80005000 {
450			arm,primecell-periphid = <0x10480180>;
451		        max-frequency = <50000000>;
452			bus-width = <8>;
453			non-removable;
454			cap-mmc-highspeed;
455			mmc-ddr-1_8v;
456			no-sdio;
457			no-sd;
458			vmmc-supply = <&ldo_3v3_reg>;
459			pinctrl-names = "default", "sleep";
460			pinctrl-0 = <&mc2_a_1_default>;
461			pinctrl-1 = <&mc2_a_1_sleep>;
462			status = "okay";
463		};
464
465		/* GBF (Bluetooth) UART */
466		uart@80120000 {
467			pinctrl-names = "default", "sleep";
468			pinctrl-0 = <&u0_a_1_default>;
469			pinctrl-1 = <&u0_a_1_sleep>;
470			status = "okay";
471
472			bluetooth {
473				/* BCM4330B1 actually */
474				compatible = "brcm,bcm4330-bt";
475				/* GPIO222 rail BT_VREG_EN to BT_REG_ON */
476				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
477				/* BT_WAKE on GPIO199 */
478				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
479				/* BT_HOST_WAKE on GPIO97 */
480				/* FIXME: convert to interrupt */
481				host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
482				/* BT_RST_N on GPIO209 */
483				reset-gpios = <&gpio6 17 GPIO_ACTIVE_LOW>;
484				pinctrl-names = "default";
485				pinctrl-0 = <&bluetooth_default_mode>;
486			};
487		};
488
489		/* GPS UART */
490		uart@80121000 {
491			status = "okay";
492			pinctrl-names = "default", "sleep";
493			/* CTS/RTS is not used, CTS is repurposed as GPIO */
494			pinctrl-0 = <&u1rxtx_a_1_default>;
495			pinctrl-1 = <&u1rxtx_a_1_sleep>;
496
497			gnss {
498				/*
499				 * The Low Noise Amplifier (LNA) power and enablement is controlled
500				 * autonomously by the GSD4t.
501				 * Janice has a SiRFstarIV-based GSD4t
502				 * Golden has a SiRFstarV 5t-based CSRG05TA03-ICJE-R.
503				 */
504				compatible = "csr,gsd4t";
505				/* GPS_RSTN on GPIO21 */
506				reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
507				/* GPS_ON_OFF on GPIO96 */
508				sirf,onoff-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
509				/* GPS_1V8 (VSMPS2) */
510				vcc-supply = <&db8500_vsmps2_reg>;
511				pinctrl-names = "default";
512				pinctrl-0 = <&gsd4t_janice_default>;
513				/* According to /etc/sirfgps.conf */
514				current-speed = <460800>;
515			};
516		};
517
518		/* Debugging console UART connected to TSU6111RSVR (FSA880) */
519		uart@80007000 {
520			status = "okay";
521			pinctrl-names = "default", "sleep";
522			pinctrl-0 = <&u2rxtx_c_1_default>;
523			pinctrl-1 = <&u2rxtx_c_1_sleep>;
524		};
525
526		prcmu@80157000 {
527			ab8500 {
528				phy {
529					pinctrl-names = "default", "sleep";
530					pinctrl-0 = <&usb_a_1_default>;
531					pinctrl-1 = <&usb_a_1_sleep>;
532				};
533
534				ab8500_fg {
535					line-impedance-micro-ohms = <15000>;
536				};
537
538				regulator {
539					ab8500_ldo_aux1 {
540						/* Used for VDD for sensors */
541						regulator-name = "V-SENSORS-VDD";
542						regulator-min-microvolt = <3000000>;
543						regulator-max-microvolt = <3000000>;
544					};
545
546					ab8500_ldo_aux2 {
547						/* Used for VIO for sensors */
548						regulator-name = "V-SENSORS-VIO";
549						regulator-min-microvolt = <1800000>;
550						regulator-max-microvolt = <1800000>;
551					};
552
553					ab8500_ldo_aux3 {
554						/* Used for voltage for external MMC/SD card */
555						regulator-name = "V-MMC-SD";
556						regulator-min-microvolt = <1200000>;
557						regulator-max-microvolt = <2910000>;
558					};
559				};
560			};
561		};
562
563		/* I2C0 */
564		i2c@80004000 {
565			status = "okay";
566			pinctrl-names = "default", "sleep";
567			pinctrl-0 = <&i2c0_a_1_default>;
568			pinctrl-1 = <&i2c0_a_1_sleep>;
569
570			proximity@44 {
571				/* Janice has the GP2AP002A00F with light sensor */
572				compatible = "sharp,gp2ap002a00f";
573				clock-frequency = <400000>;
574				reg = <0x44>;
575
576				interrupt-parent = <&gpio4>;
577				interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
578				vdd-supply = <&ab8500_ldo_aux1_reg>;
579				vio-supply = <&ab8500_ldo_aux2_reg>;
580				/* ADC channel AUX2 to read ALSOUT ambient light sensor out */
581				io-channels = <&gp2a_shunt>;
582				io-channel-names = "alsout";
583				pinctrl-names = "default";
584				pinctrl-0 = <&gp2ap002_janice_default>;
585				/* B1 mode (arch/arm/mach-ux500/include/mach/gp2a.h) */
586				sharp,proximity-far-hysteresis = /bits/ 8 <0x40>;
587				sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
588			};
589		};
590
591		/* I2C1 on GPIO16 and GPIO17 also called "MUS I2C" */
592		i2c@80122000 {
593			status = "okay";
594			pinctrl-names = "default","sleep";
595			pinctrl-0 = <&i2c1_b_2_default>;
596			pinctrl-1 = <&i2c1_b_2_sleep>;
597
598			/* Texas Instruments TSU6111 micro USB switch */
599			usb-switch@25 {
600				compatible = "ti,tsu6111";
601				reg = <0x25>;
602				/* Interrupt JACK_INT_N on GPIO95 */
603				interrupt-parent = <&gpio2>;
604				interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
605				pinctrl-names = "default";
606				pinctrl-0 = <&tsu6111_janice_default>;
607			};
608		};
609
610		/* I2C2 on GPIO10 and GPIO11 also called "SENSORS I2C" */
611		i2c@80128000 {
612			status = "okay";
613			pinctrl-names = "default", "sleep";
614			pinctrl-0 = <&i2c2_b_2_default>;
615			pinctrl-1 = <&i2c2_b_2_sleep>;
616
617			gyroscope@68 {
618				compatible = "invensense,mpu3050";
619				reg = <0x68>;
620				/* GPIO226 interrupt */
621				interrupt-parent = <&gpio7>;
622				interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
623				/* FIXME: no idea about this */
624				mount-matrix = "1", "0", "0",
625					       "0", "1", "0",
626					       "0", "0", "1";
627				vlogic-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
628				vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
629				pinctrl-names = "default";
630				pinctrl-0 = <&mpu3050_janice_default>;
631
632				/*
633				 * The MPU-3050 acts as a hub for the
634				 * accelerometer.
635				 */
636				i2c-gate {
637					#address-cells = <1>;
638					#size-cells = <0>;
639
640					/* Bosch BMA222 accelerometer */
641					accelerometer@8 {
642						compatible = "bosch,bma222";
643						reg = <0x08>;
644						mount-matrix = "0", "-1", "0",
645							       "1", "0", "0",
646							       "0", "0", "1";
647						vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
648						vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
649					};
650				};
651			};
652		};
653
654		/* I2C3 */
655		i2c@80110000 {
656			status = "okay";
657
658			pinctrl-names = "default", "sleep";
659			pinctrl-0 = <&i2c3_c_2_default>;
660			pinctrl-1 = <&i2c3_c_2_sleep>;
661
662			/* Atmel mXT224E touchscreen */
663			touchscreen@4a {
664				compatible = "atmel,maxtouch";
665				reg = <0x4a>;
666				/* GPIO218 (TSP_INT_1V8) */
667				interrupt-parent = <&gpio6>;
668				interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
669				/* VDDA is "analog supply", 2.57-3.47 V */
670				vdda-supply = <&ldo_tsp_3v3_reg>;
671				/* VDD is "digital supply" 1.71-3.47V */
672				vdd-supply = <&ldo_tsp_1v8_reg>;
673				pinctrl-names = "default";
674				pinctrl-0 = <&tsp_default>;
675			};
676		};
677
678		mcde@a0350000 {
679			status = "okay";
680			pinctrl-names = "default";
681			pinctrl-0 = <&dpi_default_mode>;
682
683			port {
684				display_out: endpoint {
685					remote-endpoint = <&panel_in>;
686				};
687			};
688		};
689	};
690};
691
692&pinctrl {
693	/*
694	 * This extends the MC0_A_2 default config to include
695	 * the card detect GPIO217 line.
696	 */
697	sdi0 {
698		mc0_a_2_default {
699			default_cfg4 {
700				pins = "GPIO217_AH12"; /* card detect */
701				ste,config = <&gpio_in_pd>;
702			};
703		};
704	};
705	mcde {
706		dpi_default_mode: dpi_default {
707			default_mux1 {
708				/* Mux in all the data lines */
709				function = "lcd";
710				groups =
711					/* Data lines D0-D7 GPIO70..GPIO77 */
712					"lcd_d0_d7_a_1",
713					/* Data lines D8-D11 GPIO78..GPIO81 */
714					"lcd_d8_d11_a_1",
715					/* Data lines D12-D15 GPIO82..GPIO85 */
716					"lcd_d12_d15_a_1",
717					/* Data lines D16-D23 GPIO161..GPIO168 */
718					"lcd_d16_d23_b_1";
719			};
720			default_mux2 {
721				function = "lcda";
722				/* Clock line on GPIO150, DE, VSO, HSO on GPIO169..GPIO171 */
723				groups = "lcdaclk_b_1", "lcda_b_1";
724			};
725			/* Input, no pull-up is the default state for pins used for an alt function */
726			default_cfg1 {
727				pins = "GPIO150_C14", "GPIO169_D22", "GPIO170_C23", "GPIO171_D23";
728				ste,config = <&in_nopull>;
729			};
730		};
731	};
732	/* GPIO for panel reset control */
733	panel {
734		panel_default_mode: panel_default {
735			janice_cfg1 {
736				/* Reset line */
737				pins = "GPIO139_C9";
738				ste,config = <&gpio_out_lo>;
739			};
740		};
741	};
742	/* GPIO that enables the LDO regulator for the eMMC */
743	emmc-ldo {
744		emmc_ldo_en_default_mode: emmc_ldo_default {
745			/* LDO enable on GPIO6 */
746			janice_cfg1 {
747				pins = "GPIO6_AF6";
748				ste,config = <&gpio_out_hi>;
749			};
750		};
751	};
752	/* GPIO that enables the LDO regulator for the touchscreen */
753	tsp-ldo {
754		tsp_ldo_en_default_mode: tsp_ldo_default {
755			/* LDO enable on GPIO94 */
756			janice_cfg1 {
757				pins = "GPIO94_D7";
758				ste,config = <&gpio_out_hi>;
759			};
760		};
761	};
762	/* GPIO that enables the LDO regulator for the key LED */
763	key-led {
764		en_led_ldo_default_mode: en_led_ldo_default {
765			/* EN_LED_LDO on GPIO68 */
766			janice_cfg1 {
767				pins = "GPIO68_E1";
768				ste,config = <&gpio_out_hi>;
769			};
770		};
771	};
772	/* GPIO that enables the LDO regulator for the touchkeys */
773	touchkey-ldo {
774		tsp_ldo_on2_default_mode: tsp_ldo_on2_default {
775			/* TSP_LDO_ON2 on GPIO89 */
776			janice_cfg1 {
777				pins = "GPIO89_E6";
778				ste,config = <&gpio_out_lo>;
779			};
780		};
781	};
782	touchkey {
783		touchkey_default_mode: touchkey_default {
784			janice_cfg1 {
785				/* Interrupt */
786				pins = "GPIO198_AG25";
787				ste,config = <&gpio_in_nopull>;
788			};
789			janice_cfg2 {
790				/* Reset, actually completely unused (not routed) */
791				pins = "GPIO205_AG23";
792				ste,config = <&gpio_in_pd>;
793			};
794		};
795	};
796	/* GPIO that enabled the LDO regulator for the LCD display */
797	lcd-ldo {
798		lcd_pwr_en_default_mode: lcd_pwr_en_default {
799			/* LCD_PWR_EN on GPIO219 */
800			janice_cfg1 {
801				pins = "GPIO219_AG10";
802				ste,config = <&gpio_out_hi>;
803			};
804		};
805	};
806	/* GPIO that enables the WLAN internal LDO regulators */
807	wlan-ldo {
808		wlan_ldo_en_default: wlan_ldo_default {
809			/* GPIO215 named WLAN_RST_N */
810			janice_cfg1 {
811				pins = "GPIO215_AH13";
812				ste,config = <&gpio_out_lo>;
813			};
814		};
815	};
816	/* Flash and torch */
817	flash {
818		gpio_flash_default_mode: flash_default {
819			janice_cfg1 {
820				pins = "GPIO140_B11", "GPIO141_C12";
821				ste,config = <&gpio_out_lo>;
822			};
823		};
824	};
825	/* GPIO keys */
826	gpio-keys {
827		gpio_keys_default_mode: gpio_keys_default {
828			skomer_cfg1 {
829				pins = "GPIO67_G2", /* VOL UP */
830				       "GPIO91_B6", /* HOME */
831				       "GPIO92_D6"; /* VOL DOWN */
832				ste,config = <&gpio_in_pu>;
833			};
834		};
835	};
836	/* Interrupt line for the Atmel MXT228 touchscreen */
837	tsp {
838		tsp_default: tsp_default {
839			janice_cfg1 {
840				pins = "GPIO218_AH11";	/* TSP_INT_1V8 */
841				ste,config = <&gpio_in_nopull>;
842			};
843		};
844	};
845	/* Reset line for the Yamaha YAS529 magnetometer */
846	yas529 {
847		yas529_default: yas529_janice {
848			janice_cfg1 {
849				pins = "GPIO204_AF23";
850				ste,config = <&gpio_out_hi>;
851			};
852		};
853	};
854	/* Interrupt line for light/proximity sensor GP2AP002 */
855	gp2ap002 {
856		gp2ap002_janice_default: gp2ap002_janice {
857			janice_cfg1 {
858				pins = "GPIO146_D13";
859				ste,config = <&gpio_in_nopull>;
860			};
861		};
862	};
863	/* Interrupt line for Invensense MPU3050 gyroscope */
864	mpu3050 {
865		mpu3050_janice_default: mpu3050_janice {
866			janice_cfg1 {
867				/* GPIO226 used for IRQ */
868				pins = "GPIO226_AF8";
869				ste,config = <&gpio_in_nopull>;
870			};
871		};
872	};
873	/* GPIO-based I2C bus for magnetometer and NCP6914 */
874	i2c-gpio-0 {
875		i2c_gpio_0_default: i2c_gpio_0 {
876			janice_cfg1 {
877				pins = "GPIO143_D12", "GPIO144_B13";
878				ste,config = <&gpio_in_nopull>;
879			};
880		};
881	};
882	/* GPIO-based I2C bus for the Cypress touchkeys */
883	i2c-gpio-1 {
884		i2c_gpio_1_default: i2c_gpio_1 {
885			janice_cfg1 {
886				pins = "GPIO196_AG26", "GPIO197_AH24";
887				ste,config = <&gpio_in_nopull>;
888			};
889		};
890	};
891	/* GPIO-based I2C bus for the Immersion ISA1200 */
892	i2c-gpio-2 {
893		i2c_gpio_2_default: i2c_gpio_2 {
894			janice_cfg1 {
895				pins = "GPIO201_AF24", "GPIO202_AF25";
896				ste,config = <&gpio_in_nopull>;
897			};
898		};
899	};
900	/* GPIO-based I2C bus for the NFC */
901	i2c-gpio-3 {
902		i2c_gpio_3_default: i2c_gpio_3 {
903			janice_cfg1 {
904				pins = "GPIO151_D17", "GPIO152_D16";
905				ste,config = <&gpio_in_nopull>;
906			};
907		};
908	};
909	/* GPIO-based SPI bus for the display */
910	spi-gpio-0 {
911		spi_gpio_0_default: spi_gpio_0 {
912			janice_cfg1 {
913				pins = "GPIO220_AH10", "GPIO223_AH9", "GPIO224_AG9";
914				ste,config = <&gpio_out_hi>;
915			};
916			/* This pin is unused but belongs with this SPI block */
917			janice_cfg2 {
918				pins = "GPIO225_AG8";
919				ste,config = <&in_pd>;
920			};
921		};
922	};
923	wlan {
924		wlan_default_mode: wlan_default {
925			/* GPIO216 for WL_HOST_WAKE */
926			janice_cfg2 {
927				pins = "GPIO216_AG12";
928				ste,config = <&gpio_in_pd>;
929			};
930		};
931	};
932	bluetooth {
933		bluetooth_default_mode: bluetooth_default {
934			/* GPIO199 BT_WAKE and GPIO222 BT_VREG_ON */
935			janice_cfg1 {
936				pins = "GPIO199_AH23", "GPIO222_AJ9";
937				ste,config = <&gpio_out_lo>;
938			};
939			/* GPIO97 BT_HOST_WAKE */
940			janice_cfg2 {
941				pins = "GPIO97_D9";
942				ste,config = <&gpio_in_nopull>;
943			};
944			/* GPIO209 BT_RST_N */
945			janice_cfg3 {
946				pins = "GPIO209_AG15";
947				ste,config = <&gpio_out_hi>;
948			};
949		};
950	};
951	/* Interrupt line for TI TSU6111 Micro USB switch */
952	tsu6111 {
953		tsu6111_janice_default: tsu6111_janice {
954			janice_cfg1 {
955				/* GPIO95 used for IRQ */
956				pins = "GPIO95_E8";
957				ste,config = <&gpio_in_nopull>;
958			};
959		};
960	};
961	nfc {
962		pn547_janice_default: pn547_janice {
963			/* Interrupt line */
964			janice_cfg1 {
965				pins = "GPIO32_V2";
966				ste,config = <&gpio_in_nopull>;
967			};
968			/* Enable and firmware GPIOs */
969			janice_cfg2 {
970				pins = "GPIO31_V3", "GPIO88_C4";
971				ste,config = <&gpio_out_lo>;
972			};
973		};
974	};
975	gsd4t {
976		gsd4t_janice_default: gsd4t_janice {
977			/* Reset line, start out asserted */
978			janice_cfg1 {
979				pins = "GPIO21_AB3";
980				ste,config = <&gpio_out_lo>;
981			};
982			/* GPS_ON_OFF, start out deasserted (off) */
983			janice_cfg2 {
984				pins = "GPIO96_D8";
985				ste,config = <&gpio_out_lo>;
986			};
987			/* Unused power enablement line, used in R0.0 and R0.1 boards */
988			janice_cfg3 {
989				pins = "GPIO86_C6";
990				ste,config = <&gpio_in_pd>;
991			};
992		};
993	};
994};
995