xref: /freebsd/sys/contrib/device-tree/src/arm/qcom/qcom-apq8060-dragonboard.dts (revision 6549718b70f0e660a15685369afb4f9caf2215ce)
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#include "pm8058.dtsi"
9
10/ {
11	model = "Qualcomm APQ8060 Dragonboard";
12	compatible = "qcom,apq8060-dragonboard", "qcom,msm8660";
13
14	aliases {
15		serial0 = &gsbi12_serial;
16	};
17
18	chosen {
19		stdout-path = "serial0:115200n8";
20	};
21
22	/* Main power of the board: 3.7V */
23	vph: regulator-fixed {
24		compatible = "regulator-fixed";
25		regulator-min-microvolt = <3700000>;
26		regulator-max-microvolt = <3700000>;
27		regulator-name = "VPH";
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 = <&pm8058_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 {
277	interrupts-extended = <&tlmm 88 IRQ_TYPE_LEVEL_LOW>;
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	regulators-0 {
455		compatible = "qcom,rpm-pm8901-regulators";
456
457		vdd_l0-supply = <&pm8901_s4>;
458		vdd_l1-supply = <&vph>;
459		vdd_l2-supply = <&vph>;
460		vdd_l3-supply = <&vph>;
461		vdd_l4-supply = <&vph>;
462		vdd_l5-supply = <&vph>;
463		vdd_l6-supply = <&vph>;
464		/* vdd_s0-supply, vdd_s1-supply: SAW regulators */
465		vdd_s2-supply = <&vph>;
466		vdd_s3-supply = <&vph>;
467		vdd_s4-supply = <&vph>;
468		lvs0_in-supply = <&pm8058_s3>;
469		lvs1_in-supply = <&pm8901_s4>;
470		lvs2_in-supply = <&pm8058_l0>;
471		lvs3_in-supply = <&pm8058_s2>;
472		mvs_in-supply = <&pm8058_s3>;
473
474		pm8901_l0: l0 {
475			regulator-min-microvolt = <1200000>;
476			regulator-max-microvolt = <1200000>;
477			bias-pull-down;
478		};
479
480		pm8901_l1: l1 {
481			regulator-min-microvolt = <3300000>;
482			regulator-max-microvolt = <3300000>;
483			bias-pull-down;
484		};
485
486		pm8901_l2: l2 {
487			/* TMA340 requires strictly 3.3V */
488			regulator-min-microvolt = <3300000>;
489			regulator-max-microvolt = <3300000>;
490			bias-pull-down;
491		};
492
493		pm8901_l3: l3 {
494			regulator-min-microvolt = <3300000>;
495			regulator-max-microvolt = <3300000>;
496			bias-pull-down;
497		};
498
499		pm8901_l4: l4 {
500			regulator-min-microvolt = <2600000>;
501			regulator-max-microvolt = <2600000>;
502			bias-pull-down;
503		};
504
505		pm8901_l5: l5 {
506			regulator-min-microvolt = <2850000>;
507			regulator-max-microvolt = <2850000>;
508			bias-pull-down;
509		};
510
511		pm8901_l6: l6 {
512			regulator-min-microvolt = <2200000>;
513			regulator-max-microvolt = <2200000>;
514			bias-pull-down;
515		};
516
517		/* s0 and s1 are SAW regulators controlled over SPM */
518		pm8901_s2: s2 {
519			regulator-min-microvolt = <1300000>;
520			regulator-max-microvolt = <1300000>;
521			qcom,switch-mode-frequency = <1600000>;
522			bias-pull-down;
523		};
524		pm8901_s3: s3 {
525			regulator-min-microvolt = <1100000>;
526			regulator-max-microvolt = <1100000>;
527			qcom,switch-mode-frequency = <1600000>;
528			bias-pull-down;
529		};
530		pm8901_s4: s4 {
531			regulator-min-microvolt = <1225000>;
532			regulator-max-microvolt = <1225000>;
533			qcom,switch-mode-frequency = <1600000>;
534			bias-pull-down;
535		};
536
537		/* LVS0 thru 3 and mvs are just switches */
538		pm8901_lvs0: lvs0 {
539			regulator-always-on;
540		};
541
542		pm8901_lvs1: lvs1 { };
543
544		pm8901_lvs2: lvs2 { };
545
546		pm8901_lvs3: lvs3 { };
547
548		pm8901_mvs: mvs { };
549	};
550
551	regulators-1 {
552		compatible = "qcom,rpm-pm8058-regulators";
553
554		vdd_l0_l1_lvs-supply = <&pm8058_s3>;
555		vdd_l2_l11_l12-supply = <&vph>;
556		vdd_l3_l4_l5-supply = <&vph>;
557		vdd_l6_l7-supply = <&vph>;
558		vdd_l8-supply = <&vph>;
559		vdd_l9-supply = <&vph>;
560		vdd_l10-supply = <&vph>;
561		vdd_l13_l16-supply = <&pm8058_s4>;
562		vdd_l14_l15-supply = <&vph>;
563		vdd_l17_l18-supply = <&vph>;
564		vdd_l19_l20-supply = <&vph>;
565		vdd_l21-supply = <&pm8058_s3>;
566		vdd_l22-supply = <&pm8058_s3>;
567		vdd_l23_l24_l25-supply = <&pm8058_s3>;
568		vdd_s0-supply = <&vph>;
569		vdd_s1-supply = <&vph>;
570		vdd_s2-supply = <&vph>;
571		vdd_s3-supply = <&vph>;
572		vdd_s4-supply = <&vph>;
573		vdd_ncp-supply = <&vph>;
574
575		pm8058_l0: l0 {
576			regulator-min-microvolt = <1200000>;
577			regulator-max-microvolt = <1200000>;
578			bias-pull-down;
579		};
580
581		pm8058_l1: l1 {
582			regulator-min-microvolt = <1200000>;
583			regulator-max-microvolt = <1200000>;
584			bias-pull-down;
585		};
586
587		pm8058_l2: l2 {
588			regulator-min-microvolt = <1800000>;
589			regulator-max-microvolt = <2600000>;
590			bias-pull-down;
591		};
592
593		pm8058_l3: l3 {
594			regulator-min-microvolt = <1800000>;
595			regulator-max-microvolt = <1800000>;
596			bias-pull-down;
597		};
598
599		pm8058_l4: l4 {
600			regulator-min-microvolt = <2850000>;
601			regulator-max-microvolt = <2850000>;
602			bias-pull-down;
603		};
604
605		pm8058_l5: l5 {
606			regulator-min-microvolt = <2850000>;
607			regulator-max-microvolt = <2850000>;
608			bias-pull-down;
609		};
610
611		pm8058_l6: l6 {
612			regulator-min-microvolt = <3000000>;
613			regulator-max-microvolt = <3600000>;
614			bias-pull-down;
615		};
616
617		pm8058_l7: l7 {
618			regulator-min-microvolt = <1800000>;
619			regulator-max-microvolt = <1800000>;
620			bias-pull-down;
621		};
622
623		pm8058_l8: l8 {
624			regulator-min-microvolt = <2900000>;
625			regulator-max-microvolt = <3050000>;
626			bias-pull-down;
627		};
628
629		pm8058_l9: l9 {
630			regulator-min-microvolt = <1800000>;
631			regulator-max-microvolt = <1800000>;
632			bias-pull-down;
633		};
634
635		pm8058_l10: l10 {
636			regulator-min-microvolt = <2600000>;
637			regulator-max-microvolt = <2600000>;
638			bias-pull-down;
639		};
640
641		pm8058_l11: l11 {
642			regulator-min-microvolt = <1500000>;
643			regulator-max-microvolt = <1500000>;
644			bias-pull-down;
645		};
646
647		pm8058_l12: l12 {
648			regulator-min-microvolt = <2900000>;
649			regulator-max-microvolt = <2900000>;
650			bias-pull-down;
651		};
652
653		pm8058_l13: l13 {
654			regulator-min-microvolt = <2050000>;
655			regulator-max-microvolt = <2050000>;
656			bias-pull-down;
657		};
658
659		pm8058_l14: l14 {
660			regulator-min-microvolt = <2850000>;
661			regulator-max-microvolt = <2850000>;
662		};
663
664		pm8058_l15: l15 {
665			regulator-min-microvolt = <2850000>;
666			regulator-max-microvolt = <2850000>;
667			bias-pull-down;
668		};
669
670		pm8058_l16: l16 {
671			regulator-min-microvolt = <1800000>;
672			regulator-max-microvolt = <1800000>;
673			bias-pull-down;
674			regulator-always-on;
675		};
676
677		pm8058_l17: l17 {
678			// 1.5V according to schematic
679			regulator-min-microvolt = <2600000>;
680			regulator-max-microvolt = <2600000>;
681			bias-pull-down;
682		};
683
684		pm8058_l18: l18 {
685			regulator-min-microvolt = <2200000>;
686			regulator-max-microvolt = <2200000>;
687			bias-pull-down;
688		};
689
690		pm8058_l19: l19 {
691			regulator-min-microvolt = <2500000>;
692			regulator-max-microvolt = <2500000>;
693			bias-pull-down;
694		};
695
696		pm8058_l20: l20 {
697			regulator-min-microvolt = <1800000>;
698			regulator-max-microvolt = <1800000>;
699			bias-pull-down;
700		};
701
702		pm8058_l21: l21 {
703			// 1.1 V according to schematic
704			regulator-min-microvolt = <1200000>;
705			regulator-max-microvolt = <1200000>;
706			bias-pull-down;
707			regulator-always-on;
708		};
709
710		pm8058_l22: l22 {
711			// 1.2 V according to schematic
712			regulator-min-microvolt = <1150000>;
713			regulator-max-microvolt = <1150000>;
714			bias-pull-down;
715		};
716
717		pm8058_l23: l23 {
718			// Unused
719			regulator-min-microvolt = <1200000>;
720			regulator-max-microvolt = <1200000>;
721			bias-pull-down;
722		};
723
724		pm8058_l24: l24 {
725			// Unused
726			regulator-min-microvolt = <1200000>;
727			regulator-max-microvolt = <1200000>;
728			bias-pull-down;
729		};
730
731		pm8058_l25: l25 {
732			regulator-min-microvolt = <1200000>;
733			regulator-max-microvolt = <1200000>;
734			bias-pull-down;
735		};
736
737		pm8058_s0: s0 {
738			// regulator-min-microvolt = <500000>;
739			// regulator-max-microvolt = <1325000>;
740			regulator-min-microvolt = <1100000>;
741			regulator-max-microvolt = <1100000>;
742			qcom,switch-mode-frequency = <1600000>;
743			bias-pull-down;
744		};
745
746		pm8058_s1: s1 {
747			// regulator-min-microvolt = <500000>;
748			// regulator-max-microvolt = <1250000>;
749			regulator-min-microvolt = <1100000>;
750			regulator-max-microvolt = <1100000>;
751			qcom,switch-mode-frequency = <1600000>;
752			bias-pull-down;
753		};
754
755		pm8058_s2: s2 {
756			// 1.3 V according to schematic
757			regulator-min-microvolt = <1200000>;
758			regulator-max-microvolt = <1400000>;
759			qcom,switch-mode-frequency = <1600000>;
760			bias-pull-down;
761		};
762
763		pm8058_s3: s3 {
764			regulator-min-microvolt = <1800000>;
765			regulator-max-microvolt = <1800000>;
766			qcom,switch-mode-frequency = <1600000>;
767			regulator-always-on;
768			bias-pull-down;
769		};
770
771		pm8058_s4: s4 {
772			regulator-min-microvolt = <2200000>;
773			regulator-max-microvolt = <2200000>;
774			qcom,switch-mode-frequency = <1600000>;
775			regulator-always-on;
776			bias-pull-down;
777		};
778
779		/* LVS0 and LVS1 are just switches */
780		pm8058_lvs0: lvs0 {
781			bias-pull-down;
782		};
783
784		pm8058_lvs1: lvs1 {
785			bias-pull-down;
786		};
787
788		pm8058_ncp: ncp {
789			regulator-min-microvolt = <1800000>;
790			regulator-max-microvolt = <1800000>;
791			qcom,switch-mode-frequency = <1600000>;
792		};
793	};
794};
795
796/* Internal 3.69 GiB eMMC */
797&sdcc1 {
798	pinctrl-names = "default";
799	pinctrl-0 = <&dragon_sdcc1_pins>;
800	vmmc-supply = <&pm8901_l5>;
801	vqmmc-supply = <&pm8901_lvs0>;
802	status = "okay";
803};
804
805/* External micro SD card, directly connected, pulled up to 2.85 V */
806&sdcc3 {
807	/* Enable SSBI GPIO 22 as input, use for card detect */
808	pinctrl-names = "default";
809	pinctrl-0 = <&dragon_sdcc3_pins>, <&dragon_sdcc3_gpios>;
810	cd-gpios = <&pm8058_gpio 22 GPIO_ACTIVE_LOW>;
811	wp-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
812	vmmc-supply = <&pm8058_l14>;
813	status = "okay";
814};
815
816/*
817 * Second external micro SD card, using two TXB104RGYR levelshifters
818 * to lift from 1.8 V to 2.85 V
819 */
820&sdcc5 {
821	/* Enable SSBI GPIO 26 as input, use for card detect */
822	pinctrl-names = "default";
823	pinctrl-0 = <&dragon_sdcc5_pins>, <&dragon_sdcc5_gpios>;
824	cd-gpios = <&pm8058_gpio 26 GPIO_ACTIVE_LOW>;
825	wp-gpios = <&tlmm 106 GPIO_ACTIVE_HIGH>;
826	vmmc-supply = <&pm8058_l14>;
827	vqmmc-supply = <&dragon_vio_txb>;
828	status = "okay";
829};
830
831&tlmm {
832	/* eMMC pins, all 8 data lines connected */
833	dragon_sdcc1_pins: sdcc1-state {
834		clk-pins {
835			pins = "gpio167"; /* SDC1 CLK */
836			function = "sdc1";
837			drive-strength = <16>;
838			bias-disable;
839		};
840		cmd-pins {
841			pins = "gpio168"; /* SDC1 CMD */
842			function = "sdc1";
843			drive-strength = <10>;
844			bias-pull-up;
845		};
846		data-pins {
847			/* SDC1 D0 to D7 */
848			pins = "gpio159", "gpio160", "gpio161", "gpio162",
849			     "gpio163", "gpio164", "gpio165", "gpio166";
850			function = "sdc1";
851			drive-strength = <10>;
852			bias-pull-up;
853		};
854	};
855
856	/*
857	 * The SDCC3 pins are hardcoded (non-muxable) but need some pin
858	 * configuration.
859	 */
860	dragon_sdcc3_pins: sdcc3-state {
861		clk-pins {
862			pins = "sdc3_clk";
863			drive-strength = <8>;
864			bias-disable;
865		};
866		cmd-pins {
867			pins = "sdc3_cmd";
868			drive-strength = <8>;
869			bias-pull-up;
870		};
871		data-pins {
872			pins = "sdc3_data";
873			drive-strength = <8>;
874			bias-pull-up;
875		};
876	};
877
878	/* Second SD card slot pins */
879	dragon_sdcc5_pins: sdcc5-state {
880		clk-pins {
881			pins = "gpio97"; /* SDC5 CLK */
882			function = "sdc5";
883			drive-strength = <16>;
884			bias-disable;
885		};
886		cmd-pins {
887			pins = "gpio95"; /* SDC5 CMD */
888			function = "sdc5";
889			drive-strength = <10>;
890			bias-pull-up;
891		};
892		data-pins {
893			/* SDC5 D0 to D3 */
894			pins = "gpio96", "gpio98", "gpio99", "gpio100";
895			function = "sdc5";
896			drive-strength = <10>;
897			bias-pull-up;
898		};
899	};
900
901	dragon_gsbi3_i2c_pins: gsbi3-i2c-state {
902		pins = "gpio43", "gpio44";
903		function = "gsbi3";
904		drive-strength = <8>;
905		/* These have external pull-up 2.2kOhm to 1.8V */
906		bias-disable;
907	};
908
909	dragon_gsbi8_i2c_pins: gsbi8-i2c-state {
910		pins = "gpio64", "gpio65";
911		function = "gsbi8";
912		drive-strength = <16>;
913		/* These have external pull-up 2.2kOhm to 1.8V */
914		bias-disable;
915	};
916
917	dragon_gsbi12_i2c_pins: gsbi12-i2c-state {
918		pins = "gpio115", "gpio116";
919		function = "gsbi12";
920		drive-strength = <16>;
921		/* These have external pull-up 4.7kOhm to 1.8V */
922		bias-disable;
923	};
924
925	/* Primary serial port uart 0 pins */
926	dragon_gsbi12_serial_pins: gsbi12-serial-state {
927		tx-pins {
928			pins = "gpio117";
929			function = "gsbi12";
930			drive-strength = <8>;
931			bias-disable;
932		};
933		rx-pins {
934			pins = "gpio118";
935			function = "gsbi12";
936			drive-strength = <2>;
937			bias-pull-up;
938		};
939	};
940
941	dragon_ebi2_pins: ebi2-state {
942		/*
943		 * Pins used by EBI2 on the Dragonboard, actually only
944		 * CS2 is used by a real peripheral. CS0 is just
945		 * routed to a test point.
946		 */
947		mux0-pins {
948			pins =
949			    /* "gpio39", CS1A_N this is not good to mux */
950			    "gpio40", /* CS2A_N */
951			    "gpio134"; /* CS0_N testpoint TP29 */
952			function = "ebi2cs";
953		};
954		mux1-pins {
955			pins =
956			    /* EBI2_ADDR_7 downto EBI2_ADDR_0 address bus */
957			    "gpio123", "gpio124", "gpio125", "gpio126",
958			    "gpio127", "gpio128", "gpio129", "gpio130",
959			    /* EBI2_DATA_15 downto EBI2_DATA_0 data bus */
960			    "gpio135", "gpio136", "gpio137", "gpio138",
961			    "gpio139", "gpio140", "gpio141", "gpio142",
962			    "gpio143", "gpio144", "gpio145", "gpio146",
963			    "gpio147", "gpio148", "gpio149", "gpio150",
964			    "gpio151", /* EBI2_OE_N */
965			    "gpio153", /* EBI2_ADV */
966			    "gpio157"; /* EBI2_WE_N */
967			function = "ebi2";
968		};
969	};
970
971	/* Interrupt line for the KXSD9 accelerometer */
972	dragon_kxsd9_gpios: kxsd9-state {
973		pins = "gpio57"; /* IRQ line */
974		function = "gpio";
975		bias-pull-up;
976	};
977
978	dragon_tma340_gpios: tma340-state {
979		reset-pins {
980			/* RESET line, TS_ATTN, WAKE_CTP */
981			pins = "gpio58";
982			function = "gpio";
983			drive-strength = <6>;
984			bias-disable;
985		};
986		irq-pins {
987			pins = "gpio61"; /* IRQ line */
988			function = "gpio";
989			drive-strength = <2>;
990			bias-pull-up;
991		};
992	};
993};
994
995&pm8058_xoadc {
996	/* Reference voltage 2.2 V */
997	xoadc-ref-supply = <&pm8058_l18>;
998
999	/* Board-specific channels */
1000	adc-channel@5 {
1001		/* Connected to AOUT of ALS sensor */
1002		reg = <0x00 0x05>;
1003	};
1004
1005	adc-channel@6 {
1006		/* Connected to test point TP43 */
1007		reg = <0x00 0x06>;
1008	};
1009
1010	adc-channel@7 {
1011		/* Connected to battery thermistor */
1012		reg = <0x00 0x07>;
1013	};
1014
1015	adc-channel@8 {
1016		/* Connected to battery ID detector */
1017		reg = <0x00 0x08>;
1018	};
1019
1020	adc-channel@9 {
1021		/* Connected to XO thermistor */
1022		reg = <0x00 0x09>;
1023	};
1024};
1025