Linux Audio

Check our new training course

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