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