xref: /linux/scripts/dtc/include-prefixes/arm/qcom/qcom-apq8060-dragonboard.dts (revision 41cdee8a33495a4778ee534afb8ecfd524bb9c4f)
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 = <&pm8058_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 {
276	interrupts-extended = <&tlmm 88 IRQ_TYPE_LEVEL_LOW>;
277};
278
279&pm8058_gpio {
280	dragon_ethernet_gpios: ethernet-state {
281		pinconf {
282			pins = "gpio7";
283			function = "normal";
284			input-enable;
285			bias-disable;
286			power-source = <PM8058_GPIO_S3>;
287		};
288	};
289	dragon_bmp085_gpios: bmp085-state {
290		pinconf {
291			pins = "gpio16";
292			function = "normal";
293			input-enable;
294			bias-disable;
295			power-source = <PM8058_GPIO_S3>;
296		};
297	};
298	dragon_mpu3050_gpios: mpu3050-state {
299		pinconf {
300			pins = "gpio17";
301			function = "normal";
302			input-enable;
303			bias-disable;
304			power-source = <PM8058_GPIO_S3>;
305		};
306	};
307	dragon_sdcc3_gpios: sdcc3-state {
308		pinconf {
309			pins = "gpio22";
310			function = "normal";
311			input-enable;
312			bias-disable;
313			power-source = <PM8058_GPIO_S3>;
314		};
315	};
316	dragon_sdcc5_gpios: sdcc5-state {
317		pinconf {
318			pins = "gpio26";
319			function = "normal";
320			input-enable;
321			bias-pull-up;
322			qcom,pull-up-strength = <PMIC_GPIO_PULL_UP_30>;
323			power-source = <PM8058_GPIO_S3>;
324		};
325	};
326	dragon_ak8975_gpios: ak8975-state {
327		pinconf {
328			pins = "gpio33";
329			function = "normal";
330			input-enable;
331			bias-disable;
332			power-source = <PM8058_GPIO_S3>;
333		};
334	};
335	dragon_cm3605_gpios: cm3605-state {
336		/* Pin 34 connected to the proxy IRQ */
337		gpio34-pins {
338			pins = "gpio34";
339			function = "normal";
340			input-enable;
341			bias-disable;
342			power-source = <PM8058_GPIO_S3>;
343		};
344		/* Pin 35 connected to ASET */
345		gpio35-pins {
346			pins = "gpio35";
347			function = "normal";
348			output-high;
349			bias-disable;
350			power-source = <PM8058_GPIO_S3>;
351		};
352	};
353	dragon_veth_gpios: veth-state {
354		pinconf {
355			pins = "gpio40";
356			function = "normal";
357			bias-disable;
358			drive-push-pull;
359		};
360	};
361};
362
363&pm8058_keypad {
364	linux,keymap = <
365		MATRIX_KEY(0, 0, KEY_MENU)
366		MATRIX_KEY(0, 2, KEY_1)
367		MATRIX_KEY(0, 3, KEY_4)
368		MATRIX_KEY(0, 4, KEY_7)
369		MATRIX_KEY(1, 0, KEY_UP)
370		MATRIX_KEY(1, 1, KEY_LEFT)
371		MATRIX_KEY(1, 2, KEY_DOWN)
372		MATRIX_KEY(1, 3, KEY_5)
373		MATRIX_KEY(1, 3, KEY_8)
374		MATRIX_KEY(2, 0, KEY_HOME)
375		MATRIX_KEY(2, 1, KEY_REPLY)
376		MATRIX_KEY(2, 2, KEY_2)
377		MATRIX_KEY(2, 3, KEY_6)
378		MATRIX_KEY(3, 0, KEY_VOLUMEUP)
379		MATRIX_KEY(3, 1, KEY_RIGHT)
380		MATRIX_KEY(3, 2, KEY_3)
381		MATRIX_KEY(3, 3, KEY_9)
382		MATRIX_KEY(3, 4, KEY_SWITCHVIDEOMODE)
383		MATRIX_KEY(4, 0, KEY_VOLUMEDOWN)
384		MATRIX_KEY(4, 1, KEY_BACK)
385		MATRIX_KEY(4, 2, KEY_CAMERA)
386		MATRIX_KEY(4, 3, KEY_KBDILLUMTOGGLE)
387	>;
388	keypad,num-rows = <6>;
389	keypad,num-columns = <5>;
390};
391
392&pm8058_led48 {
393	/*
394	 * The keypad LED @0x48 is routed to
395	 * the sensor board where it is
396	 * connected to an infrared LED
397	 * SFH4650 (60mW, @850nm) next to the
398	 * ambient light and proximity sensor
399	 * Capella Microsystems CM3605.
400	 */
401	label = "pm8058:infrared:proximitysensor";
402	default-state = "off";
403	linux,default-trigger = "cm3605";
404	status = "okay";
405};
406
407&pm8058_led131 {
408	label = "pm8058:red";
409	color = <LED_COLOR_ID_RED>;
410	default-state = "off";
411	status = "okay";
412};
413
414&pm8058_led132 {
415	/*
416	 * This is actually green too on my
417	 * board, but documented as yellow.
418	 */
419	label = "pm8058:yellow";
420	color = <LED_COLOR_ID_YELLOW>;
421	default-state = "off";
422	linux,default-trigger = "mmc0";
423	status = "okay";
424};
425
426&pm8058_led133 {
427	label = "pm8058:green";
428	function = LED_FUNCTION_HEARTBEAT;
429	color = <LED_COLOR_ID_GREEN>;
430	default-state = "on";
431	linux,default-trigger = "heartbeat";
432	status = "okay";
433};
434
435&pm8058_mpps {
436	dragon_cm3605_mpps: cm3605-mpps-state {
437		pins = "mpp5";
438		function = "analog";
439		input-enable;
440		bias-high-impedance;
441		/* Let's use channel 5 */
442		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
443		power-source = <PM8058_GPIO_S3>;
444	};
445};
446
447&rpm {
448	/*
449	 * Set up of the PMIC RPM regulators for this board
450	 * PM8901 supplies "preliminary regulators" whatever
451	 * that means
452	 */
453	regulators-0 {
454		vdd_l0-supply = <&pm8901_s4>;
455		vdd_l1-supply = <&vph>;
456		vdd_l2-supply = <&vph>;
457		vdd_l3-supply = <&vph>;
458		vdd_l4-supply = <&vph>;
459		vdd_l5-supply = <&vph>;
460		vdd_l6-supply = <&vph>;
461		/* vdd_s0-supply, vdd_s1-supply: SAW regulators */
462		vdd_s2-supply = <&vph>;
463		vdd_s3-supply = <&vph>;
464		vdd_s4-supply = <&vph>;
465		lvs0_in-supply = <&pm8058_s3>;
466		lvs1_in-supply = <&pm8901_s4>;
467		lvs2_in-supply = <&pm8058_l0>;
468		lvs3_in-supply = <&pm8058_s2>;
469		mvs_in-supply = <&pm8058_s3>;
470
471		l0 {
472			regulator-min-microvolt = <1200000>;
473			regulator-max-microvolt = <1200000>;
474			bias-pull-down;
475		};
476		l1 {
477			regulator-min-microvolt = <3300000>;
478			regulator-max-microvolt = <3300000>;
479			bias-pull-down;
480		};
481		l2 {
482			/* TMA340 requires strictly 3.3V */
483			regulator-min-microvolt = <3300000>;
484			regulator-max-microvolt = <3300000>;
485			bias-pull-down;
486		};
487		l3 {
488			regulator-min-microvolt = <3300000>;
489			regulator-max-microvolt = <3300000>;
490			bias-pull-down;
491		};
492		l4 {
493			regulator-min-microvolt = <2600000>;
494			regulator-max-microvolt = <2600000>;
495			bias-pull-down;
496		};
497		l5 {
498			regulator-min-microvolt = <2850000>;
499			regulator-max-microvolt = <2850000>;
500			bias-pull-down;
501		};
502		l6 {
503			regulator-min-microvolt = <2200000>;
504			regulator-max-microvolt = <2200000>;
505			bias-pull-down;
506		};
507
508		/* s0 and s1 are SAW regulators controlled over SPM */
509		s2 {
510			regulator-min-microvolt = <1300000>;
511			regulator-max-microvolt = <1300000>;
512			qcom,switch-mode-frequency = <1600000>;
513			bias-pull-down;
514		};
515		s3 {
516			regulator-min-microvolt = <1100000>;
517			regulator-max-microvolt = <1100000>;
518			qcom,switch-mode-frequency = <1600000>;
519			bias-pull-down;
520		};
521		s4 {
522			regulator-min-microvolt = <1225000>;
523			regulator-max-microvolt = <1225000>;
524			qcom,switch-mode-frequency = <1600000>;
525			bias-pull-down;
526		};
527
528		/* LVS0 thru 3 and mvs are just switches */
529		lvs0 {
530			regulator-always-on;
531		};
532		lvs1 { };
533		lvs2 { };
534		lvs3 { };
535		mvs { };
536
537	};
538
539	regulators-1 {
540		vdd_l0_l1_lvs-supply = <&pm8058_s3>;
541		vdd_l2_l11_l12-supply = <&vph>;
542		vdd_l3_l4_l5-supply = <&vph>;
543		vdd_l6_l7-supply = <&vph>;
544		vdd_l8-supply = <&vph>;
545		vdd_l9-supply = <&vph>;
546		vdd_l10-supply = <&vph>;
547		vdd_l13_l16-supply = <&pm8058_s4>;
548		vdd_l14_l15-supply = <&vph>;
549		vdd_l17_l18-supply = <&vph>;
550		vdd_l19_l20-supply = <&vph>;
551		vdd_l21-supply = <&pm8058_s3>;
552		vdd_l22-supply = <&pm8058_s3>;
553		vdd_l23_l24_l25-supply = <&pm8058_s3>;
554		vdd_s0-supply = <&vph>;
555		vdd_s1-supply = <&vph>;
556		vdd_s2-supply = <&vph>;
557		vdd_s3-supply = <&vph>;
558		vdd_s4-supply = <&vph>;
559		vdd_ncp-supply = <&vph>;
560
561		l0 {
562			regulator-min-microvolt = <1200000>;
563			regulator-max-microvolt = <1200000>;
564			bias-pull-down;
565		};
566		l1 {
567			regulator-min-microvolt = <1200000>;
568			regulator-max-microvolt = <1200000>;
569			bias-pull-down;
570		};
571		l2 {
572			regulator-min-microvolt = <1800000>;
573			regulator-max-microvolt = <2600000>;
574			bias-pull-down;
575		};
576		l3 {
577			regulator-min-microvolt = <1800000>;
578			regulator-max-microvolt = <1800000>;
579			bias-pull-down;
580		};
581		l4 {
582			regulator-min-microvolt = <2850000>;
583			regulator-max-microvolt = <2850000>;
584			bias-pull-down;
585		};
586		l5 {
587			regulator-min-microvolt = <2850000>;
588			regulator-max-microvolt = <2850000>;
589			bias-pull-down;
590		};
591		l6 {
592			regulator-min-microvolt = <3000000>;
593			regulator-max-microvolt = <3600000>;
594			bias-pull-down;
595		};
596		l7 {
597			regulator-min-microvolt = <1800000>;
598			regulator-max-microvolt = <1800000>;
599			bias-pull-down;
600		};
601		l8 {
602			regulator-min-microvolt = <2900000>;
603			regulator-max-microvolt = <3050000>;
604			bias-pull-down;
605		};
606		l9 {
607			regulator-min-microvolt = <1800000>;
608			regulator-max-microvolt = <1800000>;
609			bias-pull-down;
610		};
611		l10 {
612			regulator-min-microvolt = <2600000>;
613			regulator-max-microvolt = <2600000>;
614			bias-pull-down;
615		};
616		l11 {
617			regulator-min-microvolt = <1500000>;
618			regulator-max-microvolt = <1500000>;
619			bias-pull-down;
620		};
621		l12 {
622			regulator-min-microvolt = <2900000>;
623			regulator-max-microvolt = <2900000>;
624			bias-pull-down;
625		};
626		l13 {
627			regulator-min-microvolt = <2050000>;
628			regulator-max-microvolt = <2050000>;
629			bias-pull-down;
630		};
631		l14 {
632			regulator-min-microvolt = <2850000>;
633			regulator-max-microvolt = <2850000>;
634		};
635		l15 {
636			regulator-min-microvolt = <2850000>;
637			regulator-max-microvolt = <2850000>;
638			bias-pull-down;
639		};
640		l16 {
641			regulator-min-microvolt = <1800000>;
642			regulator-max-microvolt = <1800000>;
643			bias-pull-down;
644			regulator-always-on;
645		};
646		l17 {
647			// 1.5V according to schematic
648			regulator-min-microvolt = <2600000>;
649			regulator-max-microvolt = <2600000>;
650			bias-pull-down;
651		};
652		l18 {
653			regulator-min-microvolt = <2200000>;
654			regulator-max-microvolt = <2200000>;
655			bias-pull-down;
656		};
657		l19 {
658			regulator-min-microvolt = <2500000>;
659			regulator-max-microvolt = <2500000>;
660			bias-pull-down;
661		};
662		l20 {
663			regulator-min-microvolt = <1800000>;
664			regulator-max-microvolt = <1800000>;
665			bias-pull-down;
666		};
667		l21 {
668			// 1.1 V according to schematic
669			regulator-min-microvolt = <1200000>;
670			regulator-max-microvolt = <1200000>;
671			bias-pull-down;
672			regulator-always-on;
673		};
674		l22 {
675			// 1.2 V according to schematic
676			regulator-min-microvolt = <1150000>;
677			regulator-max-microvolt = <1150000>;
678			bias-pull-down;
679		};
680		l23 {
681			// Unused
682			regulator-min-microvolt = <1200000>;
683			regulator-max-microvolt = <1200000>;
684			bias-pull-down;
685		};
686		l24 {
687			// Unused
688			regulator-min-microvolt = <1200000>;
689			regulator-max-microvolt = <1200000>;
690			bias-pull-down;
691		};
692		l25 {
693			regulator-min-microvolt = <1200000>;
694			regulator-max-microvolt = <1200000>;
695			bias-pull-down;
696		};
697
698		s0 {
699			// regulator-min-microvolt = <500000>;
700			// regulator-max-microvolt = <1325000>;
701			regulator-min-microvolt = <1100000>;
702			regulator-max-microvolt = <1100000>;
703			qcom,switch-mode-frequency = <1600000>;
704			bias-pull-down;
705		};
706		s1 {
707			// regulator-min-microvolt = <500000>;
708			// regulator-max-microvolt = <1250000>;
709			regulator-min-microvolt = <1100000>;
710			regulator-max-microvolt = <1100000>;
711			qcom,switch-mode-frequency = <1600000>;
712			bias-pull-down;
713		};
714		s2 {
715			// 1.3 V according to schematic
716			regulator-min-microvolt = <1200000>;
717			regulator-max-microvolt = <1400000>;
718			qcom,switch-mode-frequency = <1600000>;
719			bias-pull-down;
720		};
721		s3 {
722			regulator-min-microvolt = <1800000>;
723			regulator-max-microvolt = <1800000>;
724			qcom,switch-mode-frequency = <1600000>;
725			regulator-always-on;
726			bias-pull-down;
727		};
728		s4 {
729			regulator-min-microvolt = <2200000>;
730			regulator-max-microvolt = <2200000>;
731			qcom,switch-mode-frequency = <1600000>;
732			regulator-always-on;
733			bias-pull-down;
734		};
735
736		/* LVS0 and LVS1 are just switches */
737		lvs0 {
738			bias-pull-down;
739		};
740		lvs1 {
741			bias-pull-down;
742		};
743
744		ncp {
745			regulator-min-microvolt = <1800000>;
746			regulator-max-microvolt = <1800000>;
747			qcom,switch-mode-frequency = <1600000>;
748		};
749	};
750};
751
752/* Internal 3.69 GiB eMMC */
753&sdcc1 {
754	pinctrl-names = "default";
755	pinctrl-0 = <&dragon_sdcc1_pins>;
756	vmmc-supply = <&pm8901_l5>;
757	vqmmc-supply = <&pm8901_lvs0>;
758	status = "okay";
759};
760
761/* External micro SD card, directly connected, pulled up to 2.85 V */
762&sdcc3 {
763	/* Enable SSBI GPIO 22 as input, use for card detect */
764	pinctrl-names = "default";
765	pinctrl-0 = <&dragon_sdcc3_pins>, <&dragon_sdcc3_gpios>;
766	cd-gpios = <&pm8058_gpio 22 GPIO_ACTIVE_LOW>;
767	wp-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
768	vmmc-supply = <&pm8058_l14>;
769	status = "okay";
770};
771
772/*
773 * Second external micro SD card, using two TXB104RGYR levelshifters
774 * to lift from 1.8 V to 2.85 V
775 */
776&sdcc5 {
777	/* Enable SSBI GPIO 26 as input, use for card detect */
778	pinctrl-names = "default";
779	pinctrl-0 = <&dragon_sdcc5_pins>, <&dragon_sdcc5_gpios>;
780	cd-gpios = <&pm8058_gpio 26 GPIO_ACTIVE_LOW>;
781	wp-gpios = <&tlmm 106 GPIO_ACTIVE_HIGH>;
782	vmmc-supply = <&pm8058_l14>;
783	vqmmc-supply = <&dragon_vio_txb>;
784	status = "okay";
785};
786
787&tlmm {
788	/* eMMC pins, all 8 data lines connected */
789	dragon_sdcc1_pins: sdcc1-state {
790		clk-pins {
791			pins = "gpio167"; /* SDC1 CLK */
792			function = "sdc1";
793			drive-strength = <16>;
794			bias-disable;
795		};
796		cmd-pins {
797			pins = "gpio168"; /* SDC1 CMD */
798			function = "sdc1";
799			drive-strength = <10>;
800			bias-pull-up;
801		};
802		data-pins {
803			/* SDC1 D0 to D7 */
804			pins = "gpio159", "gpio160", "gpio161", "gpio162",
805			     "gpio163", "gpio164", "gpio165", "gpio166";
806			function = "sdc1";
807			drive-strength = <10>;
808			bias-pull-up;
809		};
810	};
811
812	/*
813	 * The SDCC3 pins are hardcoded (non-muxable) but need some pin
814	 * configuration.
815	 */
816	dragon_sdcc3_pins: sdcc3-state {
817		clk-pins {
818			pins = "sdc3_clk";
819			drive-strength = <8>;
820			bias-disable;
821		};
822		cmd-pins {
823			pins = "sdc3_cmd";
824			drive-strength = <8>;
825			bias-pull-up;
826		};
827		data-pins {
828			pins = "sdc3_data";
829			drive-strength = <8>;
830			bias-pull-up;
831		};
832	};
833
834	/* Second SD card slot pins */
835	dragon_sdcc5_pins: sdcc5-state {
836		clk-pins {
837			pins = "gpio97"; /* SDC5 CLK */
838			function = "sdc5";
839			drive-strength = <16>;
840			bias-disable;
841		};
842		cmd-pins {
843			pins = "gpio95"; /* SDC5 CMD */
844			function = "sdc5";
845			drive-strength = <10>;
846			bias-pull-up;
847		};
848		data-pins {
849			/* SDC5 D0 to D3 */
850			pins = "gpio96", "gpio98", "gpio99", "gpio100";
851			function = "sdc5";
852			drive-strength = <10>;
853			bias-pull-up;
854		};
855	};
856
857	dragon_gsbi3_i2c_pins: gsbi3-i2c-state {
858		pins = "gpio43", "gpio44";
859		function = "gsbi3";
860		drive-strength = <8>;
861		/* These have external pull-up 2.2kOhm to 1.8V */
862		bias-disable;
863	};
864
865	dragon_gsbi8_i2c_pins: gsbi8-i2c-state {
866		pins = "gpio64", "gpio65";
867		function = "gsbi8";
868		drive-strength = <16>;
869		/* These have external pull-up 2.2kOhm to 1.8V */
870		bias-disable;
871	};
872
873	dragon_gsbi12_i2c_pins: gsbi12-i2c-state {
874		pins = "gpio115", "gpio116";
875		function = "gsbi12";
876		drive-strength = <16>;
877		/* These have external pull-up 4.7kOhm to 1.8V */
878		bias-disable;
879	};
880
881	/* Primary serial port uart 0 pins */
882	dragon_gsbi12_serial_pins: gsbi12-serial-state {
883		tx-pins {
884			pins = "gpio117";
885			function = "gsbi12";
886			drive-strength = <8>;
887			bias-disable;
888		};
889		rx-pins {
890			pins = "gpio118";
891			function = "gsbi12";
892			drive-strength = <2>;
893			bias-pull-up;
894		};
895	};
896
897	dragon_ebi2_pins: ebi2-state {
898		/*
899		 * Pins used by EBI2 on the Dragonboard, actually only
900		 * CS2 is used by a real peripheral. CS0 is just
901		 * routed to a test point.
902		 */
903		mux0-pins {
904			pins =
905			    /* "gpio39", CS1A_N this is not good to mux */
906			    "gpio40", /* CS2A_N */
907			    "gpio134"; /* CS0_N testpoint TP29 */
908			function = "ebi2cs";
909		};
910		mux1-pins {
911			pins =
912			    /* EBI2_ADDR_7 downto EBI2_ADDR_0 address bus */
913			    "gpio123", "gpio124", "gpio125", "gpio126",
914			    "gpio127", "gpio128", "gpio129", "gpio130",
915			    /* EBI2_DATA_15 downto EBI2_DATA_0 data bus */
916			    "gpio135", "gpio136", "gpio137", "gpio138",
917			    "gpio139", "gpio140", "gpio141", "gpio142",
918			    "gpio143", "gpio144", "gpio145", "gpio146",
919			    "gpio147", "gpio148", "gpio149", "gpio150",
920			    "gpio151", /* EBI2_OE_N */
921			    "gpio153", /* EBI2_ADV */
922			    "gpio157"; /* EBI2_WE_N */
923			function = "ebi2";
924		};
925	};
926
927	/* Interrupt line for the KXSD9 accelerometer */
928	dragon_kxsd9_gpios: kxsd9-state {
929		pins = "gpio57"; /* IRQ line */
930		function = "gpio";
931		bias-pull-up;
932	};
933
934	dragon_tma340_gpios: tma340-state {
935		reset-pins {
936			/* RESET line, TS_ATTN, WAKE_CTP */
937			pins = "gpio58";
938			function = "gpio";
939			drive-strength = <6>;
940			bias-disable;
941		};
942		irq-pins {
943			pins = "gpio61"; /* IRQ line */
944			function = "gpio";
945			drive-strength = <2>;
946			bias-pull-up;
947		};
948	};
949};
950
951&pm8058_xoadc {
952	/* Reference voltage 2.2 V */
953	xoadc-ref-supply = <&pm8058_l18>;
954
955	/* Board-specific channels */
956	mpp5@5 {
957		/* Connected to AOUT of ALS sensor */
958		reg = <0x00 0x05>;
959	};
960	mpp6@6 {
961		/* Connected to test point TP43 */
962		reg = <0x00 0x06>;
963	};
964	mpp7@7 {
965		/* Connected to battery thermistor */
966		reg = <0x00 0x07>;
967	};
968	mpp8@8 {
969		/* Connected to battery ID detector */
970		reg = <0x00 0x08>;
971	};
972	mpp9@9 {
973		/* Connected to XO thermistor */
974		reg = <0x00 0x09>;
975	};
976};
977