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