1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
4 */
5
6#include "msm8996.dtsi"
7#include "pm8994.dtsi"
8#include "pmi8994.dtsi"
9#include <dt-bindings/input/input.h>
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
12#include <dt-bindings/sound/qcom,q6afe.h>
13#include <dt-bindings/sound/qcom,q6asm.h>
14
15/*
16 * GPIO name legend: proper name = the GPIO line is used as GPIO
17 *         NC      = not connected (pin out but not routed from the chip to
18 *                   anything the board)
19 *         "[PER]" = pin is muxed for [peripheral] (not GPIO)
20 *         LSEC    = Low Speed External Connector
21 *         P HSEC  = Primary High Speed External Connector
22 *         S HSEC  = Secondary High Speed External Connector
23 *         J14     = Camera Connector
24 *         TP      = Test Points
25 *
26 * Line names are taken from the schematic "DragonBoard 820c",
27 * drawing no: LM25-P2751-1
28 *
29 * For the lines routed to the external connectors the
30 * lines are named after the 96Boards CE Specification 1.0,
31 * Appendix "Expansion Connector Signal Description".
32 *
33 * When the 96Board naming of a line and the schematic name of
34 * the same line are in conflict, the 96Board specification
35 * takes precedence, which means that the external UART on the
36 * LSEC is named UART0 while the schematic and SoC names this
37 * UART3. This is only for the informational lines i.e. "[FOO]",
38 * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
39 * ones actually used for GPIO.
40 */
41
42/ {
43	aliases {
44		serial0 = &blsp2_uart1;
45		serial1 = &blsp2_uart2;
46		serial2 = &blsp1_uart1;
47		i2c0	= &blsp1_i2c2;
48		i2c1	= &blsp2_i2c1;
49		i2c2	= &blsp2_i2c0;
50		spi0	= &blsp1_spi0;
51		spi1	= &blsp2_spi5;
52	};
53
54	chosen {
55		stdout-path = "serial0:115200n8";
56	};
57
58	clocks {
59		compatible = "simple-bus";
60		divclk4: divclk4 {
61			compatible = "fixed-clock";
62			#clock-cells = <0>;
63			clock-frequency = <32768>;
64			clock-output-names = "divclk4";
65
66			pinctrl-names = "default";
67			pinctrl-0 = <&divclk4_pin_a>;
68		};
69
70		div1_mclk: divclk1 {
71			compatible = "gpio-gate-clock";
72			pinctrl-0 = <&audio_mclk>;
73			pinctrl-names = "default";
74			clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
75			#clock-cells = <0>;
76			enable-gpios = <&pm8994_gpios 15 0>;
77		};
78	};
79
80	gpio_keys {
81		compatible = "gpio-keys";
82		#address-cells = <1>;
83		#size-cells = <0>;
84		autorepeat;
85
86		pinctrl-names = "default";
87		pinctrl-0 = <&volume_up_gpio>;
88
89		button@0 {
90			label = "Volume Up";
91			linux,code = <KEY_VOLUMEUP>;
92			gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
93		};
94	};
95
96	usb2_id: usb2-id {
97		compatible = "linux,extcon-usb-gpio";
98		id-gpio = <&pmi8994_gpios 6 GPIO_ACTIVE_HIGH>;
99		pinctrl-names = "default";
100		pinctrl-0 = <&usb2_vbus_det_gpio>;
101	};
102
103	usb3_id: usb3-id {
104		compatible = "linux,extcon-usb-gpio";
105		id-gpio = <&pm8994_gpios 22 GPIO_ACTIVE_HIGH>;
106		pinctrl-names = "default";
107		pinctrl-0 = <&usb3_vbus_det_gpio>;
108	};
109
110	vph_pwr: vph-pwr-regulator {
111		compatible = "regulator-fixed";
112		regulator-name = "vph_pwr";
113		regulator-always-on;
114		regulator-boot-on;
115
116		regulator-min-microvolt = <3700000>;
117		regulator-max-microvolt = <3700000>;
118	};
119
120	wlan_en: wlan-en-1-8v {
121		pinctrl-names = "default";
122		pinctrl-0 = <&wlan_en_gpios>;
123		compatible = "regulator-fixed";
124		regulator-name = "wlan-en-regulator";
125		regulator-min-microvolt = <1800000>;
126		regulator-max-microvolt = <1800000>;
127
128		gpio = <&pm8994_gpios 8 0>;
129
130		/* WLAN card specific delay */
131		startup-delay-us = <70000>;
132		enable-active-high;
133	};
134};
135
136&blsp1_i2c2 {
137	/* On Low speed expansion */
138	label = "LS-I2C0";
139	status = "okay";
140};
141
142&blsp1_spi0 {
143	/* On Low speed expansion */
144	label = "LS-SPI0";
145	status = "okay";
146};
147
148&blsp1_uart1 {
149	label = "BT-UART";
150	status = "okay";
151	pinctrl-names = "default", "sleep";
152	pinctrl-0 = <&blsp1_uart1_default>;
153	pinctrl-1 = <&blsp1_uart1_sleep>;
154
155	bluetooth {
156		compatible = "qcom,qca6174-bt";
157
158		/* bt_disable_n gpio */
159		enable-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>;
160
161		clocks = <&divclk4>;
162	};
163};
164
165&blsp2_i2c0 {
166	/* On High speed expansion */
167	label = "HS-I2C2";
168	status = "okay";
169};
170
171&blsp2_i2c1 {
172	/* On Low speed expansion */
173	label = "LS-I2C1";
174	status = "okay";
175};
176
177&blsp2_spi5 {
178	/* On High speed expansion */
179	label = "HS-SPI1";
180	status = "okay";
181};
182
183&blsp2_uart1 {
184	label = "LS-UART1";
185	status = "okay";
186	pinctrl-names = "default", "sleep";
187	pinctrl-0 = <&blsp2_uart1_2pins_default>;
188	pinctrl-1 = <&blsp2_uart1_2pins_sleep>;
189};
190
191&blsp2_uart2 {
192	label = "LS-UART0";
193	status = "disabled";
194	pinctrl-names = "default", "sleep";
195	pinctrl-0 = <&blsp2_uart2_4pins_default>;
196	pinctrl-1 = <&blsp2_uart2_4pins_sleep>;
197};
198
199&camss {
200	vdda-supply = <&vreg_l2a_1p25>;
201};
202
203&hdmi {
204	status = "okay";
205
206	pinctrl-names = "default", "sleep";
207	pinctrl-0 = <&hdmi_hpd_active &hdmi_ddc_active>;
208	pinctrl-1 = <&hdmi_hpd_suspend &hdmi_ddc_suspend>;
209
210	core-vdda-supply = <&vreg_l12a_1p8>;
211	core-vcc-supply = <&vreg_s4a_1p8>;
212};
213
214&hdmi_phy {
215	status = "okay";
216
217	vddio-supply = <&vreg_l12a_1p8>;
218	vcca-supply = <&vreg_l28a_0p925>;
219	#phy-cells = <0>;
220};
221
222&hsusb_phy1 {
223	status = "okay";
224
225	vdda-pll-supply = <&vreg_l12a_1p8>;
226	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
227};
228
229&hsusb_phy2 {
230	status = "okay";
231
232	vdda-pll-supply = <&vreg_l12a_1p8>;
233	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
234};
235
236&mdp {
237	status = "okay";
238};
239
240&mdss {
241	status = "okay";
242};
243
244&mmcc {
245	vdd-gfx-supply = <&vdd_gfx>;
246};
247
248&msmgpio {
249	gpio-line-names =
250		"[SPI0_DOUT]", /* GPIO_0, BLSP1_SPI_MOSI, LSEC pin 14 */
251		"[SPI0_DIN]", /* GPIO_1, BLSP1_SPI_MISO, LSEC pin 10 */
252		"[SPI0_CS]", /* GPIO_2, BLSP1_SPI_CS_N, LSEC pin 12 */
253		"[SPI0_SCLK]", /* GPIO_3, BLSP1_SPI_CLK, LSEC pin 8 */
254		"[UART1_TxD]", /* GPIO_4, BLSP8_UART_TX, LSEC pin 11 */
255		"[UART1_RxD]", /* GPIO_5, BLSP8_UART_RX, LSEC pin 13 */
256		"[I2C1_SDA]", /* GPIO_6, BLSP8_I2C_SDA, LSEC pin 21 */
257		"[I2C1_SCL]", /* GPIO_7, BLSP8_I2C_SCL, LSEC pin 19 */
258		"GPIO-H", /* GPIO_8, LCD0_RESET_N, LSEC pin 30 */
259		"TP93", /* GPIO_9 */
260		"GPIO-G", /* GPIO_10, MDP_VSYNC_P, LSEC pin 29 */
261		"[MDP_VSYNC_S]", /* GPIO_11, S HSEC pin 55 */
262		"NC", /* GPIO_12 */
263		"[CSI0_MCLK]", /* GPIO_13, CAM_MCLK0, P HSEC pin 15 */
264		"[CAM_MCLK1]", /* GPIO_14, J14 pin 11 */
265		"[CSI1_MCLK]", /* GPIO_15, CAM_MCLK2, P HSEC pin 17 */
266		"TP99", /* GPIO_16 */
267		"[I2C2_SDA]", /* GPIO_17, CCI_I2C_SDA0, P HSEC pin 34 */
268		"[I2C2_SCL]", /* GPIO_18, CCI_I2C_SCL0, P HSEC pin 32 */
269		"[CCI_I2C_SDA1]", /* GPIO_19, S HSEC pin 38 */
270		"[CCI_I2C_SCL1]", /* GPIO_20, S HSEC pin 36 */
271		"FLASH_STROBE_EN", /* GPIO_21, S HSEC pin 5 */
272		"FLASH_STROBE_TRIG", /* GPIO_22, S HSEC pin 1 */
273		"GPIO-K", /* GPIO_23, CAM2_RST_N, LSEC pin 33 */
274		"GPIO-D", /* GPIO_24, LSEC pin 26 */
275		"GPIO-I", /* GPIO_25, CAM0_RST_N, LSEC pin 31 */
276		"GPIO-J", /* GPIO_26, CAM0_STANDBY_N, LSEC pin 32 */
277		"BLSP6_I2C_SDA", /* GPIO_27 */
278		"BLSP6_I2C_SCL", /* GPIO_28 */
279		"GPIO-B", /* GPIO_29, TS0_RESET_N, LSEC pin 24 */
280		"GPIO30", /* GPIO_30, S HSEC pin 4 */
281		"HDMI_CEC", /* GPIO_31 */
282		"HDMI_DDC_CLOCK", /* GPIO_32 */
283		"HDMI_DDC_DATA", /* GPIO_33 */
284		"HDMI_HOT_PLUG_DETECT", /* GPIO_34 */
285		"PCIE0_RST_N", /* GPIO_35 */
286		"PCIE0_CLKREQ_N", /* GPIO_36 */
287		"PCIE0_WAKE", /* GPIO_37 */
288		"SD_CARD_DET_N", /* GPIO_38 */
289		"TSIF1_SYNC", /* GPIO_39, S HSEC pin 48 */
290		"W_DISABLE_N", /* GPIO_40 */
291		"[BLSP9_UART_TX]", /* GPIO_41 */
292		"[BLSP9_UART_RX]", /* GPIO_42 */
293		"[BLSP2_UART_CTS_N]", /* GPIO_43 */
294		"[BLSP2_UART_RFR_N]", /* GPIO_44 */
295		"[BLSP3_UART_TX]", /* GPIO_45 */
296		"[BLSP3_UART_RX]", /* GPIO_46 */
297		"[I2C0_SDA]", /* GPIO_47, LS_I2C0_SDA, LSEC pin 17 */
298		"[I2C0_SCL]", /* GPIO_48, LS_I2C0_SCL, LSEC pin 15 */
299		"[UART0_TxD]", /* GPIO_49, BLSP9_UART_TX, LSEC pin 5 */
300		"[UART0_RxD]", /* GPIO_50, BLSP9_UART_RX, LSEC pin 7 */
301		"[UART0_CTS]", /* GPIO_51, BLSP9_UART_CTS_N, LSEC pin 3 */
302		"[UART0_RTS]", /* GPIO_52, BLSP9_UART_RFR_N, LSEC pin 9 */
303		"[CODEC_INT1_N]", /* GPIO_53 */
304		"[CODEC_INT2_N]", /* GPIO_54 */
305		"[BLSP7_I2C_SDA]", /* GPIO_55 */
306		"[BLSP7_I2C_SCL]", /* GPIO_56 */
307		"MI2S_MCLK", /* GPIO_57, S HSEC pin 3 */
308		"[PCM_CLK]", /* GPIO_58, QUA_MI2S_SCK, LSEC pin 18 */
309		"[PCM_FS]", /* GPIO_59, QUA_MI2S_WS, LSEC pin 16 */
310		"[PCM_DO]", /* GPIO_60, QUA_MI2S_DATA0, LSEC pin 20 */
311		"[PCM_DI]", /* GPIO_61, QUA_MI2S_DATA1, LSEC pin 22 */
312		"GPIO-E", /* GPIO_62, LSEC pin 27 */
313		"TP87", /* GPIO_63 */
314		"[CODEC_RST_N]", /* GPIO_64 */
315		"[PCM1_CLK]", /* GPIO_65 */
316		"[PCM1_SYNC]", /* GPIO_66 */
317		"[PCM1_DIN]", /* GPIO_67 */
318		"[PCM1_DOUT]", /* GPIO_68 */
319		"AUDIO_REF_CLK", /* GPIO_69 */
320		"SLIMBUS_CLK", /* GPIO_70 */
321		"SLIMBUS_DATA0", /* GPIO_71 */
322		"SLIMBUS_DATA1", /* GPIO_72 */
323		"NC", /* GPIO_73 */
324		"NC", /* GPIO_74 */
325		"NC", /* GPIO_75 */
326		"NC", /* GPIO_76 */
327		"TP94", /* GPIO_77 */
328		"NC", /* GPIO_78 */
329		"TP95", /* GPIO_79 */
330		"GPIO-A", /* GPIO_80, MEMS_RESET_N, LSEC pin 23 */
331		"TP88", /* GPIO_81 */
332		"TP89", /* GPIO_82 */
333		"TP90", /* GPIO_83 */
334		"TP91", /* GPIO_84 */
335		"[SD_DAT0]", /* GPIO_85, BLSP12_SPI_MOSI, P HSEC pin 1 */
336		"[SD_CMD]", /* GPIO_86, BLSP12_SPI_MISO, P HSEC pin 11 */
337		"[SD_DAT3]", /* GPIO_87, BLSP12_SPI_CS_N, P HSEC pin 7 */
338		"[SD_SCLK]", /* GPIO_88, BLSP12_SPI_CLK, P HSEC pin 9 */
339		"TSIF1_CLK", /* GPIO_89, S HSEC pin 42 */
340		"TSIF1_EN", /* GPIO_90, S HSEC pin 46 */
341		"TSIF1_DATA", /* GPIO_91, S HSEC pin 44 */
342		"NC", /* GPIO_92 */
343		"TSIF2_CLK", /* GPIO_93, S HSEC pin 52 */
344		"TSIF2_EN", /* GPIO_94, S HSEC pin 56 */
345		"TSIF2_DATA", /* GPIO_95, S HSEC pin 54 */
346		"TSIF2_SYNC", /* GPIO_96, S HSEC pin 58 */
347		"NC", /* GPIO_97 */
348		"CAM1_STANDBY_N", /* GPIO_98 */
349		"NC", /* GPIO_99 */
350		"NC", /* GPIO_100 */
351		"[LCD1_RESET_N]", /* GPIO_101, S HSEC pin 51 */
352		"BOOT_CONFIG1", /* GPIO_102 */
353		"USB_HUB_RESET", /* GPIO_103 */
354		"CAM1_RST_N", /* GPIO_104 */
355		"NC", /* GPIO_105 */
356		"NC", /* GPIO_106 */
357		"NC", /* GPIO_107 */
358		"NC", /* GPIO_108 */
359		"NC", /* GPIO_109 */
360		"NC", /* GPIO_110 */
361		"NC", /* GPIO_111 */
362		"NC", /* GPIO_112 */
363		"PMI8994_BUA", /* GPIO_113 */
364		"PCIE2_RST_N", /* GPIO_114 */
365		"PCIE2_CLKREQ_N", /* GPIO_115 */
366		"PCIE2_WAKE", /* GPIO_116 */
367		"SSC_IRQ_0", /* GPIO_117 */
368		"SSC_IRQ_1", /* GPIO_118 */
369		"SSC_IRQ_2", /* GPIO_119 */
370		"NC", /* GPIO_120 */
371		"GPIO121", /* GPIO_121, S HSEC pin 2 */
372		"NC", /* GPIO_122 */
373		"SSC_IRQ_6", /* GPIO_123 */
374		"SSC_IRQ_7", /* GPIO_124 */
375		"GPIO-C", /* GPIO_125, TS_INT0, LSEC pin 25 */
376		"BOOT_CONFIG5", /* GPIO_126 */
377		"NC", /* GPIO_127 */
378		"NC", /* GPIO_128 */
379		"BOOT_CONFIG7", /* GPIO_129 */
380		"PCIE1_RST_N", /* GPIO_130 */
381		"PCIE1_CLKREQ_N", /* GPIO_131 */
382		"PCIE1_WAKE", /* GPIO_132 */
383		"GPIO-L", /* GPIO_133, CAM2_STANDBY_N, LSEC pin 34 */
384		"NC", /* GPIO_134 */
385		"NC", /* GPIO_135 */
386		"BOOT_CONFIG8", /* GPIO_136 */
387		"NC", /* GPIO_137 */
388		"NC", /* GPIO_138 */
389		"GPS_SSBI2", /* GPIO_139 */
390		"GPS_SSBI1", /* GPIO_140 */
391		"NC", /* GPIO_141 */
392		"NC", /* GPIO_142 */
393		"NC", /* GPIO_143 */
394		"BOOT_CONFIG6", /* GPIO_144 */
395		"NC", /* GPIO_145 */
396		"NC", /* GPIO_146 */
397		"NC", /* GPIO_147 */
398		"NC", /* GPIO_148 */
399		"NC"; /* GPIO_149 */
400
401	sdc2_cd_on: sdc2_cd_on {
402		mux {
403			pins = "gpio38";
404			function = "gpio";
405		};
406
407		config {
408			pins = "gpio38";
409			bias-pull-up;		/* pull up */
410			drive-strength = <16>;	/* 16 MA */
411		};
412	};
413
414	sdc2_cd_off: sdc2_cd_off {
415		mux {
416			pins = "gpio38";
417			function = "gpio";
418		};
419
420		config {
421			pins = "gpio38";
422			bias-pull-up;		/* pull up */
423			drive-strength = <2>;	/* 2 MA */
424		};
425	};
426
427	blsp1_uart1_default: blsp1_uart1_default {
428		mux {
429			pins = "gpio41", "gpio42", "gpio43", "gpio44";
430			function = "blsp_uart2";
431		};
432
433		config {
434			pins = "gpio41", "gpio42", "gpio43", "gpio44";
435			drive-strength = <16>;
436			bias-disable;
437		};
438	};
439
440	blsp1_uart1_sleep: blsp1_uart1_sleep {
441		mux {
442			pins = "gpio41", "gpio42", "gpio43", "gpio44";
443			function = "gpio";
444		};
445
446		config {
447			pins = "gpio41", "gpio42", "gpio43", "gpio44";
448			drive-strength = <2>;
449			bias-disable;
450		};
451	};
452
453	hdmi_hpd_active: hdmi_hpd_active {
454		mux {
455			pins = "gpio34";
456			function = "hdmi_hot";
457		};
458
459		config {
460			pins = "gpio34";
461			bias-pull-down;
462			drive-strength = <16>;
463		};
464	};
465
466	hdmi_hpd_suspend: hdmi_hpd_suspend {
467		mux {
468			pins = "gpio34";
469			function = "hdmi_hot";
470		};
471
472		config {
473			pins = "gpio34";
474			bias-pull-down;
475			drive-strength = <2>;
476		};
477	};
478
479	hdmi_ddc_active: hdmi_ddc_active {
480		mux {
481			pins = "gpio32", "gpio33";
482			function = "hdmi_ddc";
483		};
484
485		config {
486			pins = "gpio32", "gpio33";
487			drive-strength = <2>;
488			bias-pull-up;
489		};
490	};
491
492	hdmi_ddc_suspend: hdmi_ddc_suspend {
493		mux {
494			pins = "gpio32", "gpio33";
495			function = "hdmi_ddc";
496		};
497
498		config {
499			pins = "gpio32", "gpio33";
500			drive-strength = <2>;
501			bias-pull-down;
502		};
503	};
504};
505
506&pcie0 {
507	status = "okay";
508	perst-gpio = <&msmgpio 35 GPIO_ACTIVE_LOW>;
509	vddpe-3v3-supply = <&wlan_en>;
510	vdda-supply = <&vreg_l28a_0p925>;
511};
512
513&pcie1 {
514	status = "okay";
515	perst-gpio = <&msmgpio 130 GPIO_ACTIVE_LOW>;
516	vdda-supply = <&vreg_l28a_0p925>;
517};
518
519&pcie2 {
520	status = "okay";
521	perst-gpio = <&msmgpio 114 GPIO_ACTIVE_LOW>;
522	vdda-supply = <&vreg_l28a_0p925>;
523};
524
525&pcie_phy {
526	status = "okay";
527
528	vdda-phy-supply = <&vreg_l28a_0p925>;
529	vdda-pll-supply = <&vreg_l12a_1p8>;
530};
531
532&pm8994_gpios {
533	gpio-line-names =
534		"NC",
535		"KEY_VOLP_N",
536		"NC",
537		"BL1_PWM",
538		"GPIO-F", /* BL0_PWM, LSEC pin 28 */
539		"BL1_EN",
540		"NC",
541		"WLAN_EN",
542		"NC",
543		"NC",
544		"NC",
545		"NC",
546		"NC",
547		"NC",
548		"DIVCLK1",
549		"DIVCLK2",
550		"DIVCLK3",
551		"DIVCLK4",
552		"BT_EN",
553		"PMIC_SLB",
554		"PMIC_BUA",
555		"USB_VBUS_DET";
556
557	pinctrl-names = "default";
558	pinctrl-0 = <&ls_exp_gpio_f &bt_en_gpios>;
559
560	ls_exp_gpio_f: pm8994_gpio5 {
561		pinconf {
562			pins = "gpio5";
563			output-low;
564			power-source = <2>; // PM8994_GPIO_S4, 1.8V
565		};
566	};
567
568	bt_en_gpios: bt_en_gpios {
569		pinconf {
570			pins = "gpio19";
571			function = PMIC_GPIO_FUNC_NORMAL;
572			output-low;
573			power-source = <PM8994_GPIO_S4>; // 1.8V
574			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
575			bias-pull-down;
576		};
577	};
578
579	wlan_en_gpios: wlan_en_gpios {
580		pinconf {
581			pins = "gpio8";
582			function = PMIC_GPIO_FUNC_NORMAL;
583			output-low;
584			power-source = <PM8994_GPIO_S4>; // 1.8V
585			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
586			bias-pull-down;
587		};
588	};
589
590	audio_mclk: clk_div1 {
591		pinconf {
592			pins = "gpio15";
593			function = "func1";
594			power-source = <PM8994_GPIO_S4>; // 1.8V
595		};
596	};
597
598	volume_up_gpio: pm8996_gpio2 {
599		pinconf {
600			pins = "gpio2";
601			function = "normal";
602			input-enable;
603			drive-push-pull;
604			bias-pull-up;
605			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
606			power-source = <PM8994_GPIO_S4>; // 1.8V
607		};
608	};
609
610	divclk4_pin_a: divclk4 {
611		pinconf {
612			pins = "gpio18";
613			function = PMIC_GPIO_FUNC_FUNC2;
614
615			bias-disable;
616			power-source = <PM8994_GPIO_S4>;
617		};
618	};
619
620	usb3_vbus_det_gpio: pm8996_gpio22 {
621		pinconf {
622			pins = "gpio22";
623			function = PMIC_GPIO_FUNC_NORMAL;
624			input-enable;
625			bias-pull-down;
626			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
627			power-source = <PM8994_GPIO_S4>; // 1.8V
628		};
629	};
630};
631
632&pm8994_mpps {
633	gpio-line-names =
634		"VDDPX_BIAS",
635		"WIFI_LED",
636		"NC",
637		"BT_LED",
638		"PM_MPP05",
639		"PM_MPP06",
640		"PM_MPP07",
641		"NC";
642};
643
644&pm8994_spmi_regulators {
645	qcom,saw-reg = <&saw3>;
646	s9 {
647		qcom,saw-slave;
648	};
649	s10 {
650		qcom,saw-slave;
651	};
652	s11 {
653		qcom,saw-leader;
654		regulator-always-on;
655		regulator-min-microvolt = <980000>;
656		regulator-max-microvolt = <980000>;
657	};
658};
659
660&pmi8994_gpios {
661	gpio-line-names =
662		"NC",
663		"SPKR_AMP_EN1",
664		"SPKR_AMP_EN2",
665		"TP61",
666		"NC",
667		"USB2_VBUS_DET",
668		"NC",
669		"NC",
670		"NC",
671		"NC";
672
673	usb2_vbus_det_gpio: pmi8996_gpio6 {
674		pinconf {
675			pins = "gpio6";
676			function = PMIC_GPIO_FUNC_NORMAL;
677			input-enable;
678			bias-pull-down;
679			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
680			power-source = <PM8994_GPIO_S4>; // 1.8V
681		};
682	};
683};
684
685&pmi8994_spmi_regulators {
686	vdd_gfx: s2@1700 {
687		reg = <0x1700 0x100>;
688		regulator-name = "VDD_GFX";
689		regulator-min-microvolt = <980000>;
690		regulator-max-microvolt = <980000>;
691	};
692};
693
694&rpm_requests {
695	pm8994-regulators {
696		compatible = "qcom,rpm-pm8994-regulators";
697
698		vdd_s1-supply = <&vph_pwr>;
699		vdd_s2-supply = <&vph_pwr>;
700		vdd_s3-supply = <&vph_pwr>;
701		vdd_s4-supply = <&vph_pwr>;
702		vdd_s5-supply = <&vph_pwr>;
703		vdd_s6-supply = <&vph_pwr>;
704		vdd_s7-supply = <&vph_pwr>;
705		vdd_s8-supply = <&vph_pwr>;
706		vdd_s9-supply = <&vph_pwr>;
707		vdd_s10-supply = <&vph_pwr>;
708		vdd_s11-supply = <&vph_pwr>;
709		vdd_s12-supply = <&vph_pwr>;
710		vdd_l1-supply = <&vreg_s1b_1p025>;
711		vdd_l2_l26_l28-supply = <&vreg_s3a_1p3>;
712		vdd_l3_l11-supply = <&vreg_s3a_1p3>;
713		vdd_l4_l27_l31-supply = <&vreg_s3a_1p3>;
714		vdd_l5_l7-supply = <&vreg_s5a_2p15>;
715		vdd_l6_l12_l32-supply = <&vreg_s5a_2p15>;
716		vdd_l8_l16_l30-supply = <&vph_pwr>;
717		vdd_l9_l10_l18_l22-supply = <&vph_pwr_bbyp>;
718		vdd_l13_l19_l23_l24-supply = <&vph_pwr_bbyp>;
719		vdd_l14_l15-supply = <&vreg_s5a_2p15>;
720		vdd_l17_l29-supply = <&vph_pwr_bbyp>;
721		vdd_l20_l21-supply = <&vph_pwr_bbyp>;
722		vdd_l25-supply = <&vreg_s3a_1p3>;
723		vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
724
725		vreg_s3a_1p3: s3 {
726			regulator-name = "vreg_s3a_1p3";
727			regulator-min-microvolt = <1300000>;
728			regulator-max-microvolt = <1300000>;
729		};
730
731		/**
732		 * 1.8v required on LS expansion
733		 * for mezzanine boards
734		 */
735		vreg_s4a_1p8: s4 {
736			regulator-name = "vreg_s4a_1p8";
737			regulator-min-microvolt = <1800000>;
738			regulator-max-microvolt = <1800000>;
739			regulator-always-on;
740		};
741		vreg_s5a_2p15: s5 {
742			regulator-name = "vreg_s5a_2p15";
743			regulator-min-microvolt = <2150000>;
744			regulator-max-microvolt = <2150000>;
745		};
746		vreg_s7a_1p0: s7 {
747			regulator-name = "vreg_s7a_1p0";
748			regulator-min-microvolt = <800000>;
749			regulator-max-microvolt = <800000>;
750		};
751
752		vreg_l1a_1p0: l1 {
753			regulator-name = "vreg_l1a_1p0";
754			regulator-min-microvolt = <1000000>;
755			regulator-max-microvolt = <1000000>;
756		};
757		vreg_l2a_1p25: l2 {
758			regulator-name = "vreg_l2a_1p25";
759			regulator-min-microvolt = <1250000>;
760			regulator-max-microvolt = <1250000>;
761		};
762		vreg_l3a_0p875: l3 {
763			regulator-name = "vreg_l3a_0p875";
764			regulator-min-microvolt = <850000>;
765			regulator-max-microvolt = <850000>;
766		};
767		vreg_l4a_1p225: l4 {
768			regulator-name = "vreg_l4a_1p225";
769			regulator-min-microvolt = <1225000>;
770			regulator-max-microvolt = <1225000>;
771		};
772		vreg_l6a_1p2: l6 {
773			regulator-name = "vreg_l6a_1p2";
774			regulator-min-microvolt = <1200000>;
775			regulator-max-microvolt = <1200000>;
776		};
777		vreg_l8a_1p8: l8 {
778			regulator-name = "vreg_l8a_1p8";
779			regulator-min-microvolt = <1800000>;
780			regulator-max-microvolt = <1800000>;
781		};
782		vreg_l9a_1p8: l9 {
783			regulator-name = "vreg_l9a_1p8";
784			regulator-min-microvolt = <1800000>;
785			regulator-max-microvolt = <1800000>;
786		};
787		vreg_l10a_1p8: l10 {
788			regulator-name = "vreg_l10a_1p8";
789			regulator-min-microvolt = <1800000>;
790			regulator-max-microvolt = <1800000>;
791		};
792		vreg_l11a_1p15: l11 {
793			regulator-name = "vreg_l11a_1p15";
794			regulator-min-microvolt = <1150000>;
795			regulator-max-microvolt = <1150000>;
796		};
797		vreg_l12a_1p8: l12 {
798			regulator-name = "vreg_l12a_1p8";
799			regulator-min-microvolt = <1800000>;
800			regulator-max-microvolt = <1800000>;
801		};
802		vreg_l13a_2p95: l13 {
803			regulator-name = "vreg_l13a_2p95";
804			regulator-min-microvolt = <1800000>;
805			regulator-max-microvolt = <2950000>;
806		};
807		vreg_l14a_1p8: l14 {
808			regulator-name = "vreg_l14a_1p8";
809			regulator-min-microvolt = <1800000>;
810			regulator-max-microvolt = <1800000>;
811		};
812		vreg_l15a_1p8: l15 {
813			regulator-name = "vreg_l15a_1p8";
814			regulator-min-microvolt = <1800000>;
815			regulator-max-microvolt = <1800000>;
816		};
817		vreg_l16a_2p7: l16 {
818			regulator-name = "vreg_l16a_2p7";
819			regulator-min-microvolt = <2700000>;
820			regulator-max-microvolt = <2700000>;
821		};
822		vreg_l17a_2p8: l17 {
823			regulator-name = "vreg_l17a_2p8";
824			regulator-min-microvolt = <2500000>;
825			regulator-max-microvolt = <2500000>;
826		};
827		vreg_l18a_2p85: l18 {
828			regulator-name = "vreg_l18a_2p85";
829			regulator-min-microvolt = <2700000>;
830			regulator-max-microvolt = <2900000>;
831		};
832		vreg_l19a_2p8: l19 {
833			regulator-name = "vreg_l19a_2p8";
834			regulator-min-microvolt = <3000000>;
835			regulator-max-microvolt = <3000000>;
836		};
837		vreg_l20a_2p95: l20 {
838			regulator-name = "vreg_l20a_2p95";
839			regulator-min-microvolt = <2950000>;
840			regulator-max-microvolt = <2950000>;
841			regulator-allow-set-load;
842		};
843		vreg_l21a_2p95: l21 {
844			regulator-name = "vreg_l21a_2p95";
845			regulator-min-microvolt = <2950000>;
846			regulator-max-microvolt = <2950000>;
847			regulator-allow-set-load;
848			regulator-system-load = <200000>;
849		};
850		vreg_l22a_3p0: l22 {
851			regulator-name = "vreg_l22a_3p0";
852			regulator-min-microvolt = <3300000>;
853			regulator-max-microvolt = <3300000>;
854		};
855		vreg_l23a_2p8: l23 {
856			regulator-name = "vreg_l23a_2p8";
857			regulator-min-microvolt = <2800000>;
858			regulator-max-microvolt = <2800000>;
859		};
860		vreg_l24a_3p075: l24 {
861			regulator-name = "vreg_l24a_3p075";
862			regulator-min-microvolt = <3075000>;
863			regulator-max-microvolt = <3075000>;
864		};
865		vreg_l25a_1p2: l25 {
866			regulator-name = "vreg_l25a_1p2";
867			regulator-min-microvolt = <1200000>;
868			regulator-max-microvolt = <1200000>;
869			regulator-allow-set-load;
870		};
871		vreg_l26a_0p8: l27 {
872			regulator-name = "vreg_l26a_0p8";
873			regulator-min-microvolt = <1000000>;
874			regulator-max-microvolt = <1000000>;
875		};
876		vreg_l28a_0p925: l28 {
877			regulator-name = "vreg_l28a_0p925";
878			regulator-min-microvolt = <925000>;
879			regulator-max-microvolt = <925000>;
880			regulator-allow-set-load;
881		};
882		vreg_l29a_2p8: l29 {
883			regulator-name = "vreg_l29a_2p8";
884			regulator-min-microvolt = <2800000>;
885			regulator-max-microvolt = <2800000>;
886		};
887		vreg_l30a_1p8: l30 {
888			regulator-name = "vreg_l30a_1p8";
889			regulator-min-microvolt = <1800000>;
890			regulator-max-microvolt = <1800000>;
891		};
892		vreg_l32a_1p8: l32 {
893			regulator-name = "vreg_l32a_1p8";
894			regulator-min-microvolt = <1800000>;
895			regulator-max-microvolt = <1800000>;
896		};
897
898		vreg_lvs1a_1p8: lvs1 {
899			regulator-name = "vreg_lvs1a_1p8";
900		};
901
902		vreg_lvs2a_1p8: lvs2 {
903			regulator-name = "vreg_lvs2a_1p8";
904		};
905	};
906
907	pmi8994-regulators {
908		compatible = "qcom,rpm-pmi8994-regulators";
909
910		vdd_s1-supply = <&vph_pwr>;
911		vdd_s2-supply = <&vph_pwr>;
912		vdd_s3-supply = <&vph_pwr>;
913		vdd_bst_byp-supply = <&vph_pwr>;
914
915		vph_pwr_bbyp: boost-bypass {
916			regulator-name = "vph_pwr_bbyp";
917			regulator-min-microvolt = <3300000>;
918			regulator-max-microvolt = <3300000>;
919		};
920
921		vreg_s1b_1p025: s1 {
922			regulator-name = "vreg_s1b_1p025";
923			regulator-min-microvolt = <1025000>;
924			regulator-max-microvolt = <1025000>;
925		};
926	};
927};
928
929&sdhc2 {
930	/* External SD card */
931	pinctrl-names = "default", "sleep";
932	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
933	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
934	cd-gpios = <&msmgpio 38 0x1>;
935	vmmc-supply = <&vreg_l21a_2p95>;
936	vqmmc-supply = <&vreg_l13a_2p95>;
937	status = "okay";
938};
939
940&q6asmdai {
941	dai@0 {
942		reg = <0>;
943	};
944
945	dai@1 {
946		reg = <1>;
947	};
948
949	dai@2 {
950		reg = <2>;
951	};
952};
953
954&sound {
955	compatible = "qcom,apq8096-sndcard";
956	model = "DB820c";
957	audio-routing =	"RX_BIAS", "MCLK",
958		"MM_DL1",  "MultiMedia1 Playback",
959		"MM_DL2",  "MultiMedia2 Playback",
960		"MultiMedia3 Capture", "MM_UL3";
961
962	mm1-dai-link {
963		link-name = "MultiMedia1";
964		cpu {
965			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
966		};
967	};
968
969	mm2-dai-link {
970		link-name = "MultiMedia2";
971		cpu {
972			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
973		};
974	};
975
976	mm3-dai-link {
977		link-name = "MultiMedia3";
978		cpu {
979			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
980		};
981	};
982
983	hdmi-dai-link {
984		link-name = "HDMI";
985		cpu {
986			sound-dai = <&q6afedai HDMI_RX>;
987		};
988
989		platform {
990			sound-dai = <&q6routing>;
991		};
992
993		codec {
994			sound-dai = <&hdmi 0>;
995		};
996	};
997
998	slim-dai-link {
999		link-name = "SLIM Playback";
1000		cpu {
1001			sound-dai = <&q6afedai SLIMBUS_6_RX>;
1002		};
1003
1004		platform {
1005			sound-dai = <&q6routing>;
1006	};
1007
1008		codec {
1009			sound-dai = <&wcd9335 6>;
1010		};
1011	};
1012
1013	slimcap-dai-link {
1014		link-name = "SLIM Capture";
1015		cpu {
1016			sound-dai = <&q6afedai SLIMBUS_0_TX>;
1017		};
1018
1019		platform {
1020			sound-dai = <&q6routing>;
1021		};
1022
1023		codec {
1024			sound-dai = <&wcd9335 1>;
1025		};
1026	};
1027};
1028
1029&spmi_bus {
1030	pmic@0 {
1031		pon@800 {
1032			resin {
1033				compatible = "qcom,pm8941-resin";
1034				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
1035				debounce = <15625>;
1036				bias-pull-up;
1037				linux,code = <KEY_VOLUMEDOWN>;
1038			};
1039		};
1040	};
1041};
1042
1043&ufsphy {
1044	status = "okay";
1045
1046	vdda-phy-supply = <&vreg_l28a_0p925>;
1047	vdda-pll-supply = <&vreg_l12a_1p8>;
1048	vddp-ref-clk-supply = <&vreg_l25a_1p2>;
1049};
1050
1051&ufshc {
1052	status = "okay";
1053
1054	vcc-supply = <&vreg_l20a_2p95>;
1055	vccq-supply = <&vreg_l25a_1p2>;
1056	vccq2-supply = <&vreg_s4a_1p8>;
1057
1058	vcc-max-microamp = <600000>;
1059	vccq-max-microamp = <450000>;
1060	vccq2-max-microamp = <450000>;
1061};
1062
1063&usb2 {
1064	status = "okay";
1065	extcon = <&usb2_id>;
1066
1067	dwc3@7600000 {
1068		extcon = <&usb2_id>;
1069		dr_mode = "otg";
1070		maximum-speed = "high-speed";
1071	};
1072};
1073
1074&usb3 {
1075	status = "okay";
1076	extcon = <&usb3_id>;
1077
1078	dwc3@6a00000 {
1079		extcon = <&usb3_id>;
1080		dr_mode = "otg";
1081	};
1082};
1083
1084&usb3phy {
1085	status = "okay";
1086
1087	vdda-phy-supply = <&vreg_l28a_0p925>;
1088	vdda-pll-supply = <&vreg_l12a_1p8>;
1089
1090};
1091
1092&wcd9335 {
1093	clock-names = "mclk", "slimbus";
1094	clocks = <&div1_mclk>,
1095		 <&rpmcc RPM_SMD_BB_CLK1>;
1096
1097	vdd-buck-supply = <&vreg_s4a_1p8>;
1098	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
1099	vdd-tx-supply = <&vreg_s4a_1p8>;
1100	vdd-rx-supply = <&vreg_s4a_1p8>;
1101	vdd-io-supply = <&vreg_s4a_1p8>;
1102};
1103