1// SPDX-License-Identifier: GPL-2.0
2#include "qcom-msm8974pro.dtsi"
3#include "pm8841.dtsi"
4#include "pm8941.dtsi"
5#include <dt-bindings/input/input.h>
6#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
7
8/ {
9	model = "OnePlus One";
10	compatible = "oneplus,bacon", "qcom,msm8974pro", "qcom,msm8974";
11	chassis-type = "handset";
12	qcom,msm-id = <194 0x10000>;
13	qcom,board-id = <8 0>;
14
15	aliases {
16		serial0 = &blsp1_uart2;
17	};
18
19	chosen {
20		stdout-path = "serial0:115200n8";
21	};
22
23	gpio-keys {
24		compatible = "gpio-keys";
25
26		pinctrl-0 = <&gpio_keys_default>, <&gpio_hall_sensor_default>;
27		pinctrl-names = "default";
28
29		key-volume-down {
30			label = "Volume Down";
31			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
32			linux,code = <KEY_VOLUMEDOWN>;
33			wakeup-source;
34			debounce-interval = <15>;
35		};
36
37		key-volume-up {
38			label = "Volume Up";
39			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
40			linux,code = <KEY_VOLUMEUP>;
41			wakeup-source;
42			debounce-interval = <15>;
43		};
44
45		event-hall-sensor {
46			label = "Hall Effect Sensor";
47			gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
48			linux,input-type = <EV_SW>;
49			linux,code = <SW_LID>;
50			linux,can-disable;
51			debounce-interval = <150>;
52		};
53	};
54
55	vreg_boost: vreg-boost {
56		compatible = "regulator-fixed";
57
58		regulator-name = "vreg-boost";
59		regulator-min-microvolt = <3150000>;
60		regulator-max-microvolt = <3150000>;
61
62		regulator-always-on;
63		regulator-boot-on;
64
65		gpio = <&pm8941_gpios 21 GPIO_ACTIVE_HIGH>;
66		enable-active-high;
67
68		pinctrl-names = "default";
69		pinctrl-0 = <&boost_bypass_n_pin>;
70	};
71
72	vreg_vph_pwr: vreg-vph-pwr {
73		compatible = "regulator-fixed";
74		regulator-name = "vph-pwr";
75
76		regulator-min-microvolt = <3600000>;
77		regulator-max-microvolt = <3600000>;
78
79		regulator-always-on;
80	};
81};
82
83&blsp1_i2c1 {
84	status = "okay";
85
86	fuel-gauge@55 {
87		compatible = "ti,bq27541";
88		reg = <0x55>;
89		power-supplies = <&bq24196_charger>;
90	};
91};
92
93&blsp1_i2c2 {
94	status = "okay";
95
96	rmi4-i2c-dev@20 {
97		compatible = "syna,rmi4-i2c";
98		reg = <0x20>;
99
100		syna,startup-delay-ms = <100>;
101
102		interrupts-extended = <&tlmm 61 IRQ_TYPE_EDGE_FALLING>;
103		vdd-supply = <&pm8941_l22>;
104		vio-supply = <&pm8941_lvs3>;
105
106		pinctrl-names = "default";
107		pinctrl-0 = <&touch_default_state>;
108
109		#address-cells = <1>;
110		#size-cells = <0>;
111
112		rmi4-f01@1 {
113			reg = <0x1>;
114			syna,nosleep-mode = <1>;
115		};
116
117		rmi4-f12@12 {
118			reg = <0x12>;
119			syna,sensor-type = <1>;
120			/*
121			 * Touchscreen size is 2040x1080, y-values between
122			 * 1920-2040 are used for touchkey (menu, home & back).
123			 * For now clip it off so we don't get touch events
124			 * outside of the display area.
125			 */
126			syna,clip-y-high = <1920>;
127		};
128	};
129
130	led-controller@36 {
131		compatible = "ti,lm3630a";
132		reg = <0x36>;
133
134		#address-cells = <1>;
135		#size-cells = <0>;
136
137		led@0 {
138			reg = <0>;
139			led-sources = <0 1>;
140			label = "lcd-backlight";
141			default-brightness = <80>;
142		};
143	};
144
145	led-controller@68 {
146		compatible = "si-en,sn3193";
147		reg = <0x68>;
148
149		shutdown-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
150
151		#address-cells = <1>;
152		#size-cells = <0>;
153
154		led@1 {
155			reg = <1>;
156			label = "red:status";
157			led-max-microamp = <17500>;
158		};
159
160		led@2 {
161			reg = <2>;
162			label = "green:status";
163			led-max-microamp = <17500>;
164		};
165
166		led@3 {
167			reg = <3>;
168			label = "blue:status";
169			led-max-microamp = <17500>;
170		};
171	};
172};
173
174&blsp1_i2c6 {
175	status = "okay";
176
177	bq24196_charger: charger@6b {
178		compatible = "ti,bq24196";
179		reg = <0x6b>;
180		interrupts-extended = <&tlmm 31 IRQ_TYPE_EDGE_FALLING>;
181		omit-battery-class;
182	};
183};
184
185&blsp1_uart2 {
186	status = "okay";
187};
188
189&gcc {
190	compatible = "qcom,gcc-msm8974pro-ac";
191};
192
193&pm8941_coincell {
194	qcom,rset-ohms = <800>;
195	qcom,vset-millivolts = <3200>;
196
197	status = "okay";
198};
199
200&pm8941_gpios {
201	gpio_keys_default: gpio-keys-active-state {
202		pins = "gpio2", "gpio5";
203		function = "normal";
204		input-enable;
205		bias-disable;
206		power-source = <PM8941_GPIO_S3>;
207	};
208};
209
210&pm8941_vib {
211	status = "okay";
212};
213
214&pronto {
215	vddmx-supply = <&pm8841_s1>;
216	vddcx-supply = <&pm8841_s2>;
217	vddpx-supply = <&pm8941_s3>;
218
219	pinctrl-names = "default";
220	pinctrl-0 = <&wcnss_pin_a>;
221
222	status = "okay";
223
224	iris {
225		vddxo-supply = <&pm8941_l6>;
226		vddrfa-supply = <&pm8941_l11>;
227		vddpa-supply = <&pm8941_l19>;
228		vdddig-supply = <&pm8941_s3>;
229	};
230
231	smd-edge {
232		qcom,remote-pid = <4>;
233		label = "pronto";
234
235		wcnss {
236			status = "okay";
237		};
238	};
239};
240
241&remoteproc_adsp {
242	cx-supply = <&pm8841_s2>;
243
244	status = "okay";
245};
246
247&rpm_requests {
248	regulators-0 {
249		compatible = "qcom,rpm-pm8841-regulators";
250
251		pm8841_s1: s1 {
252			regulator-min-microvolt = <675000>;
253			regulator-max-microvolt = <1050000>;
254		};
255
256		pm8841_s2: s2 {
257			regulator-min-microvolt = <875000>;
258			regulator-max-microvolt = <1050000>;
259			regulator-always-on;
260		};
261
262		pm8841_s3: s3 {
263			regulator-min-microvolt = <1050000>;
264			regulator-max-microvolt = <1050000>;
265		};
266	};
267
268	regulators-1 {
269		compatible = "qcom,rpm-pm8941-regulators";
270
271		vdd_l1_l3-supply = <&pm8941_s1>;
272		vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
273		vdd_l4_l11-supply = <&pm8941_s1>;
274		vdd_l5_l7-supply = <&pm8941_s2>;
275		vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
276		vdd_l8_l16_l18_l19-supply = <&vreg_vph_pwr>;
277		vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
278		vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
279		vdd_l21-supply = <&vreg_boost>;
280
281		pm8941_s1: s1 {
282			regulator-min-microvolt = <1300000>;
283			regulator-max-microvolt = <1300000>;
284
285			regulator-always-on;
286			regulator-boot-on;
287		};
288
289		pm8941_s2: s2 {
290			regulator-min-microvolt = <2150000>;
291			regulator-max-microvolt = <2150000>;
292
293			regulator-boot-on;
294		};
295
296		pm8941_s3: s3 {
297			regulator-min-microvolt = <1800000>;
298			regulator-max-microvolt = <1800000>;
299			regulator-system-load = <154000>;
300
301			regulator-always-on;
302			regulator-boot-on;
303			regulator-allow-set-load;
304		};
305
306		pm8941_l1: l1 {
307			regulator-min-microvolt = <1225000>;
308			regulator-max-microvolt = <1225000>;
309
310			regulator-always-on;
311			regulator-boot-on;
312		};
313
314		pm8941_l2: l2 {
315			regulator-min-microvolt = <1200000>;
316			regulator-max-microvolt = <1200000>;
317		};
318
319		pm8941_l3: l3 {
320			regulator-min-microvolt = <1225000>;
321			regulator-max-microvolt = <1225000>;
322		};
323
324		pm8941_l4: l4 {
325			regulator-min-microvolt = <1225000>;
326			regulator-max-microvolt = <1225000>;
327		};
328
329		pm8941_l5: l5 {
330			regulator-min-microvolt = <1800000>;
331			regulator-max-microvolt = <1800000>;
332		};
333
334		pm8941_l6: l6 {
335			regulator-min-microvolt = <1800000>;
336			regulator-max-microvolt = <1800000>;
337
338			regulator-boot-on;
339		};
340
341		pm8941_l7: l7 {
342			regulator-min-microvolt = <1800000>;
343			regulator-max-microvolt = <1800000>;
344
345			regulator-boot-on;
346		};
347
348		pm8941_l8: l8 {
349			regulator-min-microvolt = <1800000>;
350			regulator-max-microvolt = <1800000>;
351		};
352
353		pm8941_l9: l9 {
354			regulator-min-microvolt = <1800000>;
355			regulator-max-microvolt = <2950000>;
356		};
357
358		pm8941_l10: l10 {
359			regulator-min-microvolt = <1800000>;
360			regulator-max-microvolt = <2950000>;
361		};
362
363		pm8941_l11: l11 {
364			regulator-min-microvolt = <1225000>;
365			regulator-max-microvolt = <1350000>;
366		};
367
368		pm8941_l12: l12 {
369			regulator-min-microvolt = <1800000>;
370			regulator-max-microvolt = <1800000>;
371
372			regulator-always-on;
373			regulator-boot-on;
374			regulator-allow-set-load;
375		};
376
377		pm8941_l13: l13 {
378			regulator-min-microvolt = <1800000>;
379			regulator-max-microvolt = <2950000>;
380
381			regulator-boot-on;
382		};
383
384		pm8941_l14: l14 {
385			regulator-min-microvolt = <1800000>;
386			regulator-max-microvolt = <1800000>;
387		};
388
389		pm8941_l15: l15 {
390			regulator-min-microvolt = <2050000>;
391			regulator-max-microvolt = <2050000>;
392		};
393
394		pm8941_l16: l16 {
395			regulator-min-microvolt = <2700000>;
396			regulator-max-microvolt = <2700000>;
397		};
398
399		pm8941_l17: l17 {
400			regulator-min-microvolt = <2850000>;
401			regulator-max-microvolt = <2850000>;
402		};
403
404		pm8941_l18: l18 {
405			regulator-min-microvolt = <2850000>;
406			regulator-max-microvolt = <2850000>;
407		};
408
409		pm8941_l19: l19 {
410			regulator-min-microvolt = <2900000>;
411			regulator-max-microvolt = <3350000>;
412		};
413
414		pm8941_l20: l20 {
415			regulator-min-microvolt = <2950000>;
416			regulator-max-microvolt = <2950000>;
417
418			regulator-system-load = <200000>;
419			regulator-allow-set-load;
420			regulator-boot-on;
421		};
422
423		pm8941_l21: l21 {
424			regulator-min-microvolt = <2950000>;
425			regulator-max-microvolt = <2950000>;
426
427			regulator-boot-on;
428		};
429
430		pm8941_l22: l22 {
431			regulator-min-microvolt = <3000000>;
432			regulator-max-microvolt = <3000000>;
433			regulator-allow-set-load;
434		};
435
436		pm8941_l23: l23 {
437			regulator-min-microvolt = <3000000>;
438			regulator-max-microvolt = <3000000>;
439		};
440
441		pm8941_l24: l24 {
442			regulator-min-microvolt = <3075000>;
443			regulator-max-microvolt = <3075000>;
444
445			regulator-boot-on;
446		};
447
448		pm8941_lvs3: lvs3 {};
449	};
450};
451
452&sdhc_1 {
453	vmmc-supply = <&pm8941_l20>;
454	vqmmc-supply = <&pm8941_s3>;
455
456	pinctrl-names = "default", "sleep";
457	pinctrl-0 = <&sdc1_on>;
458	pinctrl-1 = <&sdc1_off>;
459
460	status = "okay";
461};
462
463&smbb {
464	status = "okay";
465};
466
467&tlmm {
468	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
469		pins = "gpio68";
470		function = "gpio";
471		drive-strength = <8>;
472		bias-pull-up;
473	};
474
475	sdc1_on: sdc1-on-state {
476		clk-pins {
477			pins = "sdc1_clk";
478			drive-strength = <4>;
479			bias-disable;
480		};
481
482		cmd-data-pins {
483			pins = "sdc1_cmd", "sdc1_data";
484			drive-strength = <4>;
485			bias-pull-up;
486		};
487	};
488
489	touch_default_state: touch-default-state {
490		int-pins {
491			pins = "gpio61";
492			function = "gpio";
493			drive-strength = <2>;
494			bias-disable;
495		};
496
497		reset-pins {
498			pins = "gpio60";
499			function = "gpio";
500			drive-strength = <2>;
501			bias-pull-up;
502		};
503	};
504
505	wcnss_pin_a: wcnss-pin-active-state {
506		wlan-pins {
507			pins = "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
508			function = "wlan";
509			drive-strength = <6>;
510			bias-pull-down;
511		};
512
513		bt-pins {
514			pins = "gpio35", "gpio43", "gpio44";
515			function = "bt";
516			drive-strength = <2>;
517			bias-pull-down;
518		};
519	};
520};
521
522&usb {
523	phys = <&usb_hs1_phy>;
524	phy-select = <&tcsr 0xb000 0>;
525	extcon = <&smbb>, <&usb_id>;
526	vbus-supply = <&chg_otg>;
527
528	hnp-disable;
529	srp-disable;
530	adp-disable;
531
532	status = "okay";
533};
534
535&usb_hs1_phy {
536	status = "okay";
537
538	v1p8-supply = <&pm8941_l6>;
539	v3p3-supply = <&pm8941_l24>;
540
541	extcon = <&smbb>;
542	qcom,init-seq = /bits/ 8 <0x1 0x64>;
543};
544