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/leds/common.h>
14#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
15#include <dt-bindings/sound/qcom,q6afe.h>
16#include <dt-bindings/sound/qcom,q6asm.h>
17#include <dt-bindings/sound/qcom,wcd9335.h>
18
19/*
20 * GPIO name legend: proper name = the GPIO line is used as GPIO
21 *         NC      = not connected (pin out but not routed from the chip to
22 *                   anything the board)
23 *         "[PER]" = pin is muxed for [peripheral] (not GPIO)
24 *         LSEC    = Low Speed External Connector
25 *         P HSEC  = Primary High Speed External Connector
26 *         S HSEC  = Secondary High Speed External Connector
27 *         J14     = Camera Connector
28 *         TP      = Test Points
29 *
30 * Line names are taken from the schematic "DragonBoard 820c",
31 * drawing no: LM25-P2751-1
32 *
33 * For the lines routed to the external connectors the
34 * lines are named after the 96Boards CE Specification 1.0,
35 * Appendix "Expansion Connector Signal Description".
36 *
37 * When the 96Board naming of a line and the schematic name of
38 * the same line are in conflict, the 96Board specification
39 * takes precedence, which means that the external UART on the
40 * LSEC is named UART0 while the schematic and SoC names this
41 * UART3. This is only for the informational lines i.e. "[FOO]",
42 * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
43 * ones actually used for GPIO.
44 */
45
46/ {
47	model = "Qualcomm Technologies, Inc. DB820c";
48	compatible = "arrow,apq8096-db820c", "qcom,apq8096-sbc", "qcom,apq8096";
49
50	aliases {
51		serial0 = &blsp2_uart2;
52		serial1 = &blsp2_uart3;
53		serial2 = &blsp1_uart2;
54		i2c0 = &blsp1_i2c3;
55		i2c1 = &blsp2_i2c1;
56		i2c2 = &blsp2_i2c1;
57		spi0 = &blsp1_spi1;
58		spi1 = &blsp2_spi6;
59	};
60
61	chosen {
62		stdout-path = "serial0:115200n8";
63	};
64
65	clocks {
66		divclk4: divclk4 {
67			compatible = "fixed-clock";
68			#clock-cells = <0>;
69			clock-frequency = <32768>;
70			clock-output-names = "divclk4";
71
72			pinctrl-names = "default";
73			pinctrl-0 = <&divclk4_pin_a>;
74		};
75
76		div1_mclk: divclk1 {
77			compatible = "gpio-gate-clock";
78			pinctrl-0 = <&audio_mclk>;
79			pinctrl-names = "default";
80			clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
81			#clock-cells = <0>;
82			enable-gpios = <&pm8994_gpios 15 0>;
83		};
84	};
85
86	gpio-keys {
87		compatible = "gpio-keys";
88		autorepeat;
89
90		pinctrl-names = "default";
91		pinctrl-0 = <&volume_up_gpio>;
92
93		button {
94			label = "Volume Up";
95			linux,code = <KEY_VOLUMEUP>;
96			gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
97		};
98	};
99
100	usb2_id: usb2-id {
101		compatible = "linux,extcon-usb-gpio";
102		id-gpios = <&pmi8994_gpios 6 GPIO_ACTIVE_HIGH>;
103		pinctrl-names = "default";
104		pinctrl-0 = <&usb2_vbus_det_gpio>;
105	};
106
107	usb3_id: usb3-id {
108		compatible = "linux,extcon-usb-gpio";
109		id-gpios = <&pm8994_gpios 22 GPIO_ACTIVE_HIGH>;
110		pinctrl-names = "default";
111		pinctrl-0 = <&usb3_vbus_det_gpio>;
112	};
113
114	vph_pwr: vph-pwr-regulator {
115		compatible = "regulator-fixed";
116		regulator-name = "vph_pwr";
117		regulator-always-on;
118		regulator-boot-on;
119
120		regulator-min-microvolt = <3700000>;
121		regulator-max-microvolt = <3700000>;
122	};
123
124	wlan_en: wlan-en-1-8v {
125		pinctrl-names = "default";
126		pinctrl-0 = <&wlan_en_gpios>;
127		compatible = "regulator-fixed";
128		regulator-name = "wlan-en-regulator";
129		regulator-min-microvolt = <1800000>;
130		regulator-max-microvolt = <1800000>;
131
132		gpio = <&pm8994_gpios 8 0>;
133
134		/* WLAN card specific delay */
135		startup-delay-us = <70000>;
136		enable-active-high;
137	};
138};
139
140&blsp1_i2c3 {
141	/* On Low speed expansion: LS-I2C0 */
142	status = "okay";
143};
144
145&blsp1_spi1 {
146	/* On Low speed expansion */
147	status = "okay";
148};
149
150&blsp1_uart2 {
151	label = "BT-UART";
152	status = "okay";
153
154	bluetooth {
155		compatible = "qcom,qca6174-bt";
156
157		/* bt_disable_n gpio */
158		enable-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>;
159
160		clocks = <&divclk4>;
161	};
162};
163
164&adsp_pil {
165	status = "okay";
166	firmware-name = "qcom/apq8096/adsp.mbn";
167};
168
169&blsp2_i2c1 {
170	/* On High speed expansion: HS-I2C2 */
171	status = "okay";
172};
173
174&blsp2_i2c1 {
175	/* On Low speed expansion: LS-I2C1 */
176	status = "okay";
177};
178
179&blsp2_spi6 {
180	/* On High speed expansion */
181	status = "okay";
182};
183
184&blsp2_uart2 {
185	label = "LS-UART1";
186	status = "okay";
187	pinctrl-names = "default", "sleep";
188	pinctrl-0 = <&blsp2_uart2_2pins_default>;
189	pinctrl-1 = <&blsp2_uart2_2pins_sleep>;
190};
191
192&blsp2_uart3 {
193	label = "LS-UART0";
194	status = "disabled";
195	pinctrl-names = "default", "sleep";
196	pinctrl-0 = <&blsp2_uart3_4pins_default>;
197	pinctrl-1 = <&blsp2_uart3_4pins_sleep>;
198};
199
200&camss {
201	vdda-supply = <&vreg_l2a_1p25>;
202};
203
204&gpu {
205	status = "okay";
206};
207
208&hsusb_phy1 {
209	status = "okay";
210
211	vdd-supply = <&vreg_l28a_0p925>;
212	vdda-pll-supply = <&vreg_l12a_1p8>;
213	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
214};
215
216&hsusb_phy2 {
217	status = "okay";
218
219	vdd-supply = <&vreg_l28a_0p925>;
220	vdda-pll-supply = <&vreg_l12a_1p8>;
221	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
222};
223
224&mdp {
225	status = "okay";
226};
227
228&mdss {
229	status = "okay";
230};
231
232&mdss_hdmi {
233	status = "okay";
234
235	pinctrl-names = "default", "sleep";
236	pinctrl-0 = <&hdmi_hpd_active &hdmi_ddc_active>;
237	pinctrl-1 = <&hdmi_hpd_suspend &hdmi_ddc_suspend>;
238
239	core-vdda-supply = <&vreg_l12a_1p8>;
240	core-vcc-supply = <&vreg_s4a_1p8>;
241};
242
243&mdss_hdmi_phy {
244	status = "okay";
245
246	vddio-supply = <&vreg_l12a_1p8>;
247	vcca-supply = <&vreg_l28a_0p925>;
248	#phy-cells = <0>;
249};
250
251&mmcc {
252	vdd-gfx-supply = <&vdd_gfx>;
253};
254
255&mss_pil {
256	status = "okay";
257	pll-supply = <&vreg_l12a_1p8>;
258	firmware-name = "qcom/apq8096/mba.mbn", "qcom/apq8096/modem.mbn";
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-state {
420		pins = "gpio38";
421		function = "gpio";
422		bias-pull-up;
423		drive-strength = <16>;
424	};
425
426	sdc2_cd_off: sdc2-cd-off-state {
427		pins = "gpio38";
428		function = "gpio";
429		bias-pull-up;
430		drive-strength = <2>;
431	};
432
433	hdmi_hpd_active: hdmi-hpd-active-state {
434		pins = "gpio34";
435		function = "hdmi_hot";
436		bias-pull-down;
437		drive-strength = <16>;
438	};
439
440	hdmi_hpd_suspend: hdmi-hpd-suspend-state {
441		pins = "gpio34";
442		function = "hdmi_hot";
443		bias-pull-down;
444		drive-strength = <2>;
445	};
446
447	hdmi_ddc_active: hdmi-ddc-active-state {
448		pins = "gpio32", "gpio33";
449		function = "hdmi_ddc";
450		drive-strength = <2>;
451		bias-pull-up;
452	};
453
454	hdmi_ddc_suspend: hdmi-ddc-suspend-state {
455		pins = "gpio32", "gpio33";
456		function = "hdmi_ddc";
457		drive-strength = <2>;
458		bias-pull-down;
459	};
460};
461
462&pcie0 {
463	status = "okay";
464	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
465	vddpe-3v3-supply = <&wlan_en>;
466	vdda-supply = <&vreg_l28a_0p925>;
467};
468
469&pcie1 {
470	status = "okay";
471	perst-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
472	vdda-supply = <&vreg_l28a_0p925>;
473};
474
475&pcie2 {
476	status = "okay";
477	perst-gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
478	vdda-supply = <&vreg_l28a_0p925>;
479};
480
481&pcie_phy {
482	status = "okay";
483
484	vdda-phy-supply = <&vreg_l28a_0p925>;
485	vdda-pll-supply = <&vreg_l12a_1p8>;
486};
487
488&pm8994_gpios {
489	gpio-line-names =
490		"NC",
491		"KEY_VOLP_N",
492		"NC",
493		"BL1_PWM",
494		"GPIO-F", /* BL0_PWM, LSEC pin 28 */
495		"BL1_EN",
496		"NC",
497		"WLAN_EN",
498		"NC",
499		"NC",
500		"NC",
501		"NC",
502		"NC",
503		"NC",
504		"DIVCLK1",
505		"DIVCLK2",
506		"DIVCLK3",
507		"DIVCLK4",
508		"BT_EN",
509		"PMIC_SLB",
510		"PMIC_BUA",
511		"USB_VBUS_DET";
512
513	pinctrl-names = "default";
514	pinctrl-0 = <&ls_exp_gpio_f &bt_en_gpios>;
515
516	ls_exp_gpio_f: pm8994-gpio5-state {
517		pinconf {
518			pins = "gpio5";
519			function = PMIC_GPIO_FUNC_NORMAL;
520			output-low;
521			power-source = <PM8994_GPIO_S4>; /* 1.8V */
522		};
523	};
524
525	bt_en_gpios: bt-en-pios-state {
526		pinconf {
527			pins = "gpio19";
528			function = PMIC_GPIO_FUNC_NORMAL;
529			output-low;
530			power-source = <PM8994_GPIO_S4>; /* 1.8V */
531			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
532			bias-pull-down;
533		};
534	};
535
536	wlan_en_gpios: wlan-en-gpios-state {
537		pinconf {
538			pins = "gpio8";
539			function = PMIC_GPIO_FUNC_NORMAL;
540			output-low;
541			power-source = <PM8994_GPIO_S4>; /* 1.8V */
542			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
543			bias-pull-down;
544		};
545	};
546
547	audio_mclk: clk-div1-state {
548		pinconf {
549			pins = "gpio15";
550			function = "func1";
551			power-source = <PM8994_GPIO_S4>; /* 1.8V */
552		};
553	};
554
555	volume_up_gpio: pm8996-gpio2-state {
556		pinconf {
557			pins = "gpio2";
558			function = "normal";
559			input-enable;
560			drive-push-pull;
561			bias-pull-up;
562			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
563			power-source = <PM8994_GPIO_S4>; /* 1.8V */
564		};
565	};
566
567	divclk4_pin_a: divclk4-state {
568		pinconf {
569			pins = "gpio18";
570			function = PMIC_GPIO_FUNC_FUNC2;
571
572			bias-disable;
573			power-source = <PM8994_GPIO_S4>;
574		};
575	};
576
577	usb3_vbus_det_gpio: pm8996-gpio22-state {
578		pinconf {
579			pins = "gpio22";
580			function = PMIC_GPIO_FUNC_NORMAL;
581			input-enable;
582			bias-pull-down;
583			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
584			power-source = <PM8994_GPIO_S4>; /* 1.8V */
585		};
586	};
587};
588
589&pm8994_mpps {
590	gpio-line-names =
591		"VDDPX_BIAS",
592		"WIFI_LED",
593		"NC",
594		"BT_LED",
595		"PM_MPP05",
596		"PM_MPP06",
597		"PM_MPP07",
598		"NC";
599};
600
601&pm8994_spmi_regulators {
602	qcom,saw-reg = <&saw3>;
603	vdd_s11-supply = <&vph_pwr>;
604
605	s9 {
606		qcom,saw-slave;
607	};
608	s10 {
609		qcom,saw-slave;
610	};
611	s11 {
612		qcom,saw-leader;
613		regulator-name = "VDD_APCC";
614		regulator-always-on;
615		regulator-min-microvolt = <980000>;
616		regulator-max-microvolt = <980000>;
617	};
618};
619
620&pmi8994_gpios {
621	gpio-line-names =
622		"NC",
623		"SPKR_AMP_EN1",
624		"SPKR_AMP_EN2",
625		"TP61",
626		"NC",
627		"USB2_VBUS_DET",
628		"NC",
629		"NC",
630		"NC",
631		"NC";
632
633	usb2_vbus_det_gpio: pmi8996-gpio6-state {
634		pinconf {
635			pins = "gpio6";
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&pmi8994_lpg {
646	qcom,power-source = <1>;
647
648	pinctrl-names = "default";
649	pinctrl-0 = <&pmi8994_mpp2_userled4>;
650
651	qcom,dtest = <0 0>,
652		     <0 0>,
653		     <0 0>,
654		     <4 1>;
655
656	status = "okay";
657
658	led@1 {
659		reg = <1>;
660		color = <LED_COLOR_ID_GREEN>;
661		function = LED_FUNCTION_HEARTBEAT;
662		function-enumerator = <1>;
663
664		linux,default-trigger = "heartbeat";
665		default-state = "on";
666	};
667
668	led@2 {
669		reg = <2>;
670		color = <LED_COLOR_ID_GREEN>;
671		function = LED_FUNCTION_HEARTBEAT;
672		function-enumerator = <0>;
673	};
674
675	led@3 {
676		reg = <3>;
677		color = <LED_COLOR_ID_GREEN>;
678		function = LED_FUNCTION_HEARTBEAT;
679		function-enumerator = <2>;
680	};
681
682	led@4 {
683		reg = <4>;
684		color = <LED_COLOR_ID_GREEN>;
685		function = LED_FUNCTION_HEARTBEAT;
686		function-enumerator = <3>;
687	};
688};
689
690&pmi8994_mpps {
691	pmi8994_mpp2_userled4: mpp2-userled4-state {
692		pins = "mpp2";
693		function = "sink";
694
695		output-low;
696		qcom,dtest = <4>;
697	};
698};
699
700&pmi8994_spmi_regulators {
701	vdd_s2-supply = <&vph_pwr>;
702
703	vdd_gfx: s2 {
704		regulator-name = "VDD_GFX";
705		regulator-min-microvolt = <980000>;
706		regulator-max-microvolt = <980000>;
707	};
708};
709
710&rpm_requests {
711	regulators-0 {
712		compatible = "qcom,rpm-pm8994-regulators";
713
714		vdd_s1-supply = <&vph_pwr>;
715		vdd_s2-supply = <&vph_pwr>;
716		vdd_s3-supply = <&vph_pwr>;
717		vdd_s4-supply = <&vph_pwr>;
718		vdd_s5-supply = <&vph_pwr>;
719		vdd_s6-supply = <&vph_pwr>;
720		vdd_s7-supply = <&vph_pwr>;
721		vdd_s8-supply = <&vph_pwr>;
722		vdd_s9-supply = <&vph_pwr>;
723		vdd_s10-supply = <&vph_pwr>;
724		vdd_s11-supply = <&vph_pwr>;
725		vdd_s12-supply = <&vph_pwr>;
726		vdd_l1-supply = <&vreg_s1b_1p025>;
727		vdd_l2_l26_l28-supply = <&vreg_s3a_1p3>;
728		vdd_l3_l11-supply = <&vreg_s3a_1p3>;
729		vdd_l4_l27_l31-supply = <&vreg_s3a_1p3>;
730		vdd_l5_l7-supply = <&vreg_s5a_2p15>;
731		vdd_l6_l12_l32-supply = <&vreg_s5a_2p15>;
732		vdd_l8_l16_l30-supply = <&vph_pwr>;
733		vdd_l9_l10_l18_l22-supply = <&vph_pwr_bbyp>;
734		vdd_l13_l19_l23_l24-supply = <&vph_pwr_bbyp>;
735		vdd_l14_l15-supply = <&vreg_s5a_2p15>;
736		vdd_l17_l29-supply = <&vph_pwr_bbyp>;
737		vdd_l20_l21-supply = <&vph_pwr_bbyp>;
738		vdd_l25-supply = <&vreg_s3a_1p3>;
739		vdd_lvs1_2-supply = <&vreg_s4a_1p8>;
740
741		vreg_s3a_1p3: s3 {
742			regulator-name = "vreg_s3a_1p3";
743			regulator-min-microvolt = <1300000>;
744			regulator-max-microvolt = <1300000>;
745		};
746
747		/**
748		 * 1.8v required on LS expansion
749		 * for mezzanine boards
750		 */
751		vreg_s4a_1p8: s4 {
752			regulator-name = "vreg_s4a_1p8";
753			regulator-min-microvolt = <1800000>;
754			regulator-max-microvolt = <1800000>;
755			regulator-always-on;
756		};
757		vreg_s5a_2p15: s5 {
758			regulator-name = "vreg_s5a_2p15";
759			regulator-min-microvolt = <2150000>;
760			regulator-max-microvolt = <2150000>;
761		};
762		vreg_s7a_1p0: s7 {
763			regulator-name = "vreg_s7a_1p0";
764			regulator-min-microvolt = <800000>;
765			regulator-max-microvolt = <800000>;
766		};
767
768		vreg_l1a_1p0: l1 {
769			regulator-name = "vreg_l1a_1p0";
770			regulator-min-microvolt = <1000000>;
771			regulator-max-microvolt = <1000000>;
772		};
773		vreg_l2a_1p25: l2 {
774			regulator-name = "vreg_l2a_1p25";
775			regulator-min-microvolt = <1250000>;
776			regulator-max-microvolt = <1250000>;
777		};
778		vreg_l3a_0p875: l3 {
779			regulator-name = "vreg_l3a_0p875";
780			regulator-min-microvolt = <850000>;
781			regulator-max-microvolt = <850000>;
782		};
783		vreg_l4a_1p225: l4 {
784			regulator-name = "vreg_l4a_1p225";
785			regulator-min-microvolt = <1225000>;
786			regulator-max-microvolt = <1225000>;
787		};
788		vreg_l6a_1p2: l6 {
789			regulator-name = "vreg_l6a_1p2";
790			regulator-min-microvolt = <1200000>;
791			regulator-max-microvolt = <1200000>;
792		};
793		vreg_l8a_1p8: l8 {
794			regulator-name = "vreg_l8a_1p8";
795			regulator-min-microvolt = <1800000>;
796			regulator-max-microvolt = <1800000>;
797		};
798		vreg_l9a_1p8: l9 {
799			regulator-name = "vreg_l9a_1p8";
800			regulator-min-microvolt = <1800000>;
801			regulator-max-microvolt = <1800000>;
802		};
803		vreg_l10a_1p8: l10 {
804			regulator-name = "vreg_l10a_1p8";
805			regulator-min-microvolt = <1800000>;
806			regulator-max-microvolt = <1800000>;
807		};
808		vreg_l11a_1p15: l11 {
809			regulator-name = "vreg_l11a_1p15";
810			regulator-min-microvolt = <1150000>;
811			regulator-max-microvolt = <1150000>;
812		};
813		vreg_l12a_1p8: l12 {
814			regulator-name = "vreg_l12a_1p8";
815			regulator-min-microvolt = <1800000>;
816			regulator-max-microvolt = <1800000>;
817		};
818		vreg_l13a_2p95: l13 {
819			regulator-name = "vreg_l13a_2p95";
820			regulator-min-microvolt = <1800000>;
821			regulator-max-microvolt = <2950000>;
822		};
823		vreg_l14a_1p8: l14 {
824			regulator-name = "vreg_l14a_1p8";
825			regulator-min-microvolt = <1800000>;
826			regulator-max-microvolt = <1800000>;
827		};
828		vreg_l15a_1p8: l15 {
829			regulator-name = "vreg_l15a_1p8";
830			regulator-min-microvolt = <1800000>;
831			regulator-max-microvolt = <1800000>;
832		};
833		vreg_l16a_2p7: l16 {
834			regulator-name = "vreg_l16a_2p7";
835			regulator-min-microvolt = <2700000>;
836			regulator-max-microvolt = <2700000>;
837		};
838		vreg_l17a_2p8: l17 {
839			regulator-name = "vreg_l17a_2p8";
840			regulator-min-microvolt = <2500000>;
841			regulator-max-microvolt = <2500000>;
842		};
843		vreg_l18a_2p85: l18 {
844			regulator-name = "vreg_l18a_2p85";
845			regulator-min-microvolt = <2700000>;
846			regulator-max-microvolt = <2900000>;
847		};
848		vreg_l19a_2p8: l19 {
849			regulator-name = "vreg_l19a_2p8";
850			regulator-min-microvolt = <3000000>;
851			regulator-max-microvolt = <3000000>;
852		};
853		vreg_l20a_2p95: l20 {
854			regulator-name = "vreg_l20a_2p95";
855			regulator-min-microvolt = <2950000>;
856			regulator-max-microvolt = <2950000>;
857			regulator-allow-set-load;
858		};
859		vreg_l21a_2p95: l21 {
860			regulator-name = "vreg_l21a_2p95";
861			regulator-min-microvolt = <2950000>;
862			regulator-max-microvolt = <2950000>;
863			regulator-allow-set-load;
864			regulator-system-load = <200000>;
865		};
866		vreg_l22a_3p0: l22 {
867			regulator-name = "vreg_l22a_3p0";
868			regulator-min-microvolt = <3300000>;
869			regulator-max-microvolt = <3300000>;
870		};
871		vreg_l23a_2p8: l23 {
872			regulator-name = "vreg_l23a_2p8";
873			regulator-min-microvolt = <2800000>;
874			regulator-max-microvolt = <2800000>;
875		};
876		vreg_l24a_3p075: l24 {
877			regulator-name = "vreg_l24a_3p075";
878			regulator-min-microvolt = <3075000>;
879			regulator-max-microvolt = <3075000>;
880		};
881		vreg_l25a_1p2: l25 {
882			regulator-name = "vreg_l25a_1p2";
883			regulator-min-microvolt = <1200000>;
884			regulator-max-microvolt = <1200000>;
885			regulator-allow-set-load;
886		};
887		vreg_l26a_0p8: l27 {
888			regulator-name = "vreg_l26a_0p8";
889			regulator-min-microvolt = <1000000>;
890			regulator-max-microvolt = <1000000>;
891		};
892		vreg_l28a_0p925: l28 {
893			regulator-name = "vreg_l28a_0p925";
894			regulator-min-microvolt = <925000>;
895			regulator-max-microvolt = <925000>;
896			regulator-allow-set-load;
897		};
898		vreg_l29a_2p8: l29 {
899			regulator-name = "vreg_l29a_2p8";
900			regulator-min-microvolt = <2800000>;
901			regulator-max-microvolt = <2800000>;
902		};
903		vreg_l30a_1p8: l30 {
904			regulator-name = "vreg_l30a_1p8";
905			regulator-min-microvolt = <1800000>;
906			regulator-max-microvolt = <1800000>;
907		};
908		vreg_l32a_1p8: l32 {
909			regulator-name = "vreg_l32a_1p8";
910			regulator-min-microvolt = <1800000>;
911			regulator-max-microvolt = <1800000>;
912		};
913
914		vreg_lvs1a_1p8: lvs1 {
915			regulator-name = "vreg_lvs1a_1p8";
916		};
917
918		vreg_lvs2a_1p8: lvs2 {
919			regulator-name = "vreg_lvs2a_1p8";
920		};
921	};
922
923	regulators-1 {
924		compatible = "qcom,rpm-pmi8994-regulators";
925
926		vdd_s1-supply = <&vph_pwr>;
927		vdd_s2-supply = <&vph_pwr>;
928		vdd_s3-supply = <&vph_pwr>;
929		vdd_bst_byp-supply = <&vph_pwr>;
930
931		vph_pwr_bbyp: boost-bypass {
932			regulator-name = "vph_pwr_bbyp";
933			regulator-min-microvolt = <3300000>;
934			regulator-max-microvolt = <3300000>;
935		};
936
937		vreg_s1b_1p025: s1 {
938			regulator-name = "vreg_s1b_1p025";
939			regulator-min-microvolt = <1025000>;
940			regulator-max-microvolt = <1025000>;
941		};
942	};
943};
944
945&sdhc2 {
946	/* External SD card */
947	pinctrl-names = "default", "sleep";
948	pinctrl-0 = <&sdc2_state_on &sdc2_cd_on>;
949	pinctrl-1 = <&sdc2_state_off &sdc2_cd_off>;
950	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
951	vmmc-supply = <&vreg_l21a_2p95>;
952	vqmmc-supply = <&vreg_l13a_2p95>;
953	status = "okay";
954};
955
956&q6asmdai {
957	dai@0 {
958		reg = <0>;
959	};
960
961	dai@1 {
962		reg = <1>;
963	};
964
965	dai@2 {
966		reg = <2>;
967	};
968};
969
970&slim_msm {
971	status = "okay";
972
973	slim@1 {
974		reg = <1>;
975		#address-cells = <2>;
976		#size-cells = <0>;
977
978		tasha_ifd: tas-ifd@0,0 {
979			compatible = "slim217,1a0";
980			reg = <0 0>;
981		};
982
983		wcd9335: codec@1,0 {
984			compatible = "slim217,1a0";
985			reg = <1 0>;
986
987			clock-names = "mclk", "slimbus";
988			clocks = <&div1_mclk>,
989				 <&rpmcc RPM_SMD_BB_CLK1>;
990			interrupt-parent = <&tlmm>;
991			interrupts = <54 IRQ_TYPE_LEVEL_HIGH>,
992				     <53 IRQ_TYPE_LEVEL_HIGH>;
993			interrupt-names = "intr1", "intr2";
994			interrupt-controller;
995			#interrupt-cells = <1>;
996
997			pinctrl-0 = <&cdc_reset_active &wcd_intr_default>;
998			pinctrl-names = "default";
999
1000			reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
1001			slim-ifc-dev = <&tasha_ifd>;
1002
1003			#sound-dai-cells = <1>;
1004
1005			vdd-buck-supply = <&vreg_s4a_1p8>;
1006			vdd-buck-sido-supply = <&vreg_s4a_1p8>;
1007			vdd-tx-supply = <&vreg_s4a_1p8>;
1008			vdd-rx-supply = <&vreg_s4a_1p8>;
1009			vdd-io-supply = <&vreg_s4a_1p8>;
1010		};
1011	};
1012};
1013
1014&sound {
1015	compatible = "qcom,apq8096-sndcard";
1016	model = "DB820c";
1017	audio-routing = "RX_BIAS", "MCLK",
1018		"MM_DL1",  "MultiMedia1 Playback",
1019		"MM_DL2",  "MultiMedia2 Playback",
1020		"MultiMedia3 Capture", "MM_UL3";
1021
1022	mm1-dai-link {
1023		link-name = "MultiMedia1";
1024		cpu {
1025			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
1026		};
1027	};
1028
1029	mm2-dai-link {
1030		link-name = "MultiMedia2";
1031		cpu {
1032			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
1033		};
1034	};
1035
1036	mm3-dai-link {
1037		link-name = "MultiMedia3";
1038		cpu {
1039			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
1040		};
1041	};
1042
1043	hdmi-dai-link {
1044		link-name = "HDMI";
1045		cpu {
1046			sound-dai = <&q6afedai HDMI_RX>;
1047		};
1048
1049		platform {
1050			sound-dai = <&q6routing>;
1051		};
1052
1053		codec {
1054			sound-dai = <&mdss_hdmi 0>;
1055		};
1056	};
1057
1058	slim-dai-link {
1059		link-name = "SLIM Playback";
1060		cpu {
1061			sound-dai = <&q6afedai SLIMBUS_6_RX>;
1062		};
1063
1064		platform {
1065			sound-dai = <&q6routing>;
1066		};
1067
1068		codec {
1069			sound-dai = <&wcd9335 AIF4_PB>;
1070		};
1071	};
1072
1073	slimcap-dai-link {
1074		link-name = "SLIM Capture";
1075		cpu {
1076			sound-dai = <&q6afedai SLIMBUS_0_TX>;
1077		};
1078
1079		platform {
1080			sound-dai = <&q6routing>;
1081		};
1082
1083		codec {
1084			sound-dai = <&wcd9335 AIF1_CAP>;
1085		};
1086	};
1087};
1088
1089&ufsphy {
1090	status = "okay";
1091
1092	vdda-phy-supply = <&vreg_l28a_0p925>;
1093	vdda-pll-supply = <&vreg_l12a_1p8>;
1094	vddp-ref-clk-supply = <&vreg_l25a_1p2>;
1095};
1096
1097&ufshc {
1098	status = "okay";
1099
1100	vcc-supply = <&vreg_l20a_2p95>;
1101	vccq-supply = <&vreg_l25a_1p2>;
1102	vccq2-supply = <&vreg_s4a_1p8>;
1103
1104	vcc-max-microamp = <600000>;
1105	vccq-max-microamp = <450000>;
1106	vccq2-max-microamp = <450000>;
1107};
1108
1109&usb2 {
1110	status = "okay";
1111	extcon = <&usb2_id>;
1112};
1113
1114&usb2_dwc3 {
1115	extcon = <&usb2_id>;
1116	dr_mode = "otg";
1117	maximum-speed = "high-speed";
1118};
1119
1120&usb3 {
1121	status = "okay";
1122	extcon = <&usb3_id>;
1123};
1124
1125&usb3_dwc3 {
1126	extcon = <&usb3_id>;
1127	dr_mode = "otg";
1128};
1129
1130&usb3phy {
1131	status = "okay";
1132
1133	vdda-phy-supply = <&vreg_l28a_0p925>;
1134	vdda-pll-supply = <&vreg_l12a_1p8>;
1135};
1136
1137&venus {
1138	status = "okay";
1139};
1140