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		compatible = "simple-bus";
67		divclk4: divclk4 {
68			compatible = "fixed-clock";
69			#clock-cells = <0>;
70			clock-frequency = <32768>;
71			clock-output-names = "divclk4";
72
73			pinctrl-names = "default";
74			pinctrl-0 = <&divclk4_pin_a>;
75		};
76
77		div1_mclk: divclk1 {
78			compatible = "gpio-gate-clock";
79			pinctrl-0 = <&audio_mclk>;
80			pinctrl-names = "default";
81			clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
82			#clock-cells = <0>;
83			enable-gpios = <&pm8994_gpios 15 0>;
84		};
85	};
86
87	gpio-keys {
88		compatible = "gpio-keys";
89		autorepeat;
90
91		pinctrl-names = "default";
92		pinctrl-0 = <&volume_up_gpio>;
93
94		button {
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-state {
426		pins = "gpio38";
427		function = "gpio";
428		bias-pull-up;
429		drive-strength = <16>;
430	};
431
432	sdc2_cd_off: sdc2-cd-off-state {
433		pins = "gpio38";
434		function = "gpio";
435		bias-pull-up;
436		drive-strength = <2>;
437	};
438
439	hdmi_hpd_active: hdmi-hpd-active-state {
440		pins = "gpio34";
441		function = "hdmi_hot";
442		bias-pull-down;
443		drive-strength = <16>;
444	};
445
446	hdmi_hpd_suspend: hdmi-hpd-suspend-state {
447		pins = "gpio34";
448		function = "hdmi_hot";
449		bias-pull-down;
450		drive-strength = <2>;
451	};
452
453	hdmi_ddc_active: hdmi-ddc-active-state {
454		pins = "gpio32", "gpio33";
455		function = "hdmi_ddc";
456		drive-strength = <2>;
457		bias-pull-up;
458	};
459
460	hdmi_ddc_suspend: hdmi-ddc-suspend-state {
461		pins = "gpio32", "gpio33";
462		function = "hdmi_ddc";
463		drive-strength = <2>;
464		bias-pull-down;
465	};
466};
467
468&pcie0 {
469	status = "okay";
470	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
471	vddpe-3v3-supply = <&wlan_en>;
472	vdda-supply = <&vreg_l28a_0p925>;
473};
474
475&pcie1 {
476	status = "okay";
477	perst-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
478	vdda-supply = <&vreg_l28a_0p925>;
479};
480
481&pcie2 {
482	status = "okay";
483	perst-gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
484	vdda-supply = <&vreg_l28a_0p925>;
485};
486
487&pcie_phy {
488	status = "okay";
489
490	vdda-phy-supply = <&vreg_l28a_0p925>;
491	vdda-pll-supply = <&vreg_l12a_1p8>;
492};
493
494&pm8994_gpios {
495	gpio-line-names =
496		"NC",
497		"KEY_VOLP_N",
498		"NC",
499		"BL1_PWM",
500		"GPIO-F", /* BL0_PWM, LSEC pin 28 */
501		"BL1_EN",
502		"NC",
503		"WLAN_EN",
504		"NC",
505		"NC",
506		"NC",
507		"NC",
508		"NC",
509		"NC",
510		"DIVCLK1",
511		"DIVCLK2",
512		"DIVCLK3",
513		"DIVCLK4",
514		"BT_EN",
515		"PMIC_SLB",
516		"PMIC_BUA",
517		"USB_VBUS_DET";
518
519	pinctrl-names = "default";
520	pinctrl-0 = <&ls_exp_gpio_f &bt_en_gpios>;
521
522	ls_exp_gpio_f: pm8994-gpio5-state {
523		pinconf {
524			pins = "gpio5";
525			function = PMIC_GPIO_FUNC_NORMAL;
526			output-low;
527			power-source = <PM8994_GPIO_S4>; /* 1.8V */
528		};
529	};
530
531	bt_en_gpios: bt-en-pios-state {
532		pinconf {
533			pins = "gpio19";
534			function = PMIC_GPIO_FUNC_NORMAL;
535			output-low;
536			power-source = <PM8994_GPIO_S4>; /* 1.8V */
537			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
538			bias-pull-down;
539		};
540	};
541
542	wlan_en_gpios: wlan-en-gpios-state {
543		pinconf {
544			pins = "gpio8";
545			function = PMIC_GPIO_FUNC_NORMAL;
546			output-low;
547			power-source = <PM8994_GPIO_S4>; /* 1.8V */
548			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
549			bias-pull-down;
550		};
551	};
552
553	audio_mclk: clk-div1-state {
554		pinconf {
555			pins = "gpio15";
556			function = "func1";
557			power-source = <PM8994_GPIO_S4>; /* 1.8V */
558		};
559	};
560
561	volume_up_gpio: pm8996-gpio2-state {
562		pinconf {
563			pins = "gpio2";
564			function = "normal";
565			input-enable;
566			drive-push-pull;
567			bias-pull-up;
568			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
569			power-source = <PM8994_GPIO_S4>; /* 1.8V */
570		};
571	};
572
573	divclk4_pin_a: divclk4-state {
574		pinconf {
575			pins = "gpio18";
576			function = PMIC_GPIO_FUNC_FUNC2;
577
578			bias-disable;
579			power-source = <PM8994_GPIO_S4>;
580		};
581	};
582
583	usb3_vbus_det_gpio: pm8996-gpio22-state {
584		pinconf {
585			pins = "gpio22";
586			function = PMIC_GPIO_FUNC_NORMAL;
587			input-enable;
588			bias-pull-down;
589			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
590			power-source = <PM8994_GPIO_S4>; /* 1.8V */
591		};
592	};
593};
594
595&pm8994_mpps {
596	gpio-line-names =
597		"VDDPX_BIAS",
598		"WIFI_LED",
599		"NC",
600		"BT_LED",
601		"PM_MPP05",
602		"PM_MPP06",
603		"PM_MPP07",
604		"NC";
605};
606
607&pm8994_spmi_regulators {
608	qcom,saw-reg = <&saw3>;
609	vdd_s11-supply = <&vph_pwr>;
610
611	s9 {
612		qcom,saw-slave;
613	};
614	s10 {
615		qcom,saw-slave;
616	};
617	s11 {
618		qcom,saw-leader;
619		regulator-name = "VDD_APCC";
620		regulator-always-on;
621		regulator-min-microvolt = <980000>;
622		regulator-max-microvolt = <980000>;
623	};
624};
625
626&pmi8994_gpios {
627	gpio-line-names =
628		"NC",
629		"SPKR_AMP_EN1",
630		"SPKR_AMP_EN2",
631		"TP61",
632		"NC",
633		"USB2_VBUS_DET",
634		"NC",
635		"NC",
636		"NC",
637		"NC";
638
639	usb2_vbus_det_gpio: pmi8996-gpio6-state {
640		pinconf {
641			pins = "gpio6";
642			function = PMIC_GPIO_FUNC_NORMAL;
643			input-enable;
644			bias-pull-down;
645			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
646			power-source = <PM8994_GPIO_S4>; /* 1.8V */
647		};
648	};
649};
650
651&pmi8994_lpg {
652	qcom,power-source = <1>;
653
654	pinctrl-names = "default";
655	pinctrl-0 = <&pmi8994_mpp2_userled4>;
656
657	qcom,dtest = <0 0>,
658		     <0 0>,
659		     <0 0>,
660		     <4 1>;
661
662	status = "okay";
663
664	led@1 {
665		reg = <1>;
666		color = <LED_COLOR_ID_GREEN>;
667		function = LED_FUNCTION_HEARTBEAT;
668		function-enumerator = <1>;
669
670		linux,default-trigger = "heartbeat";
671		default-state = "on";
672	};
673
674	led@2 {
675		reg = <2>;
676		color = <LED_COLOR_ID_GREEN>;
677		function = LED_FUNCTION_HEARTBEAT;
678		function-enumerator = <0>;
679	};
680
681	led@3 {
682		reg = <3>;
683		color = <LED_COLOR_ID_GREEN>;
684		function = LED_FUNCTION_HEARTBEAT;
685		function-enumerator = <2>;
686	};
687
688	led@4 {
689		reg = <4>;
690		color = <LED_COLOR_ID_GREEN>;
691		function = LED_FUNCTION_HEARTBEAT;
692		function-enumerator = <3>;
693	};
694};
695
696&pmi8994_mpps {
697	pmi8994_mpp2_userled4: mpp2-userled4-state {
698		pins = "mpp2";
699		function = "sink";
700
701		output-low;
702		qcom,dtest = <4>;
703	};
704};
705
706&pmi8994_spmi_regulators {
707	vdd_s2-supply = <&vph_pwr>;
708
709	vdd_gfx: s2@1700 {
710		reg = <0x1700 0x100>;
711		regulator-name = "VDD_GFX";
712		regulator-min-microvolt = <980000>;
713		regulator-max-microvolt = <980000>;
714	};
715};
716
717&rpm_requests {
718	regulators-0 {
719		compatible = "qcom,rpm-pm8994-regulators";
720
721		vdd_s1-supply = <&vph_pwr>;
722		vdd_s2-supply = <&vph_pwr>;
723		vdd_s3-supply = <&vph_pwr>;
724		vdd_s4-supply = <&vph_pwr>;
725		vdd_s5-supply = <&vph_pwr>;
726		vdd_s6-supply = <&vph_pwr>;
727		vdd_s7-supply = <&vph_pwr>;
728		vdd_s8-supply = <&vph_pwr>;
729		vdd_s9-supply = <&vph_pwr>;
730		vdd_s10-supply = <&vph_pwr>;
731		vdd_s11-supply = <&vph_pwr>;
732		vdd_s12-supply = <&vph_pwr>;
733		vdd_l1-supply = <&vreg_s1b_1p025>;
734		vdd_l2_l26_l28-supply = <&vreg_s3a_1p3>;
735		vdd_l3_l11-supply = <&vreg_s3a_1p3>;
736		vdd_l4_l27_l31-supply = <&vreg_s3a_1p3>;
737		vdd_l5_l7-supply = <&vreg_s5a_2p15>;
738		vdd_l6_l12_l32-supply = <&vreg_s5a_2p15>;
739		vdd_l8_l16_l30-supply = <&vph_pwr>;
740		vdd_l9_l10_l18_l22-supply = <&vph_pwr_bbyp>;
741		vdd_l13_l19_l23_l24-supply = <&vph_pwr_bbyp>;
742		vdd_l14_l15-supply = <&vreg_s5a_2p15>;
743		vdd_l17_l29-supply = <&vph_pwr_bbyp>;
744		vdd_l20_l21-supply = <&vph_pwr_bbyp>;
745		vdd_l25-supply = <&vreg_s3a_1p3>;
746		vdd_lvs1_2-supply = <&vreg_s4a_1p8>;
747
748		vreg_s3a_1p3: s3 {
749			regulator-name = "vreg_s3a_1p3";
750			regulator-min-microvolt = <1300000>;
751			regulator-max-microvolt = <1300000>;
752		};
753
754		/**
755		 * 1.8v required on LS expansion
756		 * for mezzanine boards
757		 */
758		vreg_s4a_1p8: s4 {
759			regulator-name = "vreg_s4a_1p8";
760			regulator-min-microvolt = <1800000>;
761			regulator-max-microvolt = <1800000>;
762			regulator-always-on;
763		};
764		vreg_s5a_2p15: s5 {
765			regulator-name = "vreg_s5a_2p15";
766			regulator-min-microvolt = <2150000>;
767			regulator-max-microvolt = <2150000>;
768		};
769		vreg_s7a_1p0: s7 {
770			regulator-name = "vreg_s7a_1p0";
771			regulator-min-microvolt = <800000>;
772			regulator-max-microvolt = <800000>;
773		};
774
775		vreg_l1a_1p0: l1 {
776			regulator-name = "vreg_l1a_1p0";
777			regulator-min-microvolt = <1000000>;
778			regulator-max-microvolt = <1000000>;
779		};
780		vreg_l2a_1p25: l2 {
781			regulator-name = "vreg_l2a_1p25";
782			regulator-min-microvolt = <1250000>;
783			regulator-max-microvolt = <1250000>;
784		};
785		vreg_l3a_0p875: l3 {
786			regulator-name = "vreg_l3a_0p875";
787			regulator-min-microvolt = <850000>;
788			regulator-max-microvolt = <850000>;
789		};
790		vreg_l4a_1p225: l4 {
791			regulator-name = "vreg_l4a_1p225";
792			regulator-min-microvolt = <1225000>;
793			regulator-max-microvolt = <1225000>;
794		};
795		vreg_l6a_1p2: l6 {
796			regulator-name = "vreg_l6a_1p2";
797			regulator-min-microvolt = <1200000>;
798			regulator-max-microvolt = <1200000>;
799		};
800		vreg_l8a_1p8: l8 {
801			regulator-name = "vreg_l8a_1p8";
802			regulator-min-microvolt = <1800000>;
803			regulator-max-microvolt = <1800000>;
804		};
805		vreg_l9a_1p8: l9 {
806			regulator-name = "vreg_l9a_1p8";
807			regulator-min-microvolt = <1800000>;
808			regulator-max-microvolt = <1800000>;
809		};
810		vreg_l10a_1p8: l10 {
811			regulator-name = "vreg_l10a_1p8";
812			regulator-min-microvolt = <1800000>;
813			regulator-max-microvolt = <1800000>;
814		};
815		vreg_l11a_1p15: l11 {
816			regulator-name = "vreg_l11a_1p15";
817			regulator-min-microvolt = <1150000>;
818			regulator-max-microvolt = <1150000>;
819		};
820		vreg_l12a_1p8: l12 {
821			regulator-name = "vreg_l12a_1p8";
822			regulator-min-microvolt = <1800000>;
823			regulator-max-microvolt = <1800000>;
824		};
825		vreg_l13a_2p95: l13 {
826			regulator-name = "vreg_l13a_2p95";
827			regulator-min-microvolt = <1800000>;
828			regulator-max-microvolt = <2950000>;
829		};
830		vreg_l14a_1p8: l14 {
831			regulator-name = "vreg_l14a_1p8";
832			regulator-min-microvolt = <1800000>;
833			regulator-max-microvolt = <1800000>;
834		};
835		vreg_l15a_1p8: l15 {
836			regulator-name = "vreg_l15a_1p8";
837			regulator-min-microvolt = <1800000>;
838			regulator-max-microvolt = <1800000>;
839		};
840		vreg_l16a_2p7: l16 {
841			regulator-name = "vreg_l16a_2p7";
842			regulator-min-microvolt = <2700000>;
843			regulator-max-microvolt = <2700000>;
844		};
845		vreg_l17a_2p8: l17 {
846			regulator-name = "vreg_l17a_2p8";
847			regulator-min-microvolt = <2500000>;
848			regulator-max-microvolt = <2500000>;
849		};
850		vreg_l18a_2p85: l18 {
851			regulator-name = "vreg_l18a_2p85";
852			regulator-min-microvolt = <2700000>;
853			regulator-max-microvolt = <2900000>;
854		};
855		vreg_l19a_2p8: l19 {
856			regulator-name = "vreg_l19a_2p8";
857			regulator-min-microvolt = <3000000>;
858			regulator-max-microvolt = <3000000>;
859		};
860		vreg_l20a_2p95: l20 {
861			regulator-name = "vreg_l20a_2p95";
862			regulator-min-microvolt = <2950000>;
863			regulator-max-microvolt = <2950000>;
864			regulator-allow-set-load;
865		};
866		vreg_l21a_2p95: l21 {
867			regulator-name = "vreg_l21a_2p95";
868			regulator-min-microvolt = <2950000>;
869			regulator-max-microvolt = <2950000>;
870			regulator-allow-set-load;
871			regulator-system-load = <200000>;
872		};
873		vreg_l22a_3p0: l22 {
874			regulator-name = "vreg_l22a_3p0";
875			regulator-min-microvolt = <3300000>;
876			regulator-max-microvolt = <3300000>;
877		};
878		vreg_l23a_2p8: l23 {
879			regulator-name = "vreg_l23a_2p8";
880			regulator-min-microvolt = <2800000>;
881			regulator-max-microvolt = <2800000>;
882		};
883		vreg_l24a_3p075: l24 {
884			regulator-name = "vreg_l24a_3p075";
885			regulator-min-microvolt = <3075000>;
886			regulator-max-microvolt = <3075000>;
887		};
888		vreg_l25a_1p2: l25 {
889			regulator-name = "vreg_l25a_1p2";
890			regulator-min-microvolt = <1200000>;
891			regulator-max-microvolt = <1200000>;
892			regulator-allow-set-load;
893		};
894		vreg_l26a_0p8: l27 {
895			regulator-name = "vreg_l26a_0p8";
896			regulator-min-microvolt = <1000000>;
897			regulator-max-microvolt = <1000000>;
898		};
899		vreg_l28a_0p925: l28 {
900			regulator-name = "vreg_l28a_0p925";
901			regulator-min-microvolt = <925000>;
902			regulator-max-microvolt = <925000>;
903			regulator-allow-set-load;
904		};
905		vreg_l29a_2p8: l29 {
906			regulator-name = "vreg_l29a_2p8";
907			regulator-min-microvolt = <2800000>;
908			regulator-max-microvolt = <2800000>;
909		};
910		vreg_l30a_1p8: l30 {
911			regulator-name = "vreg_l30a_1p8";
912			regulator-min-microvolt = <1800000>;
913			regulator-max-microvolt = <1800000>;
914		};
915		vreg_l32a_1p8: l32 {
916			regulator-name = "vreg_l32a_1p8";
917			regulator-min-microvolt = <1800000>;
918			regulator-max-microvolt = <1800000>;
919		};
920
921		vreg_lvs1a_1p8: lvs1 {
922			regulator-name = "vreg_lvs1a_1p8";
923		};
924
925		vreg_lvs2a_1p8: lvs2 {
926			regulator-name = "vreg_lvs2a_1p8";
927		};
928	};
929
930	regulators-1 {
931		compatible = "qcom,rpm-pmi8994-regulators";
932
933		vdd_s1-supply = <&vph_pwr>;
934		vdd_s2-supply = <&vph_pwr>;
935		vdd_s3-supply = <&vph_pwr>;
936		vdd_bst_byp-supply = <&vph_pwr>;
937
938		vph_pwr_bbyp: boost-bypass {
939			regulator-name = "vph_pwr_bbyp";
940			regulator-min-microvolt = <3300000>;
941			regulator-max-microvolt = <3300000>;
942		};
943
944		vreg_s1b_1p025: s1 {
945			regulator-name = "vreg_s1b_1p025";
946			regulator-min-microvolt = <1025000>;
947			regulator-max-microvolt = <1025000>;
948		};
949	};
950};
951
952&sdhc2 {
953	/* External SD card */
954	pinctrl-names = "default", "sleep";
955	pinctrl-0 = <&sdc2_state_on &sdc2_cd_on>;
956	pinctrl-1 = <&sdc2_state_off &sdc2_cd_off>;
957	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
958	vmmc-supply = <&vreg_l21a_2p95>;
959	vqmmc-supply = <&vreg_l13a_2p95>;
960	status = "okay";
961};
962
963&q6asmdai {
964	dai@0 {
965		reg = <0>;
966	};
967
968	dai@1 {
969		reg = <1>;
970	};
971
972	dai@2 {
973		reg = <2>;
974	};
975};
976
977&slim_msm {
978	status = "okay";
979
980	slim@1 {
981		reg = <1>;
982		#address-cells = <2>;
983		#size-cells = <0>;
984
985		tasha_ifd: tas-ifd@0,0 {
986			compatible = "slim217,1a0";
987			reg = <0 0>;
988		};
989
990		wcd9335: codec@1,0 {
991			compatible = "slim217,1a0";
992			reg = <1 0>;
993
994			clock-names = "mclk", "slimbus";
995			clocks = <&div1_mclk>,
996				 <&rpmcc RPM_SMD_BB_CLK1>;
997			interrupt-parent = <&tlmm>;
998			interrupts = <54 IRQ_TYPE_LEVEL_HIGH>,
999				     <53 IRQ_TYPE_LEVEL_HIGH>;
1000			interrupt-names = "intr1", "intr2";
1001			interrupt-controller;
1002			#interrupt-cells = <1>;
1003
1004			pinctrl-0 = <&cdc_reset_active &wcd_intr_default>;
1005			pinctrl-names = "default";
1006
1007			reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
1008			slim-ifc-dev = <&tasha_ifd>;
1009
1010			#sound-dai-cells = <1>;
1011
1012			vdd-buck-supply = <&vreg_s4a_1p8>;
1013			vdd-buck-sido-supply = <&vreg_s4a_1p8>;
1014			vdd-tx-supply = <&vreg_s4a_1p8>;
1015			vdd-rx-supply = <&vreg_s4a_1p8>;
1016			vdd-io-supply = <&vreg_s4a_1p8>;
1017		};
1018	};
1019};
1020
1021&sound {
1022	compatible = "qcom,apq8096-sndcard";
1023	model = "DB820c";
1024	audio-routing = "RX_BIAS", "MCLK",
1025		"MM_DL1",  "MultiMedia1 Playback",
1026		"MM_DL2",  "MultiMedia2 Playback",
1027		"MultiMedia3 Capture", "MM_UL3";
1028
1029	mm1-dai-link {
1030		link-name = "MultiMedia1";
1031		cpu {
1032			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
1033		};
1034	};
1035
1036	mm2-dai-link {
1037		link-name = "MultiMedia2";
1038		cpu {
1039			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
1040		};
1041	};
1042
1043	mm3-dai-link {
1044		link-name = "MultiMedia3";
1045		cpu {
1046			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
1047		};
1048	};
1049
1050	hdmi-dai-link {
1051		link-name = "HDMI";
1052		cpu {
1053			sound-dai = <&q6afedai HDMI_RX>;
1054		};
1055
1056		platform {
1057			sound-dai = <&q6routing>;
1058		};
1059
1060		codec {
1061			sound-dai = <&hdmi 0>;
1062		};
1063	};
1064
1065	slim-dai-link {
1066		link-name = "SLIM Playback";
1067		cpu {
1068			sound-dai = <&q6afedai SLIMBUS_6_RX>;
1069		};
1070
1071		platform {
1072			sound-dai = <&q6routing>;
1073		};
1074
1075		codec {
1076			sound-dai = <&wcd9335 AIF4_PB>;
1077		};
1078	};
1079
1080	slimcap-dai-link {
1081		link-name = "SLIM Capture";
1082		cpu {
1083			sound-dai = <&q6afedai SLIMBUS_0_TX>;
1084		};
1085
1086		platform {
1087			sound-dai = <&q6routing>;
1088		};
1089
1090		codec {
1091			sound-dai = <&wcd9335 AIF1_CAP>;
1092		};
1093	};
1094};
1095
1096&ufsphy {
1097	status = "okay";
1098
1099	vdda-phy-supply = <&vreg_l28a_0p925>;
1100	vdda-pll-supply = <&vreg_l12a_1p8>;
1101	vddp-ref-clk-supply = <&vreg_l25a_1p2>;
1102};
1103
1104&ufshc {
1105	status = "okay";
1106
1107	vcc-supply = <&vreg_l20a_2p95>;
1108	vccq-supply = <&vreg_l25a_1p2>;
1109	vccq2-supply = <&vreg_s4a_1p8>;
1110
1111	vcc-max-microamp = <600000>;
1112	vccq-max-microamp = <450000>;
1113	vccq2-max-microamp = <450000>;
1114};
1115
1116&usb2 {
1117	status = "okay";
1118	extcon = <&usb2_id>;
1119};
1120
1121&usb2_dwc3 {
1122	extcon = <&usb2_id>;
1123	dr_mode = "otg";
1124	maximum-speed = "high-speed";
1125};
1126
1127&usb3 {
1128	status = "okay";
1129	extcon = <&usb3_id>;
1130};
1131
1132&usb3_dwc3 {
1133	extcon = <&usb3_id>;
1134	dr_mode = "otg";
1135};
1136
1137&usb3phy {
1138	status = "okay";
1139
1140	vdda-phy-supply = <&vreg_l28a_0p925>;
1141	vdda-pll-supply = <&vreg_l12a_1p8>;
1142
1143};
1144
1145&venus {
1146	status = "okay";
1147};
1148