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