xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/apq8096-db820c.dts (revision 7ef62cebc2f965b0f640263e179276928885e33d)
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 {
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-gpios = <&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-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
514	vdda-supply = <&vreg_l28a_0p925>;
515};
516
517&pcie2 {
518	status = "okay";
519	perst-gpios = <&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-state {
559		pinconf {
560			pins = "gpio5";
561			function = PMIC_GPIO_FUNC_NORMAL;
562			output-low;
563			power-source = <2>; // PM8994_GPIO_S4, 1.8V
564		};
565	};
566
567	bt_en_gpios: bt-en-pios-state {
568		pinconf {
569			pins = "gpio19";
570			function = PMIC_GPIO_FUNC_NORMAL;
571			output-low;
572			power-source = <PM8994_GPIO_S4>; // 1.8V
573			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
574			bias-pull-down;
575		};
576	};
577
578	wlan_en_gpios: wlan-en-gpios-state {
579		pinconf {
580			pins = "gpio8";
581			function = PMIC_GPIO_FUNC_NORMAL;
582			output-low;
583			power-source = <PM8994_GPIO_S4>; // 1.8V
584			qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
585			bias-pull-down;
586		};
587	};
588
589	audio_mclk: clk-div1-state {
590		pinconf {
591			pins = "gpio15";
592			function = "func1";
593			power-source = <PM8994_GPIO_S4>; // 1.8V
594		};
595	};
596
597	volume_up_gpio: pm8996-gpio2-state {
598		pinconf {
599			pins = "gpio2";
600			function = "normal";
601			input-enable;
602			drive-push-pull;
603			bias-pull-up;
604			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
605			power-source = <PM8994_GPIO_S4>; // 1.8V
606		};
607	};
608
609	divclk4_pin_a: divclk4-state {
610		pinconf {
611			pins = "gpio18";
612			function = PMIC_GPIO_FUNC_FUNC2;
613
614			bias-disable;
615			power-source = <PM8994_GPIO_S4>;
616		};
617	};
618
619	usb3_vbus_det_gpio: pm8996-gpio22-state {
620		pinconf {
621			pins = "gpio22";
622			function = PMIC_GPIO_FUNC_NORMAL;
623			input-enable;
624			bias-pull-down;
625			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
626			power-source = <PM8994_GPIO_S4>; // 1.8V
627		};
628	};
629};
630
631&pm8994_mpps {
632	gpio-line-names =
633		"VDDPX_BIAS",
634		"WIFI_LED",
635		"NC",
636		"BT_LED",
637		"PM_MPP05",
638		"PM_MPP06",
639		"PM_MPP07",
640		"NC";
641};
642
643&pm8994_spmi_regulators {
644	qcom,saw-reg = <&saw3>;
645	vdd_s11-supply = <&vph_pwr>;
646
647	s9 {
648		qcom,saw-slave;
649	};
650	s10 {
651		qcom,saw-slave;
652	};
653	s11 {
654		qcom,saw-leader;
655		regulator-name = "VDD_APCC";
656		regulator-always-on;
657		regulator-min-microvolt = <980000>;
658		regulator-max-microvolt = <980000>;
659	};
660};
661
662&pmi8994_gpios {
663	gpio-line-names =
664		"NC",
665		"SPKR_AMP_EN1",
666		"SPKR_AMP_EN2",
667		"TP61",
668		"NC",
669		"USB2_VBUS_DET",
670		"NC",
671		"NC",
672		"NC",
673		"NC";
674
675	usb2_vbus_det_gpio: pmi8996-gpio6-state {
676		pinconf {
677			pins = "gpio6";
678			function = PMIC_GPIO_FUNC_NORMAL;
679			input-enable;
680			bias-pull-down;
681			qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
682			power-source = <PM8994_GPIO_S4>; // 1.8V
683		};
684	};
685};
686
687&pmi8994_lpg {
688	qcom,power-source = <1>;
689
690	pinctrl-names = "default";
691	pinctrl-0 = <&pmi8994_mpp2_userled4>;
692
693	qcom,dtest = <0 0>,
694		     <0 0>,
695		     <0 0>,
696		     <4 1>;
697
698	status = "okay";
699
700	led@1 {
701		reg = <1>;
702		color = <LED_COLOR_ID_GREEN>;
703		function = LED_FUNCTION_HEARTBEAT;
704		function-enumerator = <1>;
705
706		linux,default-trigger = "heartbeat";
707		default-state = "on";
708	};
709
710	led@2 {
711		reg = <2>;
712		color = <LED_COLOR_ID_GREEN>;
713		function = LED_FUNCTION_HEARTBEAT;
714		function-enumerator = <0>;
715	};
716
717	led@3 {
718		reg = <3>;
719		color = <LED_COLOR_ID_GREEN>;
720		function = LED_FUNCTION_HEARTBEAT;
721		function-enumerator = <2>;
722	};
723
724	led@4 {
725		reg = <4>;
726		color = <LED_COLOR_ID_GREEN>;
727		function = LED_FUNCTION_HEARTBEAT;
728		function-enumerator = <3>;
729	};
730};
731
732&pmi8994_mpps {
733	pmi8994_mpp2_userled4: mpp2-userled4-state {
734		pins = "mpp2";
735		function = "sink";
736
737		output-low;
738		qcom,dtest = <4>;
739	};
740};
741
742&pmi8994_spmi_regulators {
743	vdd_s2-supply = <&vph_pwr>;
744
745	vdd_gfx: s2@1700 {
746		reg = <0x1700 0x100>;
747		regulator-name = "VDD_GFX";
748		regulator-min-microvolt = <980000>;
749		regulator-max-microvolt = <980000>;
750	};
751};
752
753&rpm_requests {
754	pm8994-regulators {
755		compatible = "qcom,rpm-pm8994-regulators";
756
757		vdd_s1-supply = <&vph_pwr>;
758		vdd_s2-supply = <&vph_pwr>;
759		vdd_s3-supply = <&vph_pwr>;
760		vdd_s4-supply = <&vph_pwr>;
761		vdd_s5-supply = <&vph_pwr>;
762		vdd_s6-supply = <&vph_pwr>;
763		vdd_s7-supply = <&vph_pwr>;
764		vdd_s8-supply = <&vph_pwr>;
765		vdd_s9-supply = <&vph_pwr>;
766		vdd_s10-supply = <&vph_pwr>;
767		vdd_s11-supply = <&vph_pwr>;
768		vdd_s12-supply = <&vph_pwr>;
769		vdd_l1-supply = <&vreg_s1b_1p025>;
770		vdd_l2_l26_l28-supply = <&vreg_s3a_1p3>;
771		vdd_l3_l11-supply = <&vreg_s3a_1p3>;
772		vdd_l4_l27_l31-supply = <&vreg_s3a_1p3>;
773		vdd_l5_l7-supply = <&vreg_s5a_2p15>;
774		vdd_l6_l12_l32-supply = <&vreg_s5a_2p15>;
775		vdd_l8_l16_l30-supply = <&vph_pwr>;
776		vdd_l9_l10_l18_l22-supply = <&vph_pwr_bbyp>;
777		vdd_l13_l19_l23_l24-supply = <&vph_pwr_bbyp>;
778		vdd_l14_l15-supply = <&vreg_s5a_2p15>;
779		vdd_l17_l29-supply = <&vph_pwr_bbyp>;
780		vdd_l20_l21-supply = <&vph_pwr_bbyp>;
781		vdd_l25-supply = <&vreg_s3a_1p3>;
782		vdd_lvs1_2-supply = <&vreg_s4a_1p8>;
783
784		vreg_s3a_1p3: s3 {
785			regulator-name = "vreg_s3a_1p3";
786			regulator-min-microvolt = <1300000>;
787			regulator-max-microvolt = <1300000>;
788		};
789
790		/**
791		 * 1.8v required on LS expansion
792		 * for mezzanine boards
793		 */
794		vreg_s4a_1p8: s4 {
795			regulator-name = "vreg_s4a_1p8";
796			regulator-min-microvolt = <1800000>;
797			regulator-max-microvolt = <1800000>;
798			regulator-always-on;
799		};
800		vreg_s5a_2p15: s5 {
801			regulator-name = "vreg_s5a_2p15";
802			regulator-min-microvolt = <2150000>;
803			regulator-max-microvolt = <2150000>;
804		};
805		vreg_s7a_1p0: s7 {
806			regulator-name = "vreg_s7a_1p0";
807			regulator-min-microvolt = <800000>;
808			regulator-max-microvolt = <800000>;
809		};
810
811		vreg_l1a_1p0: l1 {
812			regulator-name = "vreg_l1a_1p0";
813			regulator-min-microvolt = <1000000>;
814			regulator-max-microvolt = <1000000>;
815		};
816		vreg_l2a_1p25: l2 {
817			regulator-name = "vreg_l2a_1p25";
818			regulator-min-microvolt = <1250000>;
819			regulator-max-microvolt = <1250000>;
820		};
821		vreg_l3a_0p875: l3 {
822			regulator-name = "vreg_l3a_0p875";
823			regulator-min-microvolt = <850000>;
824			regulator-max-microvolt = <850000>;
825		};
826		vreg_l4a_1p225: l4 {
827			regulator-name = "vreg_l4a_1p225";
828			regulator-min-microvolt = <1225000>;
829			regulator-max-microvolt = <1225000>;
830		};
831		vreg_l6a_1p2: l6 {
832			regulator-name = "vreg_l6a_1p2";
833			regulator-min-microvolt = <1200000>;
834			regulator-max-microvolt = <1200000>;
835		};
836		vreg_l8a_1p8: l8 {
837			regulator-name = "vreg_l8a_1p8";
838			regulator-min-microvolt = <1800000>;
839			regulator-max-microvolt = <1800000>;
840		};
841		vreg_l9a_1p8: l9 {
842			regulator-name = "vreg_l9a_1p8";
843			regulator-min-microvolt = <1800000>;
844			regulator-max-microvolt = <1800000>;
845		};
846		vreg_l10a_1p8: l10 {
847			regulator-name = "vreg_l10a_1p8";
848			regulator-min-microvolt = <1800000>;
849			regulator-max-microvolt = <1800000>;
850		};
851		vreg_l11a_1p15: l11 {
852			regulator-name = "vreg_l11a_1p15";
853			regulator-min-microvolt = <1150000>;
854			regulator-max-microvolt = <1150000>;
855		};
856		vreg_l12a_1p8: l12 {
857			regulator-name = "vreg_l12a_1p8";
858			regulator-min-microvolt = <1800000>;
859			regulator-max-microvolt = <1800000>;
860		};
861		vreg_l13a_2p95: l13 {
862			regulator-name = "vreg_l13a_2p95";
863			regulator-min-microvolt = <1800000>;
864			regulator-max-microvolt = <2950000>;
865		};
866		vreg_l14a_1p8: l14 {
867			regulator-name = "vreg_l14a_1p8";
868			regulator-min-microvolt = <1800000>;
869			regulator-max-microvolt = <1800000>;
870		};
871		vreg_l15a_1p8: l15 {
872			regulator-name = "vreg_l15a_1p8";
873			regulator-min-microvolt = <1800000>;
874			regulator-max-microvolt = <1800000>;
875		};
876		vreg_l16a_2p7: l16 {
877			regulator-name = "vreg_l16a_2p7";
878			regulator-min-microvolt = <2700000>;
879			regulator-max-microvolt = <2700000>;
880		};
881		vreg_l17a_2p8: l17 {
882			regulator-name = "vreg_l17a_2p8";
883			regulator-min-microvolt = <2500000>;
884			regulator-max-microvolt = <2500000>;
885		};
886		vreg_l18a_2p85: l18 {
887			regulator-name = "vreg_l18a_2p85";
888			regulator-min-microvolt = <2700000>;
889			regulator-max-microvolt = <2900000>;
890		};
891		vreg_l19a_2p8: l19 {
892			regulator-name = "vreg_l19a_2p8";
893			regulator-min-microvolt = <3000000>;
894			regulator-max-microvolt = <3000000>;
895		};
896		vreg_l20a_2p95: l20 {
897			regulator-name = "vreg_l20a_2p95";
898			regulator-min-microvolt = <2950000>;
899			regulator-max-microvolt = <2950000>;
900			regulator-allow-set-load;
901		};
902		vreg_l21a_2p95: l21 {
903			regulator-name = "vreg_l21a_2p95";
904			regulator-min-microvolt = <2950000>;
905			regulator-max-microvolt = <2950000>;
906			regulator-allow-set-load;
907			regulator-system-load = <200000>;
908		};
909		vreg_l22a_3p0: l22 {
910			regulator-name = "vreg_l22a_3p0";
911			regulator-min-microvolt = <3300000>;
912			regulator-max-microvolt = <3300000>;
913		};
914		vreg_l23a_2p8: l23 {
915			regulator-name = "vreg_l23a_2p8";
916			regulator-min-microvolt = <2800000>;
917			regulator-max-microvolt = <2800000>;
918		};
919		vreg_l24a_3p075: l24 {
920			regulator-name = "vreg_l24a_3p075";
921			regulator-min-microvolt = <3075000>;
922			regulator-max-microvolt = <3075000>;
923		};
924		vreg_l25a_1p2: l25 {
925			regulator-name = "vreg_l25a_1p2";
926			regulator-min-microvolt = <1200000>;
927			regulator-max-microvolt = <1200000>;
928			regulator-allow-set-load;
929		};
930		vreg_l26a_0p8: l27 {
931			regulator-name = "vreg_l26a_0p8";
932			regulator-min-microvolt = <1000000>;
933			regulator-max-microvolt = <1000000>;
934		};
935		vreg_l28a_0p925: l28 {
936			regulator-name = "vreg_l28a_0p925";
937			regulator-min-microvolt = <925000>;
938			regulator-max-microvolt = <925000>;
939			regulator-allow-set-load;
940		};
941		vreg_l29a_2p8: l29 {
942			regulator-name = "vreg_l29a_2p8";
943			regulator-min-microvolt = <2800000>;
944			regulator-max-microvolt = <2800000>;
945		};
946		vreg_l30a_1p8: l30 {
947			regulator-name = "vreg_l30a_1p8";
948			regulator-min-microvolt = <1800000>;
949			regulator-max-microvolt = <1800000>;
950		};
951		vreg_l32a_1p8: l32 {
952			regulator-name = "vreg_l32a_1p8";
953			regulator-min-microvolt = <1800000>;
954			regulator-max-microvolt = <1800000>;
955		};
956
957		vreg_lvs1a_1p8: lvs1 {
958			regulator-name = "vreg_lvs1a_1p8";
959		};
960
961		vreg_lvs2a_1p8: lvs2 {
962			regulator-name = "vreg_lvs2a_1p8";
963		};
964	};
965
966	pmi8994-regulators {
967		compatible = "qcom,rpm-pmi8994-regulators";
968
969		vdd_s1-supply = <&vph_pwr>;
970		vdd_s2-supply = <&vph_pwr>;
971		vdd_s3-supply = <&vph_pwr>;
972		vdd_bst_byp-supply = <&vph_pwr>;
973
974		vph_pwr_bbyp: boost-bypass {
975			regulator-name = "vph_pwr_bbyp";
976			regulator-min-microvolt = <3300000>;
977			regulator-max-microvolt = <3300000>;
978		};
979
980		vreg_s1b_1p025: s1 {
981			regulator-name = "vreg_s1b_1p025";
982			regulator-min-microvolt = <1025000>;
983			regulator-max-microvolt = <1025000>;
984		};
985	};
986};
987
988&sdhc2 {
989	/* External SD card */
990	pinctrl-names = "default", "sleep";
991	pinctrl-0 = <&sdc2_state_on &sdc2_cd_on>;
992	pinctrl-1 = <&sdc2_state_off &sdc2_cd_off>;
993	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
994	vmmc-supply = <&vreg_l21a_2p95>;
995	vqmmc-supply = <&vreg_l13a_2p95>;
996	status = "okay";
997};
998
999&q6asmdai {
1000	dai@0 {
1001		reg = <0>;
1002	};
1003
1004	dai@1 {
1005		reg = <1>;
1006	};
1007
1008	dai@2 {
1009		reg = <2>;
1010	};
1011};
1012
1013&sound {
1014	compatible = "qcom,apq8096-sndcard";
1015	model = "DB820c";
1016	audio-routing = "RX_BIAS", "MCLK",
1017		"MM_DL1",  "MultiMedia1 Playback",
1018		"MM_DL2",  "MultiMedia2 Playback",
1019		"MultiMedia3 Capture", "MM_UL3";
1020
1021	mm1-dai-link {
1022		link-name = "MultiMedia1";
1023		cpu {
1024			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
1025		};
1026	};
1027
1028	mm2-dai-link {
1029		link-name = "MultiMedia2";
1030		cpu {
1031			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
1032		};
1033	};
1034
1035	mm3-dai-link {
1036		link-name = "MultiMedia3";
1037		cpu {
1038			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
1039		};
1040	};
1041
1042	hdmi-dai-link {
1043		link-name = "HDMI";
1044		cpu {
1045			sound-dai = <&q6afedai HDMI_RX>;
1046		};
1047
1048		platform {
1049			sound-dai = <&q6routing>;
1050		};
1051
1052		codec {
1053			sound-dai = <&hdmi 0>;
1054		};
1055	};
1056
1057	slim-dai-link {
1058		link-name = "SLIM Playback";
1059		cpu {
1060			sound-dai = <&q6afedai SLIMBUS_6_RX>;
1061		};
1062
1063		platform {
1064			sound-dai = <&q6routing>;
1065	};
1066
1067		codec {
1068			sound-dai = <&wcd9335 AIF4_PB>;
1069		};
1070	};
1071
1072	slimcap-dai-link {
1073		link-name = "SLIM Capture";
1074		cpu {
1075			sound-dai = <&q6afedai SLIMBUS_0_TX>;
1076		};
1077
1078		platform {
1079			sound-dai = <&q6routing>;
1080		};
1081
1082		codec {
1083			sound-dai = <&wcd9335 AIF1_CAP>;
1084		};
1085	};
1086};
1087
1088&ufsphy {
1089	status = "okay";
1090
1091	vdda-phy-supply = <&vreg_l28a_0p925>;
1092	vdda-pll-supply = <&vreg_l12a_1p8>;
1093	vddp-ref-clk-supply = <&vreg_l25a_1p2>;
1094};
1095
1096&ufshc {
1097	status = "okay";
1098
1099	vcc-supply = <&vreg_l20a_2p95>;
1100	vccq-supply = <&vreg_l25a_1p2>;
1101	vccq2-supply = <&vreg_s4a_1p8>;
1102
1103	vcc-max-microamp = <600000>;
1104	vccq-max-microamp = <450000>;
1105	vccq2-max-microamp = <450000>;
1106};
1107
1108&usb2 {
1109	status = "okay";
1110	extcon = <&usb2_id>;
1111};
1112
1113&usb2_dwc3 {
1114	extcon = <&usb2_id>;
1115	dr_mode = "otg";
1116	maximum-speed = "high-speed";
1117};
1118
1119&usb3 {
1120	status = "okay";
1121	extcon = <&usb3_id>;
1122};
1123
1124&usb3_dwc3 {
1125	extcon = <&usb3_id>;
1126	dr_mode = "otg";
1127};
1128
1129&usb3phy {
1130	status = "okay";
1131
1132	vdda-phy-supply = <&vreg_l28a_0p925>;
1133	vdda-pll-supply = <&vreg_l12a_1p8>;
1134
1135};
1136
1137&venus {
1138	status = "okay";
1139};
1140
1141&wcd9335 {
1142	clock-names = "mclk", "slimbus";
1143	clocks = <&div1_mclk>,
1144		 <&rpmcc RPM_SMD_BB_CLK1>;
1145
1146	vdd-buck-supply = <&vreg_s4a_1p8>;
1147	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
1148	vdd-tx-supply = <&vreg_s4a_1p8>;
1149	vdd-rx-supply = <&vreg_s4a_1p8>;
1150	vdd-io-supply = <&vreg_s4a_1p8>;
1151};
1152