1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Alec Su <ae40515@yahoo.com.tw>
4 */
5
6/dts-v1/;
7
8#include "msm8996pro.dtsi"
9#include "msm8996-xiaomi-common.dtsi"
10#include "pmi8996.dtsi"
11#include <dt-bindings/sound/qcom,q6afe.h>
12#include <dt-bindings/sound/qcom,q6asm.h>
13
14/ {
15	model = "Xiaomi Mi 5s Plus";
16	compatible = "xiaomi,natrium", "qcom,msm8996pro", "qcom,msm8996";
17	chassis-type = "handset";
18	qcom,msm-id = <305 0x10000>;
19	qcom,board-id = <47 0>;
20};
21
22&adsp_pil {
23	firmware-name = "qcom/msm8996/natrium/adsp.mbn";
24};
25
26&blsp2_i2c6 {
27	touchscreen@20 {
28		compatible = "syna,rmi4-i2c";
29		reg = <0x20>;
30		interrupt-parent = <&tlmm>;
31		interrupts = <125 IRQ_TYPE_LEVEL_LOW>;
32		vdd-supply = <&vdd_3v2_tp>;
33		syna,reset-delay-ms = <200>;
34		syna,startup-delay-ms = <5>;
35
36		pinctrl-names = "default", "sleep";
37		pinctrl-0 = <&touchscreen_default>;
38		pinctrl-1 = <&touchscreen_sleep>;
39	};
40};
41
42&dsi0 {
43	status = "okay";
44
45	vdda-supply = <&vreg_l2a_1p25>;
46	vcca-supply = <&vreg_l28a_0p925>;
47
48	pinctrl-names = "default", "sleep";
49	pinctrl-0 = <&mdss_dsi_default &mdss_te_default>;
50	pinctrl-1 = <&mdss_dsi_sleep &mdss_te_sleep>;
51
52	panel: panel@0 {
53		compatible = "jdi,fhd-r63452";
54		reg = <0>;
55		reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
56		backlight = <&pmi8994_wled>;
57
58		port {
59			panel_in: endpoint {
60				remote-endpoint = <&dsi0_out>;
61			};
62		};
63	};
64};
65
66&dsi0_out {
67	remote-endpoint = <&panel_in>;
68};
69
70&gpu {
71	zap-shader {
72		firmware-name = "qcom/msm8996/natrium/a530_zap.mbn";
73	};
74};
75
76&mss_pil {
77	firmware-name = "qcom/msm8996/natrium/mba.mbn",
78			"qcom/msm8996/natrium/modem.mbn";
79};
80
81&pmi8994_wled {
82	status = "okay";
83
84	qcom,enabled-strings = <0 1>;
85	qcom,switching-freq = <600>;
86};
87
88&q6asmdai {
89	dai@0 {
90		reg = <0>;
91	};
92
93	dai@1 {
94		reg = <1>;
95	};
96
97	dai@2 {
98		reg = <2>;
99	};
100};
101
102&slpi_pil {
103	firmware-name = "qcom/msm8996/natrium/slpi.mbn";
104};
105
106&sound {
107	compatible = "qcom,apq8096-sndcard";
108	model = "natrium";
109	audio-routing =	"RX_BIAS", "MCLK";
110
111	mm1-dai-link {
112		link-name = "MultiMedia1";
113		cpu {
114			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
115		};
116	};
117
118	mm2-dai-link {
119		link-name = "MultiMedia2";
120		cpu {
121			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
122		};
123	};
124
125	mm3-dai-link {
126		link-name = "MultiMedia3";
127		cpu {
128			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
129		};
130	};
131
132	slim-dai-link {
133		link-name = "SLIM Playback";
134		cpu {
135			sound-dai = <&q6afedai SLIMBUS_6_RX>;
136		};
137
138		platform {
139			sound-dai = <&q6routing>;
140		};
141
142		codec {
143			sound-dai = <&wcd9335 6>;
144		};
145	};
146
147	slimcap-dai-link {
148		link-name = "SLIM Capture";
149		cpu {
150			sound-dai = <&q6afedai SLIMBUS_0_TX>;
151		};
152
153		platform {
154			sound-dai = <&q6routing>;
155		};
156
157		codec {
158			sound-dai = <&wcd9335 1>;
159		};
160	};
161};
162
163&venus {
164	firmware-name = "qcom/msm8996/natrium/venus.mbn";
165};
166
167&rpm_requests {
168	regulators-0 {
169		vreg_l3a_0p875: l3 {
170			regulator-name = "vreg_l3a_0p875";
171			regulator-min-microvolt = <850000>;
172			regulator-max-microvolt = <1300000>;
173		};
174		vreg_l11a_1p1: l11 {
175			regulator-name = "vreg_l11a_1p1";
176			regulator-min-microvolt = <1100000>;
177			regulator-max-microvolt = <1100000>;
178		};
179		vreg_l17a_2p8: l17 {
180			regulator-name = "vreg_l17a_2p8";
181			regulator-min-microvolt = <2800000>;
182			regulator-max-microvolt = <2800000>;
183		};
184		vreg_l18a_2p8: l18 {
185			regulator-name = "vreg_l18a_2p8";
186			regulator-min-microvolt = <2800000>;
187			regulator-max-microvolt = <2800000>;
188		};
189		vreg_l29a_2p8: l29 {
190			regulator-name = "vreg_l29a_2p8";
191			regulator-min-microvolt = <2800000>;
192			regulator-max-microvolt = <2800000>;
193		};
194	};
195};
196
197&pm8994_gpios {
198	gpio-line-names =
199		"NC",			/* GPIO_1  */
200		"VOL_UP_N",		/* GPIO_2  */
201		"SPKR_ID",		/* GPIO_3  */
202		"PWM_HAPTICS",		/* GPIO_4  */
203		"INFARED_DRV",		/* GPIO_5  */
204		"NC",			/* GPIO_6  */
205		"KEYPAD_LED_EN_A",	/* GPIO_7  */
206		"WL_EN",		/* GPIO_8  */
207		"3P3_ENABLE",		/* GPIO_9  */
208		"NC",			/* GPIO_10 */
209		"NC",			/* GPIO_11 */
210		"NC",			/* GPIO_12 */
211		"NC",			/* GPIO_13 */
212		"NC",			/* GPIO_14 */
213		"DIVCLK1_CDC",		/* GPIO_15 */
214		"DIVCLK2_HAPTICS",	/* GPIO_16 */
215		"NC",			/* GPIO_17 */
216		"32KHz_CLK_IN",		/* GPIO_18 */
217		"BT_EN",		/* GPIO_19 */
218		"PMIC_SLB",		/* GPIO_20 */
219		"UIM_BATT_ALARM",	/* GPIO_21 */
220		"NC";			/* GPIO_22 */
221};
222
223&pm8994_mpps {
224	gpio-line-names =
225		"NC",			/* MPP_1 */
226		"CCI_TIMER1",		/* MPP_2 */
227		"PMIC_SLB",		/* MPP_3 */
228		"EXT_FET_WLED_PWR_EN_N",/* MPP_4 */
229		"NC",			/* MPP_5 */
230		"NC",			/* MPP_6 */
231		"NC",			/* MPP_7 */
232		"NC";			/* MPP_8 */
233};
234
235&pmi8994_gpios {
236	gpio-line-names =
237		"NC",			/* GPIO_1  */
238		"SPKR_PA_EN",		/* GPIO_2  */
239		"NC",			/* GPIO_3  */
240		"NC",			/* GPIO_4  */
241		"NC",			/* GPIO_5  */
242		"NC",			/* GPIO_6  */
243		"NC",			/* GPIO_7  */
244		"NC",			/* GPIO_8  */
245		"NC",			/* GPIO_9  */
246		"NC";			/* GPIO_10 */
247};
248
249&tlmm {
250	gpio-line-names =
251		"ESE_SPI_MOSI",		/* GPIO_0   */
252		"ESE_SPI_MISO",		/* GPIO_1   */
253		"NC",			/* GPIO_2   */
254		"ESE_SPI_CLK",		/* GPIO_3   */
255		"MSM_UART_TX",		/* GPIO_4   */
256		"MSM_UART_RX",		/* GPIO_5   */
257		"NFC_I2C_SDA",		/* GPIO_6   */
258		"NFC_I2C_SCL",		/* GPIO_7   */
259		"LCD0_RESET_N",		/* GPIO_8   */
260		"NFC_IRQ",		/* GPIO_9   */
261		"LCD_TE",		/* GPIO_10  */
262		"LCD_ID_DET1",		/* GPIO_11  */
263		"NFC_DISABLE",		/* GPIO_12  */
264		"CAM_MCLK0",		/* GPIO_13  */
265		"CAM_MCLK1",		/* GPIO_14  */
266		"CAM_MCLK2",		/* GPIO_15  */
267		"ESE_PWR_REQ",		/* GPIO_16  */
268		"CCI_I2C_SDA0",		/* GPIO_17  */
269		"CCI_I2C_SCL0",		/* GPIO_18  */
270		"CCI_I2C_SDA1",		/* GPIO_19  */
271		"CCI_I2C_SCL1",		/* GPIO_20  */
272		"NFC_DWL_REQ",		/* GPIO_21  */
273		"CCI_TIMER1",		/* GPIO_22  */
274		"WEBCAM1_RESET_N",	/* GPIO_23  */
275		"ESE_IRQ",		/* GPIO_24  */
276		"NC",			/* GPIO_25  */
277		"WEBCAM1_STANDBY",	/* GPIO_26  */
278		"NC",			/* GPIO_27  */
279		"NC",			/* GPIO_28  */
280		"NC",			/* GPIO_29  */
281		"CAM_VDD_1P2_EN_2",	/* GPIO_30  */
282		"CAM_RESET_0",		/* GPIO_31  */
283		"CAM_RESET_1",		/* GPIO_32  */
284		"NC",			/* GPIO_33  */
285		"NC",			/* GPIO_34  */
286		"PCI_E0_RST_N",		/* GPIO_35  */
287		"PCI_E0_CLKREQ_N",	/* GPIO_36  */
288		"PCI_E0_WAKE",		/* GPIO_37  */
289		"CHARGER_INT",		/* GPIO_38  */
290		"CHARGER_RESET",	/* GPIO_39  */
291		"NC",			/* GPIO_40  */
292		"QCA_UART_TXD",		/* GPIO_41  */
293		"QCA_UART_RXD",		/* GPIO_42  */
294		"QCA_UART_CTS",		/* GPIO_43  */
295		"QCA_UART_RTS",		/* GPIO_44  */
296		"MAWC_UART_TX",		/* GPIO_45  */
297		"MAWC_UART_RX",		/* GPIO_46  */
298		"NC",			/* GPIO_47  */
299		"NC",			/* GPIO_48  */
300		"NC",			/* GPIO_49  */
301		"FP_SPI_RST",		/* GPIO_50  */
302		"TYPEC_I2C_SDA",	/* GPIO_51  */
303		"TYPEC_I2C_SCL",	/* GPIO_52  */
304		"CODEC_INT2_N",		/* GPIO_53  */
305		"CODEC_INT1_N",		/* GPIO_54  */
306		"APPS_I2C7_SDA",	/* GPIO_55  */
307		"APPS_I2C7_SCL",	/* GPIO_56  */
308		"FORCE_USB_BOOT",	/* GPIO_57  */
309		"NC",			/* GPIO_58  */
310		"NC",			/* GPIO_59  */
311		"NC",			/* GPIO_60  */
312		"NC",			/* GPIO_61  */
313		"ESE_RSTN",		/* GPIO_62  */
314		"TYPEC_INT",		/* GPIO_63  */
315		"CODEC_RESET_N",	/* GPIO_64  */
316		"PCM_CLK",		/* GPIO_65  */
317		"PCM_SYNC",		/* GPIO_66  */
318		"PCM_DIN",		/* GPIO_67  */
319		"PCM_DOUT",		/* GPIO_68  */
320		"CDC_44K1_CLK",		/* GPIO_69  */
321		"SLIMBUS_CLK",		/* GPIO_70  */
322		"SLIMBUS_DATA0",	/* GPIO_71  */
323		"SLIMBUS_DATA1",	/* GPIO_72  */
324		"LDO_5V_IN_EN",		/* GPIO_73  */
325		"TYPEC_EN_N",		/* GPIO_74  */
326		"NC",			/* GPIO_75  */
327		"NC",			/* GPIO_76  */
328		"NC",			/* GPIO_77  */
329		"NC",			/* GPIO_78  */
330		"NC",			/* GPIO_79  */
331		"SENSOR_RESET_N",	/* GPIO_80  */
332		"FP_SPI_MOSI",		/* GPIO_81  */
333		"FP_SPI_MISO",		/* GPIO_82  */
334		"FP_SPI_CS_N",		/* GPIO_83  */
335		"FP_SPI_CLK",		/* GPIO_84  */
336		"NC",			/* GPIO_85  */
337		"CAM_VDD_1P2_EN",	/* GPIO_86  */
338		"MSM_TS_I2C_SDA",	/* GPIO_87  */
339		"MSM_TS_I2C_SCL",	/* GPIO_88  */
340		"TS_RESOUT_N",		/* GPIO_89  */
341		"ESE_SPI_CS_N",		/* GPIO_90  */
342		"NC",			/* GPIO_91  */
343		"CAM2_AVDD_EN",		/* GPIO_92  */
344		"CAM2_VCM_EN",		/* GPIO_93  */
345		"NC",			/* GPIO_94  */
346		"NC",			/* GPIO_95  */
347		"NC",			/* GPIO_96  */
348		"GRFC_0",		/* GPIO_97  */
349		"GRFC_1",		/* GPIO_98  */
350		"NC",			/* GPIO_99  */
351		"GRFC_3",		/* GPIO_100 */
352		"GRFC_4",		/* GPIO_101 */
353		"GRFC_5",		/* GPIO_102 */
354		"NC",			/* GPIO_103 */
355		"GRFC_7",		/* GPIO_104 */
356		"UIM2_DATA",		/* GPIO_105 */
357		"UIM2_CLK",		/* GPIO_106 */
358		"UIM2_RESET",		/* GPIO_107 */
359		"UIM2_PRESENT",		/* GPIO_108 */
360		"UIM1_DATA",		/* GPIO_109 */
361		"UIM1_CLK",		/* GPIO_110 */
362		"UIM1_RESET",		/* GPIO_111 */
363		"UIM1_PRESENT",		/* GPIO_112 */
364		"UIM_BATT_ALARM",	/* GPIO_113 */
365		"GRFC_8",		/* GPIO_114 */
366		"GRFC_9",		/* GPIO_115 */
367		"TX_GTR_THRES",		/* GPIO_116 */
368		"ACCEL_INT",		/* GPIO_117 */
369		"GYRO_INT",		/* GPIO_118 */
370		"COMPASS_INT",		/* GPIO_119 */
371		"PROXIMITY_INT_N",	/* GPIO_120 */
372		"FP_IRQ",		/* GPIO_121 */
373		"P_SENSE",		/* GPIO_122 */
374		"HALL_INTR2",		/* GPIO_123 */
375		"HALL_INTR1",		/* GPIO_124 */
376		"TS_INT_N",		/* GPIO_125 */
377		"NC",			/* GPIO_126 */
378		"GRFC_11",		/* GPIO_127 */
379		"NC",			/* GPIO_128 */
380		"EXT_GPS_LNA_EN",	/* GPIO_129 */
381		"NC",			/* GPIO_130 */
382		"LCD_ID_DET2",		/* GPIO_131 */
383		"LCD_TE2",		/* GPIO_132 */
384		"GRFC_14",		/* GPIO_133 */
385		"GSM_TX2_PHASE_D",	/* GPIO_134 */
386		"NC",			/* GPIO_135 */
387		"GRFC_15",		/* GPIO_136 */
388		"RFFE3_DATA",		/* GPIO_137 */
389		"RFFE3_CLK",		/* GPIO_138 */
390		"NC",			/* GPIO_139 */
391		"NC",			/* GPIO_140 */
392		"RFFE5_DATA",		/* GPIO_141 */
393		"RFFE5_CLK",		/* GPIO_142 */
394		"NC",			/* GPIO_143 */
395		"COEX_UART_TX",		/* GPIO_144 */
396		"COEX_UART_RX",		/* GPIO_145 */
397		"RFFE2_DATA",		/* GPIO_146 */
398		"RFFE2_CLK",		/* GPIO_147 */
399		"RFFE1_DATA",		/* GPIO_148 */
400		"RFFE1_CLK";		/* GPIO_149 */
401
402	touchscreen_default: touchscreen-default-state {
403		pins = "gpio89", "gpio125";
404		function = "gpio";
405		drive-strength = <10>;
406		bias-pull-up;
407	};
408
409	touchscreen_sleep: touchscreen-sleep-state {
410		pins = "gpio89", "gpio125";
411		function = "gpio";
412		drive-strength = <2>;
413		bias-disable;
414	};
415};
416