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