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