1// SPDX-License-Identifier: GPL-2.0
2#include "qcom-apq8064-v2.0.dtsi"
3#include <dt-bindings/gpio/gpio.h>
4#include <dt-bindings/input/input.h>
5#include <dt-bindings/mfd/qcom-rpm.h>
6#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
7
8/ {
9	model = "Sony Xperia Z";
10	compatible = "sony,xperia-yuga", "qcom,apq8064";
11	chassis-type = "handset";
12
13	aliases {
14		serial0 = &gsbi5_serial;
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	gpio-keys {
22		compatible = "gpio-keys";
23
24		pinctrl-names = "default";
25		pinctrl-0 = <&gpio_keys_pin_a>;
26
27		key-camera-focus {
28			label = "camera_focus";
29			gpios = <&pm8921_gpio 3 GPIO_ACTIVE_LOW>;
30			linux,input-type = <1>;
31			linux,code = <KEY_CAMERA_FOCUS>;
32		};
33
34		key-camera-snapshot {
35			label = "camera_snapshot";
36			gpios = <&pm8921_gpio 4 GPIO_ACTIVE_LOW>;
37			linux,input-type = <1>;
38			linux,code = <KEY_CAMERA>;
39		};
40
41		key-volume-down {
42			label = "volume_down";
43			gpios = <&pm8921_gpio 29 GPIO_ACTIVE_LOW>;
44			linux,input-type = <1>;
45			linux,code = <KEY_VOLUMEDOWN>;
46		};
47
48		key-volume-up {
49			label = "volume_up";
50			gpios = <&pm8921_gpio 35 GPIO_ACTIVE_LOW>;
51			linux,input-type = <1>;
52			linux,code = <KEY_VOLUMEUP>;
53		};
54	};
55};
56
57&gsbi5 {
58	qcom,mode = <GSBI_PROT_I2C_UART>;
59	status = "okay";
60};
61
62&gsbi5_serial {
63	pinctrl-names = "default";
64	pinctrl-0 = <&gsbi5_uart_pin_a>;
65	status = "okay";
66};
67
68&pm8921_gpio {
69	gpio_keys_pin_a: gpio-keys-active-state {
70		pins = "gpio3", "gpio4", "gpio29", "gpio35";
71		function = "normal";
72
73		bias-pull-up;
74		drive-push-pull;
75		input-enable;
76		power-source = <2>;
77		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
78		qcom,pull-up-strength = <0>;
79	};
80};
81
82&riva {
83	pinctrl-names = "default";
84	pinctrl-0 = <&riva_wlan_pin_a>, <&riva_bt_pin_a>, <&riva_fm_pin_a>;
85	status = "okay";
86};
87
88&rpm {
89	regulators {
90		vin_l1_l2_l12_l18-supply = <&pm8921_s4>;
91		vin_lvs_1_3_6-supply = <&pm8921_s4>;
92		vin_lvs_4_5_7-supply = <&pm8921_s4>;
93		vin_ncp-supply = <&pm8921_l6>;
94		vin_lvs2-supply = <&pm8921_s4>;
95		vin_l24-supply = <&pm8921_s1>;
96		vin_l25-supply = <&pm8921_s1>;
97		vin_l27-supply = <&pm8921_s7>;
98		vin_l28-supply = <&pm8921_s7>;
99
100		/* Buck SMPS */
101		s1 {
102			regulator-always-on;
103			regulator-min-microvolt = <1225000>;
104			regulator-max-microvolt = <1225000>;
105			qcom,switch-mode-frequency = <3200000>;
106			bias-pull-down;
107		};
108
109		s2 {
110			regulator-min-microvolt = <1300000>;
111			regulator-max-microvolt = <1300000>;
112			qcom,switch-mode-frequency = <1600000>;
113			bias-pull-down;
114		};
115
116		s3 {
117			regulator-min-microvolt = <500000>;
118			regulator-max-microvolt = <1150000>;
119			qcom,switch-mode-frequency = <4800000>;
120			bias-pull-down;
121		};
122
123		s4 {
124			regulator-always-on;
125			regulator-min-microvolt = <1800000>;
126			regulator-max-microvolt = <1800000>;
127			qcom,switch-mode-frequency = <1600000>;
128			bias-pull-down;
129			qcom,force-mode = <QCOM_RPM_FORCE_MODE_AUTO>;
130		};
131
132		s7 {
133			regulator-min-microvolt = <1300000>;
134			regulator-max-microvolt = <1300000>;
135			qcom,switch-mode-frequency = <3200000>;
136		};
137
138		s8 {
139			regulator-min-microvolt = <2200000>;
140			regulator-max-microvolt = <2200000>;
141			qcom,switch-mode-frequency = <1600000>;
142		};
143
144		/* PMOS LDO */
145		l1 {
146			regulator-always-on;
147			regulator-min-microvolt = <1100000>;
148			regulator-max-microvolt = <1100000>;
149			bias-pull-down;
150		};
151
152		l2 {
153			regulator-min-microvolt = <1200000>;
154			regulator-max-microvolt = <1200000>;
155			bias-pull-down;
156		};
157
158		l3 {
159			regulator-min-microvolt = <3075000>;
160			regulator-max-microvolt = <3075000>;
161			bias-pull-down;
162		};
163
164		l4 {
165			regulator-always-on;
166			regulator-min-microvolt = <1800000>;
167			regulator-max-microvolt = <1800000>;
168			bias-pull-down;
169		};
170
171		l5 {
172			regulator-min-microvolt = <2950000>;
173			regulator-max-microvolt = <2950000>;
174			bias-pull-down;
175		};
176
177		l6 {
178			regulator-min-microvolt = <2950000>;
179			regulator-max-microvolt = <2950000>;
180			bias-pull-down;
181		};
182
183		l7 {
184			regulator-min-microvolt = <1850000>;
185			regulator-max-microvolt = <2950000>;
186			bias-pull-down;
187		};
188
189		l8 {
190			regulator-min-microvolt = <2800000>;
191			regulator-max-microvolt = <2800000>;
192			bias-pull-down;
193		};
194
195		l9 {
196			regulator-min-microvolt = <3000000>;
197			regulator-max-microvolt = <3000000>;
198			bias-pull-down;
199		};
200
201		l10 {
202			regulator-min-microvolt = <2900000>;
203			regulator-max-microvolt = <2900000>;
204			bias-pull-down;
205		};
206
207		l11 {
208			regulator-min-microvolt = <3000000>;
209			regulator-max-microvolt = <3000000>;
210			bias-pull-down;
211		};
212
213		l12 {
214			regulator-min-microvolt = <1200000>;
215			regulator-max-microvolt = <1200000>;
216			bias-pull-down;
217		};
218
219		l14 {
220			regulator-min-microvolt = <1800000>;
221			regulator-max-microvolt = <1800000>;
222			bias-pull-down;
223		};
224
225		l15 {
226			regulator-min-microvolt = <1800000>;
227			regulator-max-microvolt = <2950000>;
228			bias-pull-down;
229		};
230
231		l16 {
232			regulator-min-microvolt = <2800000>;
233			regulator-max-microvolt = <2800000>;
234			bias-pull-down;
235		};
236
237		l17 {
238			regulator-min-microvolt = <2000000>;
239			regulator-max-microvolt = <2000000>;
240			bias-pull-down;
241		};
242
243		l18 {
244			regulator-min-microvolt = <1200000>;
245			regulator-max-microvolt = <1200000>;
246			bias-pull-down;
247		};
248
249		l21 {
250			regulator-min-microvolt = <1050000>;
251			regulator-max-microvolt = <1050000>;
252			bias-pull-down;
253		};
254
255		l22 {
256			regulator-min-microvolt = <2600000>;
257			regulator-max-microvolt = <2600000>;
258			bias-pull-down;
259		};
260
261		l23 {
262			regulator-min-microvolt = <1800000>;
263			regulator-max-microvolt = <1800000>;
264			bias-pull-down;
265		};
266
267		l24 {
268			regulator-min-microvolt = <750000>;
269			regulator-max-microvolt = <1150000>;
270			bias-pull-down;
271		};
272
273		l25 {
274			regulator-always-on;
275			regulator-min-microvolt = <1250000>;
276			regulator-max-microvolt = <1250000>;
277			bias-pull-down;
278		};
279
280		l27 {
281			regulator-min-microvolt = <1100000>;
282			regulator-max-microvolt = <1100000>;
283		};
284
285		l28 {
286			regulator-min-microvolt = <1050000>;
287			regulator-max-microvolt = <1050000>;
288			bias-pull-down;
289		};
290
291		l29 {
292			regulator-min-microvolt = <2000000>;
293			regulator-max-microvolt = <2000000>;
294			bias-pull-down;
295		};
296
297		/* Low Voltage Switch */
298		lvs1 {
299			bias-pull-down;
300		};
301
302		lvs2 {
303			bias-pull-down;
304		};
305
306		lvs3 {
307			bias-pull-down;
308		};
309
310		lvs4 {
311			bias-pull-down;
312		};
313
314		lvs5 {
315			bias-pull-down;
316		};
317
318		lvs6 {
319			bias-pull-down;
320		};
321
322		lvs7 {
323			bias-pull-down;
324		};
325
326		usb-switch {};
327
328		hdmi-switch {};
329
330		ncp {
331			regulator-min-microvolt = <1800000>;
332			regulator-max-microvolt = <1800000>;
333			qcom,switch-mode-frequency = <1600000>;
334		};
335	};
336};
337
338&sdcc1 {
339	vmmc-supply = <&pm8921_l5>;
340	vqmmc-supply = <&pm8921_s4>;
341	status = "okay";
342};
343
344&sdcc3 {
345	vmmc-supply = <&pm8921_l6>;
346	cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
347
348	pinctrl-names = "default";
349	pinctrl-0 = <&sdcc3_pins>, <&sdcc3_cd_pin_a>;
350
351	status = "okay";
352};
353
354&tlmm_pinmux {
355	gsbi5_uart_pin_a: gsbi5-uart-pin-active {
356		rx {
357			pins = "gpio52";
358			function = "gsbi5";
359			drive-strength = <2>;
360			bias-pull-up;
361		};
362
363		tx {
364			pins = "gpio51";
365			function = "gsbi5";
366			drive-strength = <4>;
367			bias-disable;
368		};
369	};
370
371
372	sdcc3_cd_pin_a: sdcc3-cd-pin-active {
373		pins = "gpio26";
374		function = "gpio";
375
376		drive-strength = <2>;
377		bias-disable;
378	};
379};
380
381&usb_hs1_phy {
382	v3p3-supply = <&pm8921_l3>;
383	v1p8-supply = <&pm8921_l4>;
384};
385
386&usb1 {
387	dr_mode = "otg";
388	status = "okay";
389};
390