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