1// SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2#include <dt-bindings/input/input.h>
3#include <dt-bindings/gpio/gpio.h>
4#include <dt-bindings/leds/common.h>
5#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
6#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
7#include "qcom-msm8660.dtsi"
8
9/ {
10	model = "Qualcomm APQ8060 Dragonboard";
11	compatible = "qcom,apq8060-dragonboard", "qcom,msm8660";
12
13	aliases {
14		serial0 = &gsbi12_serial;
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	/* Main power of the board: 3.7V */
22	vph: regulator-fixed {
23		compatible = "regulator-fixed";
24		regulator-min-microvolt = <3700000>;
25		regulator-max-microvolt = <3700000>;
26		regulator-name = "VPH";
27		regulator-type = "voltage";
28		regulator-always-on;
29		regulator-boot-on;
30	};
31
32	/* GPIO controlled ethernet power regulator */
33	dragon_veth: xc622a331mrg {
34		compatible = "regulator-fixed";
35		regulator-name = "XC6222A331MR-G";
36		regulator-min-microvolt = <3300000>;
37		regulator-max-microvolt = <3300000>;
38		vin-supply = <&vph>;
39		gpio = <&pm8058_gpio 40 GPIO_ACTIVE_HIGH>;
40		enable-active-high;
41		pinctrl-names = "default";
42		pinctrl-0 = <&dragon_veth_gpios>;
43		regulator-always-on;
44	};
45
46	/* VDDvario fixed regulator */
47	dragon_vario: nds332p {
48		compatible = "regulator-fixed";
49		regulator-name = "NDS332P";
50		regulator-min-microvolt = <1800000>;
51		regulator-max-microvolt = <1800000>;
52		vin-supply = <&pm8058_s3>;
53	};
54
55	/* This is a levelshifter for SDCC5 */
56	dragon_vio_txb: txb0104rgyr {
57		compatible = "regulator-fixed";
58		regulator-name = "Dragon SDCC levelshifter";
59		vin-supply = <&pm8058_l14>;
60		regulator-always-on;
61	};
62
63	/*
64	 * Capella CM3605 light and proximity sensor mounted directly
65	 * on the sensor board.
66	 */
67	cm3605 {
68		compatible = "capella,cm3605";
69		vdd-supply = <&pm8058_l14>; // 2.85V
70		aset-gpios = <&pm8058_gpio 35 GPIO_ACTIVE_LOW>;
71		capella,aset-resistance-ohms = <100000>;
72		/* Trig on both edges - getting close or far away */
73		interrupts-extended = <&pm8058_gpio 34 IRQ_TYPE_EDGE_BOTH>;
74		/* MPP05 analog input to the XOADC */
75		io-channels = <&xoadc 0x00 0x05>;
76		io-channel-names = "aout";
77		pinctrl-names = "default";
78		pinctrl-0 = <&dragon_cm3605_gpios>, <&dragon_cm3605_mpps>;
79	};
80};
81
82&ebi2 {
83	/* The EBI2 will instantiate first, then populate its children */
84	pinctrl-names = "default";
85	pinctrl-0 = <&dragon_ebi2_pins>;
86	status = "okay";
87
88	/*
89	 * An on-board SMSC LAN9221 chip for "debug ethernet",
90	 * which is actually just an ordinary ethernet on the
91	 * EBI2. This has a 25MHz chrystal next to it, so no
92	 * clocking is needed.
93	 */
94	ethernet@2,0 {
95		compatible = "smsc,lan9221", "smsc,lan9115";
96		reg = <2 0x0 0x100>;
97		/*
98		 * The second interrupt is the PME interrupt
99		 * for network wakeup, connected to the TLMM.
100		 */
101		interrupts-extended = <&pm8058_gpio 7 IRQ_TYPE_EDGE_FALLING>,
102				    <&tlmm 29 IRQ_TYPE_EDGE_RISING>;
103		reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
104		vdd33a-supply = <&dragon_veth>;
105		vddvario-supply = <&dragon_vario>;
106		pinctrl-names = "default";
107		pinctrl-0 = <&dragon_ethernet_gpios>;
108		phy-mode = "mii";
109		reg-io-width = <2>;
110		smsc,force-external-phy;
111		smsc,irq-push-pull;
112
113		/*
114		 * SLOW chipselect config
115		 * Delay 9 cycles (140ns@64MHz) between SMSC
116		 * LAN9221 Ethernet controller reads and writes
117		 * on CS2.
118		 */
119		qcom,xmem-recovery-cycles = <0>;
120		qcom,xmem-write-hold-cycles = <3>;
121		qcom,xmem-write-delta-cycles = <31>;
122		qcom,xmem-read-delta-cycles = <28>;
123		qcom,xmem-write-wait-cycles = <9>;
124		qcom,xmem-read-wait-cycles = <9>;
125	};
126};
127
128&gsbi3 {
129	qcom,mode = <GSBI_PROT_I2C>;
130	status = "okay";
131};
132
133&gsbi3_i2c {
134	pinctrl-names = "default";
135	pinctrl-0 = <&dragon_gsbi3_i2c_pins>;
136	status = "okay";
137
138	touchscreen@24 {
139		compatible = "cypress,cy8ctma340";
140		reg = <0x24>;
141		/* Certainly we can do at least 400 kHz */
142		clock-frequency = <400000>;
143		/* IRQ on GPIO61 called /CTP_INT */
144		interrupt-parent = <&tlmm>;
145		interrupts = <61 IRQ_TYPE_EDGE_FALLING>;
146		/*
147		 * The I2C bus is using a PCA9306 level translator from L16A
148		 * to L2B so these two voltages are needed and L16A is
149		 * kind of the IO voltage, however L16Aisn't really fed to
150		 * the TMA340, which relies entirely on L2B (PM8901 L2).
151		 */
152		vcpin-supply = <&pm8058_l16>;
153		vdd-supply = <&pm8901_l2>;
154		/* GPIO58, called WAKE_CTP */
155		reset-gpios = <&tlmm 58 GPIO_ACTIVE_LOW>;
156		touchscreen-size-x = <480>;
157		touchscreen-size-y = <800>;
158		active-interval-ms = <0>;
159		touch-timeout-ms = <255>;
160		lowpower-interval-ms = <10>;
161		bootloader-key = /bits/ 8 <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>;
162		pinctrl-names = "default";
163		pinctrl-0 = <&dragon_tma340_gpios>;
164	};
165};
166
167&gsbi8 {
168	qcom,mode = <GSBI_PROT_I2C>;
169	status = "okay";
170};
171
172&gsbi8_i2c {
173	pinctrl-names = "default";
174	pinctrl-0 = <&dragon_gsbi8_i2c_pins>;
175	status = "okay";
176
177	eeprom@52 {
178		/* A 16KiB Platform ID EEPROM on the CPU carrier board */
179		compatible = "atmel,24c128";
180		reg = <0x52>;
181		vcc-supply = <&pm8058_s3>;
182		pagesize = <64>;
183	};
184	wm8903: wm8903@1a {
185		/* This Woolfson Micro device has an unrouted interrupt line */
186		compatible = "wlf,wm8903";
187		reg = <0x1a>;
188
189		AVDD-supply = <&pm8058_l16>;
190		CPVDD-supply = <&pm8058_l16>;
191		DBVDD-supply = <&pm8058_s3>;
192		DCVDD-supply = <&pm8058_l0>;
193
194		gpio-controller;
195		#gpio-cells = <2>;
196
197		micdet-cfg = <0>;
198		micdet-delay = <100>;
199		gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
200	};
201};
202
203&gsbi12 {
204	qcom,mode = <GSBI_PROT_I2C_UART>;
205	status = "okay";
206};
207
208&gsbi12_serial {
209	pinctrl-names = "default";
210	pinctrl-0 = <&dragon_gsbi12_serial_pins>;
211	status = "okay";
212};
213
214&gsbi12_i2c {
215	pinctrl-names = "default";
216	pinctrl-0 = <&dragon_gsbi12_i2c_pins>;
217	status = "okay";
218
219	ak8975@c {
220		compatible = "asahi-kasei,ak8975";
221		reg = <0x0c>;
222		interrupt-parent = <&pm8058_gpio>;
223		interrupts = <33 IRQ_TYPE_EDGE_RISING>;
224		pinctrl-names = "default";
225		pinctrl-0 = <&dragon_ak8975_gpios>;
226		vid-supply = <&pm8058_lvs0>; // 1.8V
227		vdd-supply = <&pm8058_l14>; // 2.85V
228	};
229	bmp085@77 {
230		compatible = "bosch,bmp085";
231		reg = <0x77>;
232		interrupt-parent = <&pm8058_gpio>;
233		interrupts = <16 IRQ_TYPE_EDGE_RISING>;
234		reset-gpios = <&tlmm 86 GPIO_ACTIVE_LOW>;
235		pinctrl-names = "default";
236		pinctrl-0 = <&dragon_bmp085_gpios>;
237		vddd-supply = <&pm8058_lvs0>; // 1.8V
238		vdda-supply = <&pm8058_l14>; // 2.85V
239	};
240	mpu3050@68 {
241		compatible = "invensense,mpu3050";
242		reg = <0x68>;
243		/*
244		 * GPIO17 is pulled high by a 10k
245		 * resistor to VLOGIC so needs to be
246		 * active low/falling edge.
247		 */
248		interrupts-extended = <&pm8058_gpio 17 IRQ_TYPE_EDGE_FALLING>;
249		pinctrl-names = "default";
250		pinctrl-0 = <&dragon_mpu3050_gpios>;
251		vlogic-supply = <&pm8058_lvs0>; // 1.8V
252		vdd-supply = <&pm8058_l14>; // 2.85V
253
254		/*
255		 * The MPU-3050 acts as a hub for the
256		 * accelerometer.
257		 */
258		i2c-gate {
259			#address-cells = <1>;
260			#size-cells = <0>;
261
262			kxsd9@18 {
263				compatible = "kionix,kxsd9";
264				reg = <0x18>;
265				interrupt-parent = <&tlmm>;
266				interrupts = <57 IRQ_TYPE_EDGE_FALLING>;
267				pinctrl-names = "default";
268				pinctrl-0 = <&dragon_kxsd9_gpios>;
269				iovdd-supply = <&pm8058_lvs0>; // 1.8V
270				vdd-supply = <&pm8058_l14>; // 2.85V
271			};
272		};
273	};
274};
275
276&pm8058_gpio {
277	dragon_ethernet_gpios: ethernet-state {
278		pinconf {
279			pins = "gpio7";
280			function = "normal";
281			input-enable;
282			bias-disable;
283			power-source = <PM8058_GPIO_S3>;
284		};
285	};
286	dragon_bmp085_gpios: bmp085-state {
287		pinconf {
288			pins = "gpio16";
289			function = "normal";
290			input-enable;
291			bias-disable;
292			power-source = <PM8058_GPIO_S3>;
293		};
294	};
295	dragon_mpu3050_gpios: mpu3050-state {
296		pinconf {
297			pins = "gpio17";
298			function = "normal";
299			input-enable;
300			bias-disable;
301			power-source = <PM8058_GPIO_S3>;
302		};
303	};
304	dragon_sdcc3_gpios: sdcc3-state {
305		pinconf {
306			pins = "gpio22";
307			function = "normal";
308			input-enable;
309			bias-disable;
310			power-source = <PM8058_GPIO_S3>;
311		};
312	};
313	dragon_sdcc5_gpios: sdcc5-state {
314		pinconf {
315			pins = "gpio26";
316			function = "normal";
317			input-enable;
318			bias-pull-up;
319			qcom,pull-up-strength = <PMIC_GPIO_PULL_UP_30>;
320			power-source = <PM8058_GPIO_S3>;
321		};
322	};
323	dragon_ak8975_gpios: ak8975-state {
324		pinconf {
325			pins = "gpio33";
326			function = "normal";
327			input-enable;
328			bias-disable;
329			power-source = <PM8058_GPIO_S3>;
330		};
331	};
332	dragon_cm3605_gpios: cm3605-state {
333		/* Pin 34 connected to the proxy IRQ */
334		gpio34-pins {
335			pins = "gpio34";
336			function = "normal";
337			input-enable;
338			bias-disable;
339			power-source = <PM8058_GPIO_S3>;
340		};
341		/* Pin 35 connected to ASET */
342		gpio35-pins {
343			pins = "gpio35";
344			function = "normal";
345			output-high;
346			bias-disable;
347			power-source = <PM8058_GPIO_S3>;
348		};
349	};
350	dragon_veth_gpios: veth-state {
351		pinconf {
352			pins = "gpio40";
353			function = "normal";
354			bias-disable;
355			drive-push-pull;
356		};
357	};
358};
359
360&pm8058_keypad {
361	linux,keymap = <
362		MATRIX_KEY(0, 0, KEY_MENU)
363		MATRIX_KEY(0, 2, KEY_1)
364		MATRIX_KEY(0, 3, KEY_4)
365		MATRIX_KEY(0, 4, KEY_7)
366		MATRIX_KEY(1, 0, KEY_UP)
367		MATRIX_KEY(1, 1, KEY_LEFT)
368		MATRIX_KEY(1, 2, KEY_DOWN)
369		MATRIX_KEY(1, 3, KEY_5)
370		MATRIX_KEY(1, 3, KEY_8)
371		MATRIX_KEY(2, 0, KEY_HOME)
372		MATRIX_KEY(2, 1, KEY_REPLY)
373		MATRIX_KEY(2, 2, KEY_2)
374		MATRIX_KEY(2, 3, KEY_6)
375		MATRIX_KEY(3, 0, KEY_VOLUMEUP)
376		MATRIX_KEY(3, 1, KEY_RIGHT)
377		MATRIX_KEY(3, 2, KEY_3)
378		MATRIX_KEY(3, 3, KEY_9)
379		MATRIX_KEY(3, 4, KEY_SWITCHVIDEOMODE)
380		MATRIX_KEY(4, 0, KEY_VOLUMEDOWN)
381		MATRIX_KEY(4, 1, KEY_BACK)
382		MATRIX_KEY(4, 2, KEY_CAMERA)
383		MATRIX_KEY(4, 3, KEY_KBDILLUMTOGGLE)
384	>;
385	keypad,num-rows = <6>;
386	keypad,num-columns = <5>;
387};
388
389&pm8058_led48 {
390	/*
391	 * The keypad LED @0x48 is routed to
392	 * the sensor board where it is
393	 * connected to an infrared LED
394	 * SFH4650 (60mW, @850nm) next to the
395	 * ambient light and proximity sensor
396	 * Capella Microsystems CM3605.
397	 */
398	label = "pm8058:infrared:proximitysensor";
399	default-state = "off";
400	linux,default-trigger = "cm3605";
401	status = "okay";
402};
403
404&pm8058_led131 {
405	label = "pm8058:red";
406	color = <LED_COLOR_ID_RED>;
407	default-state = "off";
408	status = "okay";
409};
410
411&pm8058_led132 {
412	/*
413	 * This is actually green too on my
414	 * board, but documented as yellow.
415	 */
416	label = "pm8058:yellow";
417	color = <LED_COLOR_ID_YELLOW>;
418	default-state = "off";
419	linux,default-trigger = "mmc0";
420	status = "okay";
421};
422
423&pm8058_led133 {
424	label = "pm8058:green";
425	function = LED_FUNCTION_HEARTBEAT;
426	color = <LED_COLOR_ID_GREEN>;
427	default-state = "on";
428	linux,default-trigger = "heartbeat";
429	status = "okay";
430};
431
432&pm8058_mpps {
433	dragon_cm3605_mpps: cm3605-mpps-state {
434		pins = "mpp5";
435		function = "analog";
436		input-enable;
437		bias-high-impedance;
438		/* Let's use channel 5 */
439		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
440		power-source = <PM8058_GPIO_S3>;
441	};
442};
443
444&rpm {
445	/*
446	 * Set up of the PMIC RPM regulators for this board
447	 * PM8901 supplies "preliminary regulators" whatever
448	 * that means
449	 */
450	regulators-0 {
451		vdd_l0-supply = <&pm8901_s4>;
452		vdd_l1-supply = <&vph>;
453		vdd_l2-supply = <&vph>;
454		vdd_l3-supply = <&vph>;
455		vdd_l4-supply = <&vph>;
456		vdd_l5-supply = <&vph>;
457		vdd_l6-supply = <&vph>;
458		/* vdd_s0-supply, vdd_s1-supply: SAW regulators */
459		vdd_s2-supply = <&vph>;
460		vdd_s3-supply = <&vph>;
461		vdd_s4-supply = <&vph>;
462		lvs0_in-supply = <&pm8058_s3>;
463		lvs1_in-supply = <&pm8901_s4>;
464		lvs2_in-supply = <&pm8058_l0>;
465		lvs3_in-supply = <&pm8058_s2>;
466		mvs_in-supply = <&pm8058_s3>;
467
468		l0 {
469			regulator-min-microvolt = <1200000>;
470			regulator-max-microvolt = <1200000>;
471			bias-pull-down;
472		};
473		l1 {
474			regulator-min-microvolt = <3300000>;
475			regulator-max-microvolt = <3300000>;
476			bias-pull-down;
477		};
478		l2 {
479			/* TMA340 requires strictly 3.3V */
480			regulator-min-microvolt = <3300000>;
481			regulator-max-microvolt = <3300000>;
482			bias-pull-down;
483		};
484		l3 {
485			regulator-min-microvolt = <3300000>;
486			regulator-max-microvolt = <3300000>;
487			bias-pull-down;
488		};
489		l4 {
490			regulator-min-microvolt = <2600000>;
491			regulator-max-microvolt = <2600000>;
492			bias-pull-down;
493		};
494		l5 {
495			regulator-min-microvolt = <2850000>;
496			regulator-max-microvolt = <2850000>;
497			bias-pull-down;
498		};
499		l6 {
500			regulator-min-microvolt = <2200000>;
501			regulator-max-microvolt = <2200000>;
502			bias-pull-down;
503		};
504
505		/* s0 and s1 are SAW regulators controlled over SPM */
506		s2 {
507			regulator-min-microvolt = <1300000>;
508			regulator-max-microvolt = <1300000>;
509			qcom,switch-mode-frequency = <1600000>;
510			bias-pull-down;
511		};
512		s3 {
513			regulator-min-microvolt = <1100000>;
514			regulator-max-microvolt = <1100000>;
515			qcom,switch-mode-frequency = <1600000>;
516			bias-pull-down;
517		};
518		s4 {
519			regulator-min-microvolt = <1225000>;
520			regulator-max-microvolt = <1225000>;
521			qcom,switch-mode-frequency = <1600000>;
522			bias-pull-down;
523		};
524
525		/* LVS0 thru 3 and mvs are just switches */
526		lvs0 {
527			regulator-always-on;
528		};
529		lvs1 { };
530		lvs2 { };
531		lvs3 { };
532		mvs { };
533
534	};
535
536	regulators-1 {
537		vdd_l0_l1_lvs-supply = <&pm8058_s3>;
538		vdd_l2_l11_l12-supply = <&vph>;
539		vdd_l3_l4_l5-supply = <&vph>;
540		vdd_l6_l7-supply = <&vph>;
541		vdd_l8-supply = <&vph>;
542		vdd_l9-supply = <&vph>;
543		vdd_l10-supply = <&vph>;
544		vdd_l13_l16-supply = <&pm8058_s4>;
545		vdd_l14_l15-supply = <&vph>;
546		vdd_l17_l18-supply = <&vph>;
547		vdd_l19_l20-supply = <&vph>;
548		vdd_l21-supply = <&pm8058_s3>;
549		vdd_l22-supply = <&pm8058_s3>;
550		vdd_l23_l24_l25-supply = <&pm8058_s3>;
551		vdd_s0-supply = <&vph>;
552		vdd_s1-supply = <&vph>;
553		vdd_s2-supply = <&vph>;
554		vdd_s3-supply = <&vph>;
555		vdd_s4-supply = <&vph>;
556		vdd_ncp-supply = <&vph>;
557
558		l0 {
559			regulator-min-microvolt = <1200000>;
560			regulator-max-microvolt = <1200000>;
561			bias-pull-down;
562		};
563		l1 {
564			regulator-min-microvolt = <1200000>;
565			regulator-max-microvolt = <1200000>;
566			bias-pull-down;
567		};
568		l2 {
569			regulator-min-microvolt = <1800000>;
570			regulator-max-microvolt = <2600000>;
571			bias-pull-down;
572		};
573		l3 {
574			regulator-min-microvolt = <1800000>;
575			regulator-max-microvolt = <1800000>;
576			bias-pull-down;
577		};
578		l4 {
579			regulator-min-microvolt = <2850000>;
580			regulator-max-microvolt = <2850000>;
581			bias-pull-down;
582		};
583		l5 {
584			regulator-min-microvolt = <2850000>;
585			regulator-max-microvolt = <2850000>;
586			bias-pull-down;
587		};
588		l6 {
589			regulator-min-microvolt = <3000000>;
590			regulator-max-microvolt = <3600000>;
591			bias-pull-down;
592		};
593		l7 {
594			regulator-min-microvolt = <1800000>;
595			regulator-max-microvolt = <1800000>;
596			bias-pull-down;
597		};
598		l8 {
599			regulator-min-microvolt = <2900000>;
600			regulator-max-microvolt = <3050000>;
601			bias-pull-down;
602		};
603		l9 {
604			regulator-min-microvolt = <1800000>;
605			regulator-max-microvolt = <1800000>;
606			bias-pull-down;
607		};
608		l10 {
609			regulator-min-microvolt = <2600000>;
610			regulator-max-microvolt = <2600000>;
611			bias-pull-down;
612		};
613		l11 {
614			regulator-min-microvolt = <1500000>;
615			regulator-max-microvolt = <1500000>;
616			bias-pull-down;
617		};
618		l12 {
619			regulator-min-microvolt = <2900000>;
620			regulator-max-microvolt = <2900000>;
621			bias-pull-down;
622		};
623		l13 {
624			regulator-min-microvolt = <2050000>;
625			regulator-max-microvolt = <2050000>;
626			bias-pull-down;
627		};
628		l14 {
629			regulator-min-microvolt = <2850000>;
630			regulator-max-microvolt = <2850000>;
631		};
632		l15 {
633			regulator-min-microvolt = <2850000>;
634			regulator-max-microvolt = <2850000>;
635			bias-pull-down;
636		};
637		l16 {
638			regulator-min-microvolt = <1800000>;
639			regulator-max-microvolt = <1800000>;
640			bias-pull-down;
641			regulator-always-on;
642		};
643		l17 {
644			// 1.5V according to schematic
645			regulator-min-microvolt = <2600000>;
646			regulator-max-microvolt = <2600000>;
647			bias-pull-down;
648		};
649		l18 {
650			regulator-min-microvolt = <2200000>;
651			regulator-max-microvolt = <2200000>;
652			bias-pull-down;
653		};
654		l19 {
655			regulator-min-microvolt = <2500000>;
656			regulator-max-microvolt = <2500000>;
657			bias-pull-down;
658		};
659		l20 {
660			regulator-min-microvolt = <1800000>;
661			regulator-max-microvolt = <1800000>;
662			bias-pull-down;
663		};
664		l21 {
665			// 1.1 V according to schematic
666			regulator-min-microvolt = <1200000>;
667			regulator-max-microvolt = <1200000>;
668			bias-pull-down;
669			regulator-always-on;
670		};
671		l22 {
672			// 1.2 V according to schematic
673			regulator-min-microvolt = <1150000>;
674			regulator-max-microvolt = <1150000>;
675			bias-pull-down;
676		};
677		l23 {
678			// Unused
679			regulator-min-microvolt = <1200000>;
680			regulator-max-microvolt = <1200000>;
681			bias-pull-down;
682		};
683		l24 {
684			// Unused
685			regulator-min-microvolt = <1200000>;
686			regulator-max-microvolt = <1200000>;
687			bias-pull-down;
688		};
689		l25 {
690			regulator-min-microvolt = <1200000>;
691			regulator-max-microvolt = <1200000>;
692			bias-pull-down;
693		};
694
695		s0 {
696			// regulator-min-microvolt = <500000>;
697			// regulator-max-microvolt = <1325000>;
698			regulator-min-microvolt = <1100000>;
699			regulator-max-microvolt = <1100000>;
700			qcom,switch-mode-frequency = <1600000>;
701			bias-pull-down;
702		};
703		s1 {
704			// regulator-min-microvolt = <500000>;
705			// regulator-max-microvolt = <1250000>;
706			regulator-min-microvolt = <1100000>;
707			regulator-max-microvolt = <1100000>;
708			qcom,switch-mode-frequency = <1600000>;
709			bias-pull-down;
710		};
711		s2 {
712			// 1.3 V according to schematic
713			regulator-min-microvolt = <1200000>;
714			regulator-max-microvolt = <1400000>;
715			qcom,switch-mode-frequency = <1600000>;
716			bias-pull-down;
717		};
718		s3 {
719			regulator-min-microvolt = <1800000>;
720			regulator-max-microvolt = <1800000>;
721			qcom,switch-mode-frequency = <1600000>;
722			regulator-always-on;
723			bias-pull-down;
724		};
725		s4 {
726			regulator-min-microvolt = <2200000>;
727			regulator-max-microvolt = <2200000>;
728			qcom,switch-mode-frequency = <1600000>;
729			regulator-always-on;
730			bias-pull-down;
731		};
732
733		/* LVS0 and LVS1 are just switches */
734		lvs0 {
735			bias-pull-down;
736		};
737		lvs1 {
738			bias-pull-down;
739		};
740
741		ncp {
742			regulator-min-microvolt = <1800000>;
743			regulator-max-microvolt = <1800000>;
744			qcom,switch-mode-frequency = <1600000>;
745		};
746	};
747};
748
749/* Internal 3.69 GiB eMMC */
750&sdcc1 {
751	pinctrl-names = "default";
752	pinctrl-0 = <&dragon_sdcc1_pins>;
753	vmmc-supply = <&pm8901_l5>;
754	vqmmc-supply = <&pm8901_lvs0>;
755	status = "okay";
756};
757
758/* External micro SD card, directly connected, pulled up to 2.85 V */
759&sdcc3 {
760	/* Enable SSBI GPIO 22 as input, use for card detect */
761	pinctrl-names = "default";
762	pinctrl-0 = <&dragon_sdcc3_pins>, <&dragon_sdcc3_gpios>;
763	cd-gpios = <&pm8058_gpio 22 GPIO_ACTIVE_LOW>;
764	wp-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
765	vmmc-supply = <&pm8058_l14>;
766	status = "okay";
767};
768
769/*
770 * Second external micro SD card, using two TXB104RGYR levelshifters
771 * to lift from 1.8 V to 2.85 V
772 */
773&sdcc5 {
774	/* Enable SSBI GPIO 26 as input, use for card detect */
775	pinctrl-names = "default";
776	pinctrl-0 = <&dragon_sdcc5_pins>, <&dragon_sdcc5_gpios>;
777	cd-gpios = <&pm8058_gpio 26 GPIO_ACTIVE_LOW>;
778	wp-gpios = <&tlmm 106 GPIO_ACTIVE_HIGH>;
779	vmmc-supply = <&pm8058_l14>;
780	vqmmc-supply = <&dragon_vio_txb>;
781	status = "okay";
782};
783
784&tlmm {
785	/* eMMC pins, all 8 data lines connected */
786	dragon_sdcc1_pins: sdcc1-state {
787		clk-pins {
788			pins = "gpio167"; /* SDC1 CLK */
789			function = "sdc1";
790			drive-strength = <16>;
791			bias-disable;
792		};
793		cmd-pins {
794			pins = "gpio168"; /* SDC1 CMD */
795			function = "sdc1";
796			drive-strength = <10>;
797			bias-pull-up;
798		};
799		data-pins {
800			/* SDC1 D0 to D7 */
801			pins = "gpio159", "gpio160", "gpio161", "gpio162",
802			     "gpio163", "gpio164", "gpio165", "gpio166";
803			function = "sdc1";
804			drive-strength = <10>;
805			bias-pull-up;
806		};
807	};
808
809	/*
810	 * The SDCC3 pins are hardcoded (non-muxable) but need some pin
811	 * configuration.
812	 */
813	dragon_sdcc3_pins: sdcc3-state {
814		clk-pins {
815			pins = "sdc3_clk";
816			drive-strength = <8>;
817			bias-disable;
818		};
819		cmd-pins {
820			pins = "sdc3_cmd";
821			drive-strength = <8>;
822			bias-pull-up;
823		};
824		data-pins {
825			pins = "sdc3_data";
826			drive-strength = <8>;
827			bias-pull-up;
828		};
829	};
830
831	/* Second SD card slot pins */
832	dragon_sdcc5_pins: sdcc5-state {
833		clk-pins {
834			pins = "gpio97"; /* SDC5 CLK */
835			function = "sdc5";
836			drive-strength = <16>;
837			bias-disable;
838		};
839		cmd-pins {
840			pins = "gpio95"; /* SDC5 CMD */
841			function = "sdc5";
842			drive-strength = <10>;
843			bias-pull-up;
844		};
845		data-pins {
846			/* SDC5 D0 to D3 */
847			pins = "gpio96", "gpio98", "gpio99", "gpio100";
848			function = "sdc5";
849			drive-strength = <10>;
850			bias-pull-up;
851		};
852	};
853
854	dragon_gsbi3_i2c_pins: gsbi3-i2c-state {
855		pins = "gpio43", "gpio44";
856		function = "gsbi3";
857		drive-strength = <8>;
858		/* These have external pull-up 2.2kOhm to 1.8V */
859		bias-disable;
860	};
861
862	dragon_gsbi8_i2c_pins: gsbi8-i2c-state {
863		pins = "gpio64", "gpio65";
864		function = "gsbi8";
865		drive-strength = <16>;
866		/* These have external pull-up 2.2kOhm to 1.8V */
867		bias-disable;
868	};
869
870	dragon_gsbi12_i2c_pins: gsbi12-i2c-state {
871		pins = "gpio115", "gpio116";
872		function = "gsbi12";
873		drive-strength = <16>;
874		/* These have external pull-up 4.7kOhm to 1.8V */
875		bias-disable;
876	};
877
878	/* Primary serial port uart 0 pins */
879	dragon_gsbi12_serial_pins: gsbi12-serial-state {
880		tx-pins {
881			pins = "gpio117";
882			function = "gsbi12";
883			drive-strength = <8>;
884			bias-disable;
885		};
886		rx-pins {
887			pins = "gpio118";
888			function = "gsbi12";
889			drive-strength = <2>;
890			bias-pull-up;
891		};
892	};
893
894	dragon_ebi2_pins: ebi2-state {
895		/*
896		 * Pins used by EBI2 on the Dragonboard, actually only
897		 * CS2 is used by a real peripheral. CS0 is just
898		 * routed to a test point.
899		 */
900		mux0-pins {
901			pins =
902			    /* "gpio39", CS1A_N this is not good to mux */
903			    "gpio40", /* CS2A_N */
904			    "gpio134"; /* CS0_N testpoint TP29 */
905			function = "ebi2cs";
906		};
907		mux1-pins {
908			pins =
909			    /* EBI2_ADDR_7 downto EBI2_ADDR_0 address bus */
910			    "gpio123", "gpio124", "gpio125", "gpio126",
911			    "gpio127", "gpio128", "gpio129", "gpio130",
912			    /* EBI2_DATA_15 downto EBI2_DATA_0 data bus */
913			    "gpio135", "gpio136", "gpio137", "gpio138",
914			    "gpio139", "gpio140", "gpio141", "gpio142",
915			    "gpio143", "gpio144", "gpio145", "gpio146",
916			    "gpio147", "gpio148", "gpio149", "gpio150",
917			    "gpio151", /* EBI2_OE_N */
918			    "gpio153", /* EBI2_ADV */
919			    "gpio157"; /* EBI2_WE_N */
920			function = "ebi2";
921		};
922	};
923
924	/* Interrupt line for the KXSD9 accelerometer */
925	dragon_kxsd9_gpios: kxsd9-state {
926		pins = "gpio57"; /* IRQ line */
927		function = "gpio";
928		bias-pull-up;
929	};
930
931	dragon_tma340_gpios: tma340-state {
932		reset-pins {
933			/* RESET line, TS_ATTN, WAKE_CTP */
934			pins = "gpio58";
935			function = "gpio";
936			drive-strength = <6>;
937			bias-disable;
938		};
939		irq-pins {
940			pins = "gpio61"; /* IRQ line */
941			function = "gpio";
942			drive-strength = <2>;
943			bias-pull-up;
944		};
945	};
946};
947
948&xoadc {
949	/* Reference voltage 2.2 V */
950	xoadc-ref-supply = <&pm8058_l18>;
951
952	/* Board-specific channels */
953	mpp5@5 {
954		/* Connected to AOUT of ALS sensor */
955		reg = <0x00 0x05>;
956	};
957	mpp6@6 {
958		/* Connected to test point TP43 */
959		reg = <0x00 0x06>;
960	};
961	mpp7@7 {
962		/* Connected to battery thermistor */
963		reg = <0x00 0x07>;
964	};
965	mpp8@8 {
966		/* Connected to battery ID detector */
967		reg = <0x00 0x08>;
968	};
969	mpp9@9 {
970		/* Connected to XO thermistor */
971		reg = <0x00 0x09>;
972	};
973};
974