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&pm8953_resin {
53	status = "okay";
54	linux,code = <KEY_VOLUMEDOWN>;
55};
56
57&sdhc_1 {
58	status = "okay";
59	vmmc-supply = <&pm8953_l8>;
60	vqmmc-supply = <&pm8953_l5>;
61};
62
63&sdhc_2 {
64	status = "okay";
65	vmmc-supply = <&pm8953_l11>;
66	vqmmc-supply = <&pm8953_l12>;
67
68	cd-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
69};
70
71&rpm_requests {
72	pm8953-regulators {
73		compatible = "qcom,rpm-pm8953-regulators";
74
75		vdd_l1-supply = <&pm8953_s3>;
76		vdd_l2_l3-supply = <&pm8953_s3>;
77		vdd_l4_l5_l6_l7_l16_l19-supply = <&pm8953_s4>;
78		vdd_l8_l11_l12_l13_l14_l15-supply = <&vph_pwr>;
79		vdd_l9_l10_l17_l18_l22-supply = <&vph_pwr>;
80
81		pm8953_s3: s3 {
82			regulator-min-microvolt = <984000>;
83			regulator-max-microvolt = <1240000>;
84		};
85		pm8953_s4: s4 {
86			regulator-min-microvolt = <1036000>;
87			regulator-max-microvolt = <2040000>;
88		};
89		pm8953_s5: s5 {
90			regulator-min-microvolt = <1036000>;
91			regulator-max-microvolt = <2040000>;
92		};
93
94		pm8953_l1: l1 {
95			regulator-min-microvolt = <975000>;
96			regulator-max-microvolt = <1050000>;
97		};
98		pm8953_l2: l2 {
99			regulator-min-microvolt = <975000>;
100			regulator-max-microvolt = <1175000>;
101		};
102		pm8953_l3: l3 {
103			regulator-min-microvolt = <925000>;
104			regulator-max-microvolt = <925000>;
105		};
106		pm8953_l5: l5 {
107			regulator-min-microvolt = <1800000>;
108			regulator-max-microvolt = <1800000>;
109		};
110		pm8953_l6: l6 {
111			regulator-min-microvolt = <1800000>;
112			regulator-max-microvolt = <1800000>;
113		};
114		pm8953_l7: l7 {
115			regulator-min-microvolt = <1800000>;
116			regulator-max-microvolt = <1900000>;
117		};
118		pm8953_l8: l8 {
119			regulator-min-microvolt = <2900000>;
120			regulator-max-microvolt = <2900000>;
121		};
122		pm8953_l9: l9 {
123			regulator-min-microvolt = <3000000>;
124			regulator-max-microvolt = <3300000>;
125		};
126		pm8953_l10: l10 {
127			regulator-min-microvolt = <2800000>;
128			regulator-max-microvolt = <3000000>;
129		};
130		pm8953_l11: l11 {
131			regulator-min-microvolt = <2950000>;
132			regulator-max-microvolt = <2950000>;
133		};
134		pm8953_l12: l12 {
135			regulator-min-microvolt = <1800000>;
136			regulator-max-microvolt = <2950000>;
137		};
138		pm8953_l13: l13 {
139			regulator-min-microvolt = <3125000>;
140			regulator-max-microvolt = <3125000>;
141		};
142		pm8953_l16: l16 {
143			regulator-min-microvolt = <1800000>;
144			regulator-max-microvolt = <1800000>;
145		};
146		pm8953_l17: l17 {
147			regulator-min-microvolt = <2850000>;
148			regulator-max-microvolt = <2850000>;
149		};
150		pm8953_l19: l19 {
151			regulator-min-microvolt = <1200000>;
152			regulator-max-microvolt = <1350000>;
153		};
154		pm8953_l22: l22 {
155			regulator-min-microvolt = <2800000>;
156			regulator-max-microvolt = <2800000>;
157		};
158		pm8953_l23: l23 {
159			regulator-min-microvolt = <975000>;
160			regulator-max-microvolt = <1225000>;
161		};
162	};
163};
164
165&tlmm {
166	/*
167	 * 0-3: unused but protected by TZ
168	 * 135-138: fingerprint reader (SPI)
169	 */
170	gpio-reserved-ranges = <0 4>, <135 4>;
171};
172
173&uart_0 {
174	status = "okay";
175};
176
177&usb3 {
178	status = "okay";
179};
180
181&usb3_dwc3 {
182	dr_mode = "peripheral";
183};
184