1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Samsung's Exynos4412 based p4note device family base DT.
4 * Based on exynos4412-midas.dtsi.
5 *
6 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
7 *		http://www.samsung.com
8 */
9
10/dts-v1/;
11#include "exynos4412.dtsi"
12#include "exynos4412-ppmu-common.dtsi"
13
14#include <dt-bindings/clock/maxim,max77686.h>
15#include <dt-bindings/gpio/gpio.h>
16#include <dt-bindings/input/linux-event-codes.h>
17#include <dt-bindings/interrupt-controller/irq.h>
18#include <dt-bindings/power/summit,smb347-charger.h>
19#include "exynos-pinctrl.h"
20
21/ {
22	compatible = "samsung,p4note", "samsung,exynos4412", "samsung,exynos4";
23
24	memory@40000000 {
25		device_type = "memory";
26		reg = <0x40000000 0x80000000>;
27	};
28
29	aliases {
30		mmc0 = &mshc_0;
31		mmc2 = &sdhci_2;
32		mmc3 = &sdhci_3;
33	};
34
35	chosen {
36		stdout-path = &serial_2;
37	};
38
39	firmware@204f000 {
40		compatible = "samsung,secure-firmware";
41		reg = <0x0204f000 0x1000>;
42	};
43
44	fixed-rate-clocks {
45		xxti {
46			compatible = "samsung,clock-xxti";
47			clock-frequency = <0>;
48		};
49
50		xusbxti {
51			compatible = "samsung,clock-xusbxti";
52			clock-frequency = <24000000>;
53		};
54	};
55
56	gpio-keys {
57		compatible = "gpio-keys";
58		pinctrl-names = "default";
59		pinctrl-0 = <&gpio_keys>;
60
61		key-down {
62			gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
63			linux,code = <KEY_VOLUMEDOWN>;
64			label = "volume down";
65			debounce-interval = <10>;
66		};
67
68		key-up {
69			gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
70			linux,code = <KEY_VOLUMEUP>;
71			label = "volume up";
72			debounce-interval = <10>;
73		};
74
75		key-power {
76			gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
77			linux,code = <KEY_POWER>;
78			label = "power";
79			debounce-interval = <10>;
80			wakeup-source;
81		};
82	};
83
84	voltage-regulator-1 {
85		compatible = "regulator-fixed";
86		regulator-name = "TSP_LDO1";
87		pinctrl-names = "default";
88		pinctrl-0 = <&tsp_reg_gpio_1>;
89		gpios = <&gpm4 5 GPIO_ACTIVE_HIGH>;
90		enable-active-high;
91		regulator-always-on;
92	};
93
94	voltage-regulator-2 {
95		compatible = "regulator-fixed";
96		regulator-name = "TSP_LDO2";
97		pinctrl-names = "default";
98		pinctrl-0 = <&tsp_reg_gpio_2>;
99		gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
100		enable-active-high;
101		regulator-always-on;
102	};
103
104	voltage-regulator-3 {
105		compatible = "regulator-fixed";
106		regulator-name = "TSP_LDO3";
107		pinctrl-names = "default";
108		pinctrl-0 = <&tsp_reg_gpio_3>;
109		gpios = <&gpb 7 GPIO_ACTIVE_HIGH>;
110		startup-delay-us = <20000>;
111		enable-active-high;
112		regulator-always-on;
113	};
114
115	panel_vdd: voltage-regulator-4 {
116		compatible = "regulator-fixed";
117		regulator-name = "LCD_ENABLE";
118		pinctrl-names = "default";
119		pinctrl-0 = <&lcd_enable>;
120		gpios = <&gpc0 1 GPIO_ACTIVE_HIGH>;
121		enable-active-high;
122		regulator-boot-on;
123	};
124
125	wlan_pwrseq: sdhci3-pwrseq {
126		compatible = "mmc-pwrseq-simple";
127		reset-gpios = <&gpm3 5 GPIO_ACTIVE_LOW>;
128		pinctrl-0 = <&wifi_reset>;
129		pinctrl-names = "default";
130		clocks = <&max77686 MAX77686_CLK_PMIC>;
131		clock-names = "ext_clock";
132	};
133
134	battery_cell: battery-cell {
135		compatible = "simple-battery";
136		device-chemistry = "lithium-ion";
137		constant-charge-current-max-microamp = <2200000>;
138		precharge-current-microamp = <250000>;
139		charge-term-current-microamp = <250000>;
140		constant-charge-voltage-max-microvolt = <4200000>;
141	};
142
143	i2c-gpio-1 {
144		compatible = "i2c-gpio";
145		sda-gpios = <&gpy2 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
146		scl-gpios = <&gpy2 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
147		i2c-gpio,delay-us = <2>;
148		#address-cells = <1>;
149		#size-cells = <0>;
150
151		magnetometer@c {
152			compatible = "asahi-kasei,ak8975";
153			reg = <0x0c>;
154			pinctrl-0 = <&ak8975_irq>;
155			pinctrl-names = "default";
156			interrupt-parent = <&gpm4>;
157			interrupts = <7 IRQ_TYPE_EDGE_RISING>;
158		};
159	};
160
161	i2c-gpio-2 {
162		compatible = "i2c-gpio";
163		sda-gpios = <&gpy0 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
164		scl-gpios = <&gpy0 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
165		i2c-gpio,delay-us = <2>;
166		#address-cells = <1>;
167		#size-cells = <0>;
168
169		fuel-gauge@36 {
170			compatible = "maxim,max17042";
171			reg = <0x36>;
172			pinctrl-0 = <&fuel_alert_irq>;
173			pinctrl-names = "default";
174			interrupt-parent = <&gpx2>;
175			interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
176			maxim,rsns-microohm = <10000>;
177			maxim,over-heat-temp = <600>;
178			maxim,over-volt = <4300>;
179		};
180	};
181
182	i2c-gpio-3 {
183		compatible = "i2c-gpio";
184		sda-gpios = <&gpm4 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
185		scl-gpios = <&gpm4 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
186		i2c-gpio,delay-us = <5>;
187		#address-cells = <1>;
188		#size-cells = <0>;
189
190		adc@41 {
191			compatible = "st,stmpe811";
192			reg = <0x41>;
193			pinctrl-0 = <&stmpe_adc_irq>;
194			pinctrl-names = "default";
195			interrupt-parent = <&gpx0>;
196			interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
197			st,adc-freq = <3>;
198			st,mod-12b = <1>;
199			st,ref-sel = <0>;
200			st,sample-time = <3>;
201
202			adc {
203				compatible = "st,stmpe-adc";
204				#io-channel-cells = <1>;
205				st,norequest-mask = <0x2f>;
206			};
207		};
208	};
209
210	i2c-gpio-4 {
211		compatible = "i2c-gpio";
212		sda-gpios = <&gpm2 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
213		scl-gpios = <&gpm2 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
214
215		i2c-gpio,delay-us = <2>;
216		#address-cells = <1>;
217		#size-cells = <0>;
218
219		power_supply: charger@6 {
220			compatible = "summit,smb347";
221			reg = <0x6>;
222			summit,enable-usb-charging;
223			summit,enable-charge-control = <SMB3XX_CHG_ENABLE_SW>;
224			summit,fast-voltage-threshold-microvolt = <2600000>;
225			summit,chip-temperature-threshold-celsius = <130>;
226			summit,usb-current-limit-microamp = <1800000>;
227
228			monitored-battery = <&battery_cell>;
229		};
230	};
231
232	panel {
233		compatible = "samsung,ltl101al01";
234		pinctrl-0 = <&lvds_nshdn>;
235		pinctrl-names = "default";
236		power-supply = <&panel_vdd>;
237		enable-gpios = <&gpm0 5 GPIO_ACTIVE_HIGH>;
238		backlight = <&backlight>;
239
240		port {
241			lcd_ep: endpoint {
242				remote-endpoint = <&fimd_ep>;
243			};
244		};
245	};
246
247	backlight: backlight {
248		compatible = "pwm-backlight";
249		pinctrl-0 = <&led_bl_reset>;
250		pinctrl-names = "default";
251		enable-gpios = <&gpm0 1 GPIO_ACTIVE_HIGH>;
252		power-supply = <&panel_vdd>;
253		pwms = <&pwm 1 78770 0>;
254		brightness-levels = <0 48 128 255>;
255		num-interpolated-steps = <8>;
256		default-brightness-level = <12>;
257	};
258};
259
260&adc {
261	vdd-supply = <&ldo3_reg>;
262	/* not verified */
263	status = "okay";
264};
265
266&bus_dmc {
267	devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
268	vdd-supply = <&buck1_reg>;
269	status = "okay";
270};
271
272&bus_acp {
273	devfreq = <&bus_dmc>;
274	status = "okay";
275};
276
277&bus_c2c {
278	devfreq = <&bus_dmc>;
279	status = "okay";
280};
281
282&bus_leftbus {
283	devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
284	vdd-supply = <&buck3_reg>;
285	status = "okay";
286};
287
288&bus_rightbus {
289	devfreq = <&bus_leftbus>;
290	status = "okay";
291};
292
293&bus_display {
294	devfreq = <&bus_leftbus>;
295	status = "okay";
296};
297
298&bus_fsys {
299	devfreq = <&bus_leftbus>;
300	status = "okay";
301};
302
303&bus_peri {
304	devfreq = <&bus_leftbus>;
305	status = "okay";
306};
307
308&bus_mfc {
309	devfreq = <&bus_leftbus>;
310	status = "okay";
311};
312
313&cpu0 {
314	cpu0-supply = <&buck2_reg>;
315};
316
317&cpu_thermal {
318	cooling-maps {
319		map0 {
320			/* Corresponds to 800MHz at freq_table */
321			cooling-device = <&cpu0 7 7>, <&cpu1 7 7>,
322					 <&cpu2 7 7>, <&cpu3 7 7>;
323		};
324		map1 {
325			/* Corresponds to 200MHz at freq_table */
326			cooling-device = <&cpu0 13 13>, <&cpu1 13 13>,
327					 <&cpu2 13 13>, <&cpu3 13 13>;
328		};
329	};
330};
331
332&exynos_usbphy {
333	status = "okay";
334};
335
336&fimd {
337	pinctrl-0 = <&lcd_clk &lcd_data24>;
338	pinctrl-names = "default";
339	#address-cells = <1>;
340	#size-cells = <0>;
341	status = "okay";
342
343	samsung,invert-vclk;
344
345	port@3 {
346		reg = <3>;
347
348		fimd_ep: endpoint {
349			remote-endpoint = <&lcd_ep>;
350		};
351	};
352};
353
354&gpu {
355	mali-supply = <&buck4_reg>;
356	status = "okay";
357};
358
359&hsotg {
360	vusb_a-supply = <&ldo12_reg>;
361	dr_mode = "peripheral";
362	status = "okay";
363};
364
365&i2c_3 {
366	samsung,i2c-sda-delay = <100>;
367	samsung,i2c-slave-addr = <0x10>;
368	samsung,i2c-max-bus-freq = <400000>;
369	pinctrl-0 = <&i2c3_bus>;
370	pinctrl-names = "default";
371	status = "okay";
372
373	touchscreen@4a {
374		compatible = "atmel,maxtouch";
375		reg = <0x4a>;
376		pinctrl-0 = <&tsp_rst &tsp_irq>;
377		pinctrl-names = "default";
378		interrupt-parent = <&gpm2>;
379		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
380		reset-gpios = <&gpm0 4 GPIO_ACTIVE_LOW>;
381	};
382};
383
384&i2c_7 {
385	samsung,i2c-sda-delay = <100>;
386	samsung,i2c-slave-addr = <0x10>;
387	samsung,i2c-max-bus-freq = <400000>;
388	pinctrl-0 = <&i2c7_bus>;
389	pinctrl-names = "default";
390	status = "okay";
391
392	max77686: pmic@9 {
393		compatible = "maxim,max77686";
394		interrupt-parent = <&gpx0>;
395		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
396		pinctrl-0 = <&max77686_irq>;
397		pinctrl-names = "default";
398		wakeup-source;
399		reg = <0x09>;
400		#clock-cells = <1>;
401
402		voltage-regulators {
403			ldo1_reg: LDO1 {
404				regulator-name = "ldo1";
405				regulator-always-on;
406			};
407
408			ldo2_reg: LDO2 {
409				regulator-name = "ldo2";
410				regulator-always-on;
411			};
412
413			/* WM8994 audio */
414			ldo3_reg: LDO3 {
415				regulator-name = "VCC_1.8V_AP";
416				regulator-min-microvolt = <1800000>;
417				regulator-max-microvolt = <1800000>;
418				regulator-always-on;
419				regulator-boot-on;
420
421				regulator-state-mem {
422					regulator-on-in-suspend;
423				};
424			};
425
426			ldo4_reg: LDO4 {
427				regulator-name = "ldo4";
428				regulator-always-on;
429			};
430
431			ldo5_reg: LDO5 {
432				regulator-name = "VCC_1.8V_IO";
433				regulator-min-microvolt = <1800000>;
434				regulator-max-microvolt = <1800000>;
435
436				regulator-state-mem {
437					regulator-off-in-suspend;
438				};
439			};
440
441			ldo6_reg: LDO6 {
442				regulator-name = "ldo6";
443				regulator-always-on;
444			};
445
446			ldo7_reg: LDO7 {
447				regulator-name = "ldo7";
448				regulator-always-on;
449			};
450
451			/* CSI IP block */
452			ldo8_reg: LDO8 {
453				regulator-name = "VMIPI_1.0V";
454				regulator-min-microvolt = <1000000>;
455				regulator-max-microvolt = <1000000>;
456				regulator-always-on;
457				regulator-boot-on;
458
459				regulator-state-mem {
460					regulator-on-in-suspend;
461				};
462			};
463
464			/* IR LED on/off */
465			ldo9_reg: LDO9 {
466				regulator-name = "VLED_IC_1.9V";
467				regulator-min-microvolt = <1950000>;
468				regulator-max-microvolt = <1950000>;
469
470				regulator-state-mem {
471					regulator-off-in-suspend;
472				};
473			};
474
475			/* CSI IP block */
476			ldo10_reg: LDO10 {
477				regulator-name = "VMIPI_1.8V";
478				regulator-min-microvolt = <1800000>;
479				regulator-max-microvolt = <1800000>;
480				regulator-always-on;
481				regulator-boot-on;
482
483				regulator-state-mem {
484					regulator-on-in-suspend;
485				};
486			};
487
488			ldo11_reg: LDO11 {
489				regulator-name = "VABB1_1.9V";
490				regulator-min-microvolt = <1950000>;
491				regulator-max-microvolt = <1950000>;
492				regulator-always-on;
493				regulator-boot-on;
494
495				regulator-state-mem {
496					regulator-off-in-suspend;
497				};
498			};
499
500			/* USB OTG */
501			ldo12_reg: LDO12 {
502				regulator-name = "VUOTG_3.0V";
503				regulator-min-microvolt = <3000000>;
504				regulator-max-microvolt = <3000000>;
505				regulator-always-on;
506				regulator-boot-on;
507
508				regulator-state-mem {
509					regulator-on-in-suspend;
510				};
511			};
512
513			/* not connected */
514			ldo13_reg: LDO13 {
515				regulator-name = "ldo13";
516			};
517
518			ldo14_reg: LDO14 {
519				regulator-name = "VABB2_1.9V";
520				regulator-min-microvolt = <1950000>;
521				regulator-max-microvolt = <1950000>;
522				regulator-always-on;
523				regulator-boot-on;
524
525				regulator-state-mem {
526					regulator-off-in-suspend;
527				};
528			};
529
530			ldo15_reg: LDO15 {
531				regulator-name = "ldo15";
532				regulator-always-on;
533			};
534
535			ldo16_reg: LDO16 {
536				regulator-name = "ldo16";
537				regulator-always-on;
538			};
539
540			/* not connected */
541			ldo17_reg: LDO17 {
542				regulator-name = "ldo17";
543			};
544
545			/* Camera ISX012 */
546			ldo18_reg: LDO18 {
547				regulator-name = "CAM_IO_1.8V";
548				regulator-min-microvolt = <1800000>;
549				regulator-max-microvolt = <1800000>;
550
551				regulator-state-mem {
552					regulator-off-in-suspend;
553				};
554			};
555
556			/* Camera S5K6A3 */
557			ldo19_reg: LDO19 {
558				regulator-name = "VT_CORE_1.8V";
559				regulator-min-microvolt = <1800000>;
560				regulator-max-microvolt = <1800000>;
561
562				regulator-state-mem {
563					regulator-off-in-suspend;
564				};
565			};
566
567			/* not connected */
568			ldo20_reg: LDO20 {
569				regulator-name = "ldo20";
570			};
571
572			/* MMC2 */
573			ldo21_reg: LDO21 {
574				regulator-name = "VTF_2.8V";
575				regulator-min-microvolt = <2800000>;
576				regulator-max-microvolt = <2800000>;
577				maxim,ena-gpios = <&gpy2 0 GPIO_ACTIVE_HIGH>;
578			};
579
580			/* not connected */
581			ldo22_reg: LDO22 {
582				regulator-name = "ldo22";
583			};
584
585			/* ADC */
586			ldo23_reg: LDO23 {
587				regulator-name = "VDD_ADC_3.3V";
588				regulator-min-microvolt = <3300000>;
589				regulator-max-microvolt = <3300000>;
590				regulator-always-on;
591				regulator-boot-on;
592
593				regulator-state-mem {
594					regulator-off-in-suspend;
595				};
596			};
597
598			/* Camera S5K6A3 */
599			ldo24_reg: LDO24 {
600				regulator-name = "CAM_A2.8V";
601				regulator-min-microvolt = <2800000>;
602				regulator-max-microvolt = <2800000>;
603
604				regulator-state-mem {
605					regulator-off-in-suspend;
606				};
607			};
608
609			ldo25_reg: LDO25 {
610				regulator-name = "VLED_3.3V";
611				regulator-min-microvolt = <3300000>;
612				regulator-max-microvolt = <3300000>;
613
614				regulator-state-mem {
615					regulator-off-in-suspend;
616				};
617			};
618
619			/* Camera ISX012 */
620			ldo26_reg: LDO26 {
621				regulator-name = "3MP_AF_2.8V";
622				regulator-min-microvolt = <2800000>;
623				regulator-max-microvolt = <2800000>;
624
625				regulator-state-mem {
626					regulator-off-in-suspend;
627				};
628			};
629
630			buck1_reg: BUCK1 {
631				regulator-name = "VDD_MIF";
632				regulator-min-microvolt = <850000>;
633				regulator-max-microvolt = <1050000>;
634				regulator-always-on;
635				regulator-boot-on;
636			};
637
638			buck2_reg: BUCK2 {
639				regulator-name = "VDD_ARM";
640				regulator-min-microvolt = <850000>;
641				regulator-max-microvolt = <1500000>;
642				regulator-always-on;
643				regulator-boot-on;
644			};
645
646			buck3_reg: BUCK3 {
647				regulator-name = "VDD_INT";
648				regulator-min-microvolt = <850000>;
649				regulator-max-microvolt = <1100000>;
650				regulator-always-on;
651				regulator-boot-on;
652			};
653
654			buck4_reg: BUCK4 {
655				regulator-name = "VDD_G3D";
656				regulator-min-microvolt = <850000>;
657				regulator-max-microvolt = <1075000>;
658				regulator-boot-on;
659			};
660
661			buck5_reg: BUCK5 {
662				regulator-name = "buck5";
663				regulator-always-on;
664			};
665
666			buck6_reg: BUCK6 {
667				regulator-name = "buck6";
668				regulator-always-on;
669			};
670
671			buck7_reg: BUCK7 {
672				regulator-name = "buck7";
673				regulator-always-on;
674			};
675
676			/* not connected */
677			buck8_reg: BUCK8 {
678				regulator-name = "buck8";
679			};
680
681			buck9_reg: BUCK9 {
682				regulator-name = "3MP_CORE_1.2V";
683				regulator-min-microvolt = <1200000>;
684				regulator-max-microvolt = <1200000>;
685
686				regulator-state-mem {
687					regulator-off-in-suspend;
688				};
689			};
690		};
691	};
692};
693
694&mshc_0 {
695	broken-cd;
696	non-removable;
697	card-detect-delay = <200>;
698	clock-frequency = <400000000>;
699	samsung,dw-mshc-ciu-div = <0>;
700	samsung,dw-mshc-sdr-timing = <2 3>;
701	samsung,dw-mshc-ddr-timing = <1 2>;
702	mmc-ddr-1_8v;
703	pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
704	pinctrl-names = "default";
705	bus-width = <4>;
706	cap-mmc-highspeed;
707	cap-sd-highspeed;
708	status = "okay";
709};
710
711&pinctrl_0 {
712	pinctrl-names = "default";
713	pinctrl-0 = <&sleep0>;
714
715	tsp_reg_gpio_2: tsp-reg-gpio-2-pins {
716		samsung,pins = "gpb-5";
717		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
718		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
719	};
720
721	tsp_reg_gpio_3: tsp-reg-gpio-3-pins {
722		samsung,pins = "gpb-7";
723		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
724		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
725	};
726
727	lcd_enable: lcd-enable-pins {
728		samsung,pins = "gpc0-1";
729		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
730		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
731	};
732
733	sleep0: sleep-state {
734		PIN_SLP(gpa0-0, INPUT, NONE);
735		PIN_SLP(gpa0-1, OUT0, NONE);
736		PIN_SLP(gpa0-2, INPUT, NONE);
737		PIN_SLP(gpa0-3, INPUT, UP);
738		PIN_SLP(gpa0-4, INPUT, NONE);
739		PIN_SLP(gpa0-5, INPUT, DOWN);
740		PIN_SLP(gpa0-6, INPUT, DOWN);
741		PIN_SLP(gpa0-7, INPUT, UP);
742
743		PIN_SLP(gpa1-0, INPUT, DOWN);
744		PIN_SLP(gpa1-1, INPUT, DOWN);
745		PIN_SLP(gpa1-2, INPUT, DOWN);
746		PIN_SLP(gpa1-3, INPUT, DOWN);
747		PIN_SLP(gpa1-4, INPUT, DOWN);
748		PIN_SLP(gpa1-5, INPUT, DOWN);
749
750		PIN_SLP(gpb-0, INPUT, NONE);
751		PIN_SLP(gpb-1, INPUT, NONE);
752		PIN_SLP(gpb-2, INPUT, NONE);
753		PIN_SLP(gpb-3, INPUT, NONE);
754		PIN_SLP(gpb-4, INPUT, DOWN);
755		PIN_SLP(gpb-5, INPUT, DOWN);
756		PIN_SLP(gpb-6, INPUT, DOWN);
757		PIN_SLP(gpb-7, INPUT, DOWN);
758
759		PIN_SLP(gpc0-0, INPUT, DOWN);
760		PIN_SLP(gpc0-1, INPUT, DOWN);
761		PIN_SLP(gpc0-2, INPUT, DOWN);
762		PIN_SLP(gpc0-3, INPUT, DOWN);
763		PIN_SLP(gpc0-4, INPUT, DOWN);
764
765		PIN_SLP(gpc1-0, INPUT, UP);
766		PIN_SLP(gpc1-1, PREV, NONE);
767		PIN_SLP(gpc1-2, INPUT, UP);
768		PIN_SLP(gpc1-3, INPUT, UP);
769		PIN_SLP(gpc1-4, INPUT, UP);
770
771		PIN_SLP(gpd0-0, INPUT, DOWN);
772		PIN_SLP(gpd0-1, OUT0, NONE);
773		PIN_SLP(gpd0-2, INPUT, NONE);
774		PIN_SLP(gpd0-3, INPUT, NONE);
775
776		PIN_SLP(gpd1-0, INPUT, DOWN);
777		PIN_SLP(gpd1-1, INPUT, DOWN);
778		PIN_SLP(gpd1-2, INPUT, NONE);
779		PIN_SLP(gpd1-3, INPUT, NONE);
780
781		PIN_SLP(gpf0-0, OUT0, NONE);
782		PIN_SLP(gpf0-1, OUT0, NONE);
783		PIN_SLP(gpf0-2, OUT0, NONE);
784		PIN_SLP(gpf0-3, OUT0, NONE);
785		PIN_SLP(gpf0-4, OUT0, NONE);
786		PIN_SLP(gpf0-5, OUT0, NONE);
787		PIN_SLP(gpf0-6, OUT0, NONE);
788		PIN_SLP(gpf0-7, OUT0, NONE);
789
790		PIN_SLP(gpf1-0, OUT0, NONE);
791		PIN_SLP(gpf1-1, OUT0, NONE);
792		PIN_SLP(gpf1-2, OUT0, NONE);
793		PIN_SLP(gpf1-3, OUT0, NONE);
794		PIN_SLP(gpf1-4, OUT0, NONE);
795		PIN_SLP(gpf1-5, OUT0, NONE);
796		PIN_SLP(gpf1-6, OUT0, NONE);
797		PIN_SLP(gpf1-7, OUT0, NONE);
798
799		PIN_SLP(gpf2-0, OUT0, NONE);
800		PIN_SLP(gpf2-1, OUT0, NONE);
801		PIN_SLP(gpf2-2, OUT0, NONE);
802		PIN_SLP(gpf2-3, OUT0, NONE);
803		PIN_SLP(gpf2-4, OUT0, NONE);
804		PIN_SLP(gpf2-5, OUT0, NONE);
805		PIN_SLP(gpf2-6, OUT0, NONE);
806		PIN_SLP(gpf2-7, OUT0, NONE);
807
808		PIN_SLP(gpf3-0, OUT0, NONE);
809		PIN_SLP(gpf3-1, OUT0, NONE);
810		PIN_SLP(gpf3-2, OUT0, NONE);
811		PIN_SLP(gpf3-3, OUT0, NONE);
812		PIN_SLP(gpf3-4, OUT0, NONE);
813		PIN_SLP(gpf3-5, OUT0, NONE);
814
815		PIN_SLP(gpj0-0, INPUT, DOWN);
816		PIN_SLP(gpj0-1, INPUT, DOWN);
817		PIN_SLP(gpj0-2, INPUT, DOWN);
818		PIN_SLP(gpj0-3, PREV, NONE);
819		PIN_SLP(gpj0-4, PREV, NONE);
820		PIN_SLP(gpj0-5, OUT0, NONE);
821		PIN_SLP(gpj0-6, OUT0, NONE);
822		PIN_SLP(gpj0-7, OUT0, NONE);
823
824		PIN_SLP(gpj1-0, OUT0, NONE);
825		PIN_SLP(gpj1-1, INPUT, DOWN);
826		PIN_SLP(gpj1-2, PREV, NONE);
827		PIN_SLP(gpj1-3, OUT0, NONE);
828	};
829};
830
831&pinctrl_1 {
832	pinctrl-names = "default";
833	pinctrl-0 = <&sleep1>;
834
835	sd3_wifi: sd3-wifi-pins {
836		samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
837		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
838		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
839	};
840
841	bt_shutdown: bt-shutdown-pins {
842		samsung,pins = "gpl0-6";
843		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
844		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
845	};
846
847	uart_sel: uart-sel-pins {
848		samsung,pins = "gpl2-7";
849		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
850		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
851		samsung,pin-val = <1>;
852		/* 0 = CP, 1 = AP (serial output) */
853	};
854
855	led_bl_reset: led-bl-reset-pins {
856		samsung,pins = "gpm0-1";
857		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
858		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
859	};
860
861	tsp_rst: tsp-rst-pins {
862		samsung,pins = "gpm0-4";
863		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
864		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
865	};
866
867	lvds_nshdn: lvds-nshdn-pins {
868		samsung,pins = "gpm0-5";
869		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
870		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
871	};
872
873	tsp_irq: tsp-irq-pins {
874		samsung,pins = "gpm2-3";
875		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
876		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
877	};
878
879	wifi_reset: wifi-reset-pins {
880		samsung,pins = "gpm3-5";
881		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
882		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
883	};
884
885	tsp_reg_gpio_1: tsp-reg-gpio-1-pins {
886		samsung,pins = "gpm4-5";
887		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
888		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
889	};
890
891	ak8975_irq: ak8975-irq-pins {
892		samsung,pins = "gpm4-7";
893		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
894		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
895	};
896
897	stmpe_adc_irq: stmpe-adc-irq-pins {
898		samsung,pins = "gpx0-1";
899		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
900		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
901	};
902
903	max77686_irq: max77686-irq-pins {
904		samsung,pins = "gpx0-7";
905		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
906	};
907
908	gpio_keys: gpio-keys-pins {
909		samsung,pins = "gpx2-2", "gpx2-7", "gpx3-3";
910		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
911	};
912
913	fuel_alert_irq: fuel-alert-irq-pins {
914		samsung,pins = "gpx2-3";
915		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
916		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
917	};
918
919	wifi_host_wake: wifi-host-wake-pins {
920		samsung,pins = "gpx2-5";
921		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
922		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
923	};
924
925	bt_host_wakeup: bt-host-wakeup-pins {
926		samsung,pins = "gpx2-6";
927		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
928		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
929	};
930
931	bt_device_wakeup: bt-device-wakeup-pins {
932		samsung,pins = "gpx3-1";
933		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
934		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
935	};
936
937	sdhci2_cd: sdhci2-cd-pins {
938		samsung,pins = "gpx3-4";
939		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
940	};
941
942	sleep1: sleep-state {
943		PIN_SLP(gpk0-0, PREV, NONE);
944		PIN_SLP(gpk0-1, PREV, NONE);
945		PIN_SLP(gpk0-2, PREV, NONE);
946		PIN_SLP(gpk0-3, PREV, NONE);
947		PIN_SLP(gpk0-4, PREV, NONE);
948		PIN_SLP(gpk0-5, PREV, NONE);
949		PIN_SLP(gpk0-6, PREV, NONE);
950
951		PIN_SLP(gpk1-0, INPUT, DOWN);
952		PIN_SLP(gpk1-1, INPUT, DOWN);
953		PIN_SLP(gpk1-2, INPUT, DOWN);
954		PIN_SLP(gpk1-3, PREV, NONE);
955		PIN_SLP(gpk1-4, PREV, NONE);
956		PIN_SLP(gpk1-5, PREV, NONE);
957		PIN_SLP(gpk1-6, PREV, NONE);
958
959		PIN_SLP(gpk2-0, INPUT, DOWN);
960		PIN_SLP(gpk2-1, INPUT, DOWN);
961		PIN_SLP(gpk2-2, INPUT, DOWN);
962		PIN_SLP(gpk2-3, INPUT, DOWN);
963		PIN_SLP(gpk2-4, INPUT, DOWN);
964		PIN_SLP(gpk2-5, INPUT, DOWN);
965		PIN_SLP(gpk2-6, INPUT, DOWN);
966
967		PIN_SLP(gpk3-0, OUT0, NONE);
968		PIN_SLP(gpk3-1, INPUT, NONE);
969		PIN_SLP(gpk3-2, INPUT, DOWN);
970		PIN_SLP(gpk3-3, INPUT, NONE);
971		PIN_SLP(gpk3-4, INPUT, NONE);
972		PIN_SLP(gpk3-5, INPUT, NONE);
973		PIN_SLP(gpk3-6, INPUT, NONE);
974
975		PIN_SLP(gpl0-0, OUT0, NONE);
976		PIN_SLP(gpl0-1, INPUT, NONE);
977		PIN_SLP(gpl0-2, INPUT, NONE);
978		PIN_SLP(gpl0-3, INPUT, DOWN);
979		PIN_SLP(gpl0-4, PREV, NONE);
980		PIN_SLP(gpl0-6, PREV, NONE);
981
982		PIN_SLP(gpl1-0, OUT0, NONE);
983		PIN_SLP(gpl1-1, OUT0, NONE);
984
985		PIN_SLP(gpl2-0, INPUT, DOWN);
986		PIN_SLP(gpl2-1, INPUT, DOWN);
987		PIN_SLP(gpl2-2, INPUT, DOWN);
988		PIN_SLP(gpl2-3, INPUT, DOWN);
989		PIN_SLP(gpl2-4, OUT0, NONE);
990		PIN_SLP(gpl2-5, INPUT, DOWN);
991		PIN_SLP(gpl2-6, PREV, NONE);
992		PIN_SLP(gpl2-7, PREV, NONE);
993
994		PIN_SLP(gpm0-0, PREV, NONE);
995		PIN_SLP(gpm0-1, OUT0, NONE);
996		PIN_SLP(gpm0-2, INPUT, DOWN);
997		PIN_SLP(gpm0-3, INPUT, NONE);
998		PIN_SLP(gpm0-4, OUT0, NONE);
999		PIN_SLP(gpm0-5, OUT0, NONE);
1000		PIN_SLP(gpm0-6, INPUT, DOWN);
1001		PIN_SLP(gpm0-7, OUT0, NONE);
1002
1003		PIN_SLP(gpm1-0, INPUT, NONE);
1004		PIN_SLP(gpm1-1, INPUT, NONE);
1005		PIN_SLP(gpm1-2, INPUT, NONE);
1006		PIN_SLP(gpm1-3, INPUT, NONE);
1007		PIN_SLP(gpm1-4, INPUT, NONE);
1008		PIN_SLP(gpm1-5, INPUT, NONE);
1009		PIN_SLP(gpm1-6, INPUT, DOWN);
1010
1011		PIN_SLP(gpm2-0, INPUT, NONE);
1012		PIN_SLP(gpm2-1, INPUT, NONE);
1013		PIN_SLP(gpm2-2, OUT0, NONE);
1014		PIN_SLP(gpm2-3, OUT0, DOWN);
1015		PIN_SLP(gpm2-4, INPUT, DOWN);
1016
1017		PIN_SLP(gpm3-0, PREV, NONE);
1018		PIN_SLP(gpm3-1, PREV, NONE);
1019		PIN_SLP(gpm3-2, PREV, NONE);
1020		PIN_SLP(gpm3-3, OUT1, NONE);
1021		PIN_SLP(gpm3-4, OUT0, DOWN);
1022		PIN_SLP(gpm3-5, PREV, NONE);
1023		PIN_SLP(gpm3-6, PREV, NONE);
1024		PIN_SLP(gpm3-7, OUT0, NONE);
1025
1026		PIN_SLP(gpm4-0, INPUT, NONE);
1027		PIN_SLP(gpm4-1, INPUT, NONE);
1028		PIN_SLP(gpm4-2, INPUT, DOWN);
1029		PIN_SLP(gpm4-3, INPUT, DOWN);
1030		PIN_SLP(gpm4-4, PREV, NONE);
1031		PIN_SLP(gpm4-5, OUT0, NONE);
1032		PIN_SLP(gpm4-6, OUT0, NONE);
1033		PIN_SLP(gpm4-7, INPUT, DOWN);
1034
1035		PIN_SLP(gpy0-0, INPUT, DOWN);
1036		PIN_SLP(gpy0-1, INPUT, DOWN);
1037		PIN_SLP(gpy0-2, INPUT, NONE);
1038		PIN_SLP(gpy0-3, INPUT, NONE);
1039		PIN_SLP(gpy0-4, INPUT, NONE);
1040		PIN_SLP(gpy0-5, INPUT, NONE);
1041
1042		PIN_SLP(gpy1-0, INPUT, DOWN);
1043		PIN_SLP(gpy1-1, INPUT, DOWN);
1044		PIN_SLP(gpy1-2, INPUT, DOWN);
1045		PIN_SLP(gpy1-3, INPUT, DOWN);
1046
1047		PIN_SLP(gpy2-0, PREV, NONE);
1048		PIN_SLP(gpy2-1, INPUT, DOWN);
1049		PIN_SLP(gpy2-2, INPUT, NONE);
1050		PIN_SLP(gpy2-3, INPUT, NONE);
1051		PIN_SLP(gpy2-4, INPUT, NONE);
1052		PIN_SLP(gpy2-5, INPUT, NONE);
1053
1054		PIN_SLP(gpy3-0, INPUT, DOWN);
1055		PIN_SLP(gpy3-1, INPUT, DOWN);
1056		PIN_SLP(gpy3-2, INPUT, DOWN);
1057		PIN_SLP(gpy3-3, INPUT, DOWN);
1058		PIN_SLP(gpy3-4, INPUT, DOWN);
1059		PIN_SLP(gpy3-5, INPUT, DOWN);
1060		PIN_SLP(gpy3-6, INPUT, DOWN);
1061		PIN_SLP(gpy3-7, INPUT, DOWN);
1062
1063		PIN_SLP(gpy4-0, INPUT, DOWN);
1064		PIN_SLP(gpy4-1, INPUT, DOWN);
1065		PIN_SLP(gpy4-2, INPUT, DOWN);
1066		PIN_SLP(gpy4-3, INPUT, DOWN);
1067		PIN_SLP(gpy4-4, INPUT, DOWN);
1068		PIN_SLP(gpy4-5, INPUT, DOWN);
1069		PIN_SLP(gpy4-6, INPUT, DOWN);
1070		PIN_SLP(gpy4-7, INPUT, DOWN);
1071
1072		PIN_SLP(gpy5-0, INPUT, DOWN);
1073		PIN_SLP(gpy5-1, INPUT, DOWN);
1074		PIN_SLP(gpy5-2, INPUT, DOWN);
1075		PIN_SLP(gpy5-3, INPUT, DOWN);
1076		PIN_SLP(gpy5-4, INPUT, DOWN);
1077		PIN_SLP(gpy5-5, INPUT, DOWN);
1078		PIN_SLP(gpy5-6, INPUT, DOWN);
1079		PIN_SLP(gpy5-7, INPUT, DOWN);
1080
1081		PIN_SLP(gpy6-0, INPUT, DOWN);
1082		PIN_SLP(gpy6-1, INPUT, DOWN);
1083		PIN_SLP(gpy6-2, INPUT, DOWN);
1084		PIN_SLP(gpy6-3, INPUT, DOWN);
1085		PIN_SLP(gpy6-4, INPUT, DOWN);
1086		PIN_SLP(gpy6-5, INPUT, DOWN);
1087		PIN_SLP(gpy6-6, INPUT, DOWN);
1088		PIN_SLP(gpy6-7, INPUT, DOWN);
1089	};
1090};
1091
1092&pinctrl_2 {
1093	pinctrl-names = "default";
1094	pinctrl-0 = <&sleep2>;
1095
1096	sleep2: sleep-state {
1097		PIN_SLP(gpz-0, INPUT, DOWN);
1098		PIN_SLP(gpz-1, INPUT, DOWN);
1099		PIN_SLP(gpz-2, INPUT, DOWN);
1100		PIN_SLP(gpz-3, INPUT, DOWN);
1101		PIN_SLP(gpz-4, INPUT, DOWN);
1102		PIN_SLP(gpz-5, INPUT, DOWN);
1103		PIN_SLP(gpz-6, INPUT, DOWN);
1104	};
1105};
1106
1107&pinctrl_3 {
1108	pinctrl-names = "default";
1109	pinctrl-0 = <&sleep3>;
1110
1111	sleep3: sleep-state {
1112		PIN_SLP(gpv0-0, INPUT, DOWN);
1113		PIN_SLP(gpv0-1, INPUT, DOWN);
1114		PIN_SLP(gpv0-2, INPUT, DOWN);
1115		PIN_SLP(gpv0-3, INPUT, DOWN);
1116		PIN_SLP(gpv0-4, INPUT, DOWN);
1117		PIN_SLP(gpv0-5, INPUT, DOWN);
1118		PIN_SLP(gpv0-6, INPUT, DOWN);
1119		PIN_SLP(gpv0-7, INPUT, DOWN);
1120
1121		PIN_SLP(gpv1-0, INPUT, DOWN);
1122		PIN_SLP(gpv1-1, INPUT, DOWN);
1123		PIN_SLP(gpv1-2, INPUT, DOWN);
1124		PIN_SLP(gpv1-3, INPUT, DOWN);
1125		PIN_SLP(gpv1-4, INPUT, DOWN);
1126		PIN_SLP(gpv1-5, INPUT, DOWN);
1127		PIN_SLP(gpv1-6, INPUT, DOWN);
1128		PIN_SLP(gpv1-7, INPUT, DOWN);
1129
1130		PIN_SLP(gpv2-0, INPUT, DOWN);
1131		PIN_SLP(gpv2-1, INPUT, DOWN);
1132		PIN_SLP(gpv2-2, INPUT, DOWN);
1133		PIN_SLP(gpv2-3, INPUT, DOWN);
1134		PIN_SLP(gpv2-4, INPUT, DOWN);
1135		PIN_SLP(gpv2-5, INPUT, DOWN);
1136		PIN_SLP(gpv2-6, INPUT, DOWN);
1137		PIN_SLP(gpv2-7, INPUT, DOWN);
1138
1139		PIN_SLP(gpv3-0, INPUT, DOWN);
1140		PIN_SLP(gpv3-1, INPUT, DOWN);
1141		PIN_SLP(gpv3-2, INPUT, DOWN);
1142		PIN_SLP(gpv3-3, INPUT, DOWN);
1143		PIN_SLP(gpv3-4, INPUT, DOWN);
1144		PIN_SLP(gpv3-5, INPUT, DOWN);
1145		PIN_SLP(gpv3-6, INPUT, DOWN);
1146		PIN_SLP(gpv3-7, INPUT, DOWN);
1147
1148		PIN_SLP(gpv4-0, INPUT, DOWN);
1149		PIN_SLP(gpv4-1, INPUT, DOWN);
1150	};
1151};
1152
1153&pmu_system_controller {
1154	assigned-clocks = <&pmu_system_controller 0>;
1155	assigned-clock-parents = <&clock CLK_XUSBXTI>;
1156};
1157
1158&pwm {
1159	pinctrl-0 = <&pwm1_out>;
1160	pinctrl-names = "default";
1161	samsung,pwm-outputs = <1>;
1162	status = "okay";
1163};
1164
1165&rtc {
1166	clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
1167	clock-names = "rtc", "rtc_src";
1168	status = "okay";
1169};
1170
1171&sdhci_2 {
1172	bus-width = <4>;
1173	cd-gpios = <&gpx3 4 GPIO_ACTIVE_LOW>;
1174	pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sdhci2_cd>;
1175	pinctrl-names = "default";
1176	vmmc-supply = <&ldo21_reg>;
1177	status = "okay";
1178};
1179
1180&sdhci_3 {
1181	#address-cells = <1>;
1182	#size-cells = <0>;
1183	non-removable;
1184	bus-width = <4>;
1185	mmc-pwrseq = <&wlan_pwrseq>;
1186
1187	pinctrl-names = "default";
1188	pinctrl-0 = <&sd3_clk &sd3_cmd &sd3_wifi>;
1189	status = "okay";
1190
1191	wifi@1 {
1192		compatible = "brcm,bcm4329-fmac";
1193		reg = <0x1>;
1194		pinctrl-names = "default";
1195		pinctrl-0 = <&wifi_host_wake>;
1196		interrupt-parent = <&gpx2>;
1197		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
1198		interrupt-names = "host-wake";
1199	};
1200};
1201
1202&serial_0 {
1203	pinctrl-0 = <&uart0_data &uart0_fctl>;
1204	pinctrl-names = "default";
1205	status = "okay";
1206
1207	bluetooth {
1208		compatible = "brcm,bcm4330-bt";
1209		pinctrl-0 = <&bt_shutdown &bt_device_wakeup &bt_host_wakeup>;
1210		pinctrl-names = "default";
1211
1212		max-speed = <2000000>;
1213		shutdown-gpios = <&gpl0 6 GPIO_ACTIVE_HIGH>;
1214		device-wakeup-gpios = <&gpx3 1 GPIO_ACTIVE_HIGH>;
1215		host-wakeup-gpios = <&gpx2 6 GPIO_ACTIVE_HIGH>;
1216		clocks = <&max77686 MAX77686_CLK_PMIC>;
1217		clock-names = "lpo";
1218	};
1219};
1220
1221&serial_2 {
1222	pinctrl-0 = <&uart_sel>;
1223	pinctrl-names = "default";
1224	status = "okay";
1225};
1226
1227&tmu {
1228	status = "okay";
1229};
1230