1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Luca Weiss <luca@z3ntu.xyz>
4 */
5/dts-v1/;
6
7#include "sdm632.dtsi"
8#include "pm8953.dtsi"
9
10/ {
11	model = "Fairphone 3";
12	compatible = "fairphone,fp3", "qcom,sdm632";
13	chassis-type = "handset";
14	qcom,msm-id = <349 0>;
15	qcom,board-id = <8 0x10000>;
16
17	aliases {
18		mmc0 = &sdhc_1;
19		mmc1 = &sdhc_2;
20		serial0 = &uart_0;
21	};
22
23	chosen {
24		stdout-path = "serial0:115200n8";
25	};
26
27	gpio-keys {
28		compatible = "gpio-keys";
29
30		key-volume-up {
31			label = "volume_up";
32			linux,code = <KEY_VOLUMEUP>;
33			gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
34		};
35	};
36
37	vph_pwr: vph-pwr-regulator {
38		compatible = "regulator-fixed";
39		regulator-name = "vph_pwr";
40		regulator-always-on;
41		regulator-boot-on;
42	};
43};
44
45&hsusb_phy {
46	status = "okay";
47	vdd-supply = <&pm8953_l3>;
48	vdda-pll-supply = <&pm8953_l7>;
49	vdda-phy-dpdm-supply = <&pm8953_l13>;
50};
51
52&i2c_3 {
53	status = "okay";
54
55	touchscreen@48 {
56		compatible = "himax,hx83112b";
57		reg = <0x48>;
58		interrupt-parent = <&tlmm>;
59		interrupts = <65 IRQ_TYPE_LEVEL_LOW>;
60		touchscreen-size-x = <1080>;
61		touchscreen-size-y = <2160>;
62		reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
63	};
64};
65
66&pm8953_resin {
67	status = "okay";
68	linux,code = <KEY_VOLUMEDOWN>;
69};
70
71&sdhc_1 {
72	status = "okay";
73	vmmc-supply = <&pm8953_l8>;
74	vqmmc-supply = <&pm8953_l5>;
75};
76
77&sdhc_2 {
78	status = "okay";
79	vmmc-supply = <&pm8953_l11>;
80	vqmmc-supply = <&pm8953_l12>;
81
82	cd-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
83};
84
85&rpm_requests {
86	regulators {
87		compatible = "qcom,rpm-pm8953-regulators";
88
89		vdd_l1-supply = <&pm8953_s3>;
90		vdd_l2_l3-supply = <&pm8953_s3>;
91		vdd_l4_l5_l6_l7_l16_l19-supply = <&pm8953_s4>;
92		vdd_l8_l11_l12_l13_l14_l15-supply = <&vph_pwr>;
93		vdd_l9_l10_l17_l18_l22-supply = <&vph_pwr>;
94
95		pm8953_s3: s3 {
96			regulator-min-microvolt = <984000>;
97			regulator-max-microvolt = <1240000>;
98		};
99		pm8953_s4: s4 {
100			regulator-min-microvolt = <1036000>;
101			regulator-max-microvolt = <2040000>;
102		};
103		pm8953_s5: s5 {
104			regulator-min-microvolt = <1036000>;
105			regulator-max-microvolt = <2040000>;
106		};
107
108		pm8953_l1: l1 {
109			regulator-min-microvolt = <975000>;
110			regulator-max-microvolt = <1050000>;
111		};
112		pm8953_l2: l2 {
113			regulator-min-microvolt = <975000>;
114			regulator-max-microvolt = <1175000>;
115		};
116		pm8953_l3: l3 {
117			regulator-min-microvolt = <925000>;
118			regulator-max-microvolt = <925000>;
119		};
120		pm8953_l5: l5 {
121			regulator-min-microvolt = <1800000>;
122			regulator-max-microvolt = <1800000>;
123		};
124		pm8953_l6: l6 {
125			regulator-min-microvolt = <1800000>;
126			regulator-max-microvolt = <1800000>;
127		};
128		pm8953_l7: l7 {
129			regulator-min-microvolt = <1800000>;
130			regulator-max-microvolt = <1900000>;
131		};
132		pm8953_l8: l8 {
133			regulator-min-microvolt = <2900000>;
134			regulator-max-microvolt = <2900000>;
135		};
136		pm8953_l9: l9 {
137			regulator-min-microvolt = <3000000>;
138			regulator-max-microvolt = <3300000>;
139		};
140		pm8953_l10: l10 {
141			regulator-min-microvolt = <2800000>;
142			regulator-max-microvolt = <3000000>;
143		};
144		pm8953_l11: l11 {
145			regulator-min-microvolt = <2950000>;
146			regulator-max-microvolt = <2950000>;
147		};
148		pm8953_l12: l12 {
149			regulator-min-microvolt = <1800000>;
150			regulator-max-microvolt = <2950000>;
151		};
152		pm8953_l13: l13 {
153			regulator-min-microvolt = <3125000>;
154			regulator-max-microvolt = <3125000>;
155		};
156		pm8953_l16: l16 {
157			regulator-min-microvolt = <1800000>;
158			regulator-max-microvolt = <1800000>;
159		};
160		pm8953_l17: l17 {
161			regulator-min-microvolt = <2850000>;
162			regulator-max-microvolt = <2850000>;
163		};
164		pm8953_l19: l19 {
165			regulator-min-microvolt = <1200000>;
166			regulator-max-microvolt = <1350000>;
167		};
168		pm8953_l22: l22 {
169			regulator-min-microvolt = <2800000>;
170			regulator-max-microvolt = <2800000>;
171		};
172		pm8953_l23: l23 {
173			regulator-min-microvolt = <975000>;
174			regulator-max-microvolt = <1225000>;
175		};
176	};
177};
178
179&tlmm {
180	/*
181	 * 0-3: unused but protected by TZ
182	 * 135-138: fingerprint reader (SPI)
183	 */
184	gpio-reserved-ranges = <0 4>, <135 4>;
185};
186
187&uart_0 {
188	status = "okay";
189};
190
191&usb3 {
192	status = "okay";
193};
194
195&usb3_dwc3 {
196	dr_mode = "peripheral";
197};
198