xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/pm660.dtsi (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
1c66ec88fSEmmanuel Vadot// SPDX-License-Identifier: BSD-3-Clause
2c66ec88fSEmmanuel Vadot/*
3c66ec88fSEmmanuel Vadot * Copyright (c) 2020, Konrad Dybcio
4c66ec88fSEmmanuel Vadot */
5c66ec88fSEmmanuel Vadot
6354d7675SEmmanuel Vadot#include <dt-bindings/iio/qcom,spmi-vadc.h>
7c66ec88fSEmmanuel Vadot#include <dt-bindings/input/linux-event-codes.h>
8c66ec88fSEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h>
9c66ec88fSEmmanuel Vadot#include <dt-bindings/spmi/spmi.h>
10354d7675SEmmanuel Vadot#include <dt-bindings/thermal/thermal.h>
11354d7675SEmmanuel Vadot
12354d7675SEmmanuel Vadot/ {
13354d7675SEmmanuel Vadot	thermal-zones {
14fac71e4eSEmmanuel Vadot		pm660-thermal {
15354d7675SEmmanuel Vadot			polling-delay-passive = <250>;
16354d7675SEmmanuel Vadot
17354d7675SEmmanuel Vadot			thermal-sensors = <&pm660_temp>;
18354d7675SEmmanuel Vadot
19354d7675SEmmanuel Vadot			trips {
20354d7675SEmmanuel Vadot				pm660_alert0: pm660-alert0 {
21354d7675SEmmanuel Vadot					temperature = <95000>;
22354d7675SEmmanuel Vadot					hysteresis = <2000>;
23354d7675SEmmanuel Vadot					type = "passive";
24354d7675SEmmanuel Vadot				};
25354d7675SEmmanuel Vadot				pm660_crit: pm660-crit {
26354d7675SEmmanuel Vadot					temperature = <125000>;
27354d7675SEmmanuel Vadot					hysteresis = <2000>;
28354d7675SEmmanuel Vadot					type = "critical";
29354d7675SEmmanuel Vadot				};
30354d7675SEmmanuel Vadot			};
31354d7675SEmmanuel Vadot		};
32354d7675SEmmanuel Vadot	};
33354d7675SEmmanuel Vadot};
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot&spmi_bus {
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot	pmic@0 {
38c66ec88fSEmmanuel Vadot		compatible = "qcom,pm660", "qcom,spmi-pmic";
39c66ec88fSEmmanuel Vadot		reg = <0x0 SPMI_USID>;
40c66ec88fSEmmanuel Vadot		#address-cells = <1>;
41c66ec88fSEmmanuel Vadot		#size-cells = <0>;
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot		rtc@6000 {
44c66ec88fSEmmanuel Vadot			compatible = "qcom,pm8941-rtc";
45c66ec88fSEmmanuel Vadot			reg = <0x6000>, <0x6100>;
46c66ec88fSEmmanuel Vadot			reg-names = "rtc", "alarm";
47c66ec88fSEmmanuel Vadot			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
48c66ec88fSEmmanuel Vadot		};
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot		pon: pon@800 {
518cc087a1SEmmanuel Vadot			compatible = "qcom,pm8998-pon";
52c66ec88fSEmmanuel Vadot			reg = <0x800>;
538cc087a1SEmmanuel Vadot			mode-bootloader = <0x2>;
548cc087a1SEmmanuel Vadot			mode-recovery = <0x1>;
55c66ec88fSEmmanuel Vadot
56e67e8565SEmmanuel Vadot			pon_pwrkey: pwrkey {
57c66ec88fSEmmanuel Vadot				compatible = "qcom,pm8941-pwrkey";
58c66ec88fSEmmanuel Vadot				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
59c66ec88fSEmmanuel Vadot				debounce = <15625>;
60c66ec88fSEmmanuel Vadot				bias-pull-up;
61c66ec88fSEmmanuel Vadot				linux,code = <KEY_POWER>;
62e67e8565SEmmanuel Vadot
63e67e8565SEmmanuel Vadot				status = "disabled";
64c66ec88fSEmmanuel Vadot			};
65c66ec88fSEmmanuel Vadot
66e67e8565SEmmanuel Vadot			pon_resin: resin {
67e67e8565SEmmanuel Vadot				compatible = "qcom,pm8941-resin";
68e67e8565SEmmanuel Vadot				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
69e67e8565SEmmanuel Vadot				debounce = <15625>;
70e67e8565SEmmanuel Vadot				bias-pull-up;
71e67e8565SEmmanuel Vadot
72e67e8565SEmmanuel Vadot				status = "disabled";
73e67e8565SEmmanuel Vadot			};
74c66ec88fSEmmanuel Vadot		};
75c66ec88fSEmmanuel Vadot
76*0e8011faSEmmanuel Vadot		pm660_charger: charger@1000 {
77*0e8011faSEmmanuel Vadot			compatible = "qcom,pm660-charger";
78*0e8011faSEmmanuel Vadot			reg = <0x1000>;
79*0e8011faSEmmanuel Vadot
80*0e8011faSEmmanuel Vadot			interrupts = <0x0 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
81*0e8011faSEmmanuel Vadot				     <0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
82*0e8011faSEmmanuel Vadot				     <0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
83*0e8011faSEmmanuel Vadot				     <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
84*0e8011faSEmmanuel Vadot			interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change";
85*0e8011faSEmmanuel Vadot
86*0e8011faSEmmanuel Vadot			io-channels = <&pm660_rradc 3>,
87*0e8011faSEmmanuel Vadot				      <&pm660_rradc 4>;
88*0e8011faSEmmanuel Vadot			io-channel-names = "usbin_i", "usbin_v";
89*0e8011faSEmmanuel Vadot
90*0e8011faSEmmanuel Vadot			status = "disabled";
91*0e8011faSEmmanuel Vadot		};
92*0e8011faSEmmanuel Vadot
93354d7675SEmmanuel Vadot		pm660_temp: temp-alarm@2400 {
94354d7675SEmmanuel Vadot			compatible = "qcom,spmi-temp-alarm";
95354d7675SEmmanuel Vadot			reg = <0x2400>;
96354d7675SEmmanuel Vadot			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
97354d7675SEmmanuel Vadot			io-channels = <&pm660_adc ADC5_DIE_TEMP>;
98354d7675SEmmanuel Vadot			io-channel-names = "thermal";
99354d7675SEmmanuel Vadot			#thermal-sensor-cells = <0>;
100354d7675SEmmanuel Vadot		};
101354d7675SEmmanuel Vadot
102354d7675SEmmanuel Vadot		pm660_adc: adc@3100 {
103354d7675SEmmanuel Vadot			compatible = "qcom,spmi-adc-rev2";
104354d7675SEmmanuel Vadot			reg = <0x3100>;
105354d7675SEmmanuel Vadot			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
106354d7675SEmmanuel Vadot			#address-cells = <1>;
107354d7675SEmmanuel Vadot			#size-cells = <0>;
108354d7675SEmmanuel Vadot			#io-channel-cells = <1>;
109354d7675SEmmanuel Vadot
110aa1a8ff2SEmmanuel Vadot			channel@0 {
111354d7675SEmmanuel Vadot				reg = <ADC5_REF_GND>;
112354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
113354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
114aa1a8ff2SEmmanuel Vadot				label = "ref_gnd";
115354d7675SEmmanuel Vadot			};
116354d7675SEmmanuel Vadot
117aa1a8ff2SEmmanuel Vadot			channel@1 {
118354d7675SEmmanuel Vadot				reg = <ADC5_1P25VREF>;
119354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
120354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
121aa1a8ff2SEmmanuel Vadot				label = "vref_1p25";
122354d7675SEmmanuel Vadot			};
123354d7675SEmmanuel Vadot
124aa1a8ff2SEmmanuel Vadot			channel@6 {
125354d7675SEmmanuel Vadot				reg = <ADC5_DIE_TEMP>;
126354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
127354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
128aa1a8ff2SEmmanuel Vadot				label = "die_temp";
129354d7675SEmmanuel Vadot			};
130354d7675SEmmanuel Vadot
131aa1a8ff2SEmmanuel Vadot			channel@4c {
132354d7675SEmmanuel Vadot				reg = <ADC5_XO_THERM_100K_PU>;
133354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
134354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
135354d7675SEmmanuel Vadot				qcom,hw-settle-time = <200>;
136354d7675SEmmanuel Vadot				qcom,ratiometric;
137aa1a8ff2SEmmanuel Vadot				label = "xo_therm";
138354d7675SEmmanuel Vadot			};
139354d7675SEmmanuel Vadot
140aa1a8ff2SEmmanuel Vadot			channel@4d {
141354d7675SEmmanuel Vadot				reg = <ADC5_AMUX_THM1_100K_PU>;
142354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
143354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
144354d7675SEmmanuel Vadot				qcom,hw-settle-time = <200>;
145354d7675SEmmanuel Vadot				qcom,ratiometric;
146aa1a8ff2SEmmanuel Vadot				label = "msm_therm";
147354d7675SEmmanuel Vadot			};
148354d7675SEmmanuel Vadot
149aa1a8ff2SEmmanuel Vadot			channel@4e {
150354d7675SEmmanuel Vadot				reg = <ADC5_AMUX_THM2_100K_PU>;
151354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
152354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
153354d7675SEmmanuel Vadot				qcom,hw-settle-time = <200>;
154354d7675SEmmanuel Vadot				qcom,ratiometric;
155aa1a8ff2SEmmanuel Vadot				label = "emmc_therm";
156354d7675SEmmanuel Vadot			};
157354d7675SEmmanuel Vadot
158aa1a8ff2SEmmanuel Vadot			channel@4f {
159354d7675SEmmanuel Vadot				reg = <ADC5_AMUX_THM3_100K_PU>;
160354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
161354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
162354d7675SEmmanuel Vadot				qcom,hw-settle-time = <200>;
163354d7675SEmmanuel Vadot				qcom,ratiometric;
164aa1a8ff2SEmmanuel Vadot				label = "pa_therm0";
165354d7675SEmmanuel Vadot			};
166354d7675SEmmanuel Vadot
167aa1a8ff2SEmmanuel Vadot			channel@50 {
168354d7675SEmmanuel Vadot				reg = <ADC5_AMUX_THM4_100K_PU>;
169354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
170354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
171354d7675SEmmanuel Vadot				qcom,hw-settle-time = <200>;
172354d7675SEmmanuel Vadot				qcom,ratiometric;
173aa1a8ff2SEmmanuel Vadot				label = "pa_therm1";
174354d7675SEmmanuel Vadot			};
175354d7675SEmmanuel Vadot
176aa1a8ff2SEmmanuel Vadot			channel@51 {
177354d7675SEmmanuel Vadot				reg = <ADC5_AMUX_THM5_100K_PU>;
178354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 1>;
179354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
180354d7675SEmmanuel Vadot				qcom,hw-settle-time = <200>;
181354d7675SEmmanuel Vadot				qcom,ratiometric;
182aa1a8ff2SEmmanuel Vadot				label = "quiet_therm";
183354d7675SEmmanuel Vadot			};
184354d7675SEmmanuel Vadot
185aa1a8ff2SEmmanuel Vadot			channel@83 {
186354d7675SEmmanuel Vadot				reg = <ADC5_VPH_PWR>;
187354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
188354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 3>;
189aa1a8ff2SEmmanuel Vadot				label = "vph_pwr";
190354d7675SEmmanuel Vadot			};
191354d7675SEmmanuel Vadot
192aa1a8ff2SEmmanuel Vadot			channel@85 {
193354d7675SEmmanuel Vadot				reg = <ADC5_VCOIN>;
194354d7675SEmmanuel Vadot				qcom,decimation = <1024>;
195354d7675SEmmanuel Vadot				qcom,pre-scaling = <1 3>;
196aa1a8ff2SEmmanuel Vadot				label = "vcoin";
197354d7675SEmmanuel Vadot			};
198354d7675SEmmanuel Vadot		};
199354d7675SEmmanuel Vadot
200*0e8011faSEmmanuel Vadot		pm660_rradc: adc@4500 {
201*0e8011faSEmmanuel Vadot			compatible = "qcom,pm660-rradc";
202*0e8011faSEmmanuel Vadot			reg = <0x4500>;
203*0e8011faSEmmanuel Vadot			#io-channel-cells = <1>;
204*0e8011faSEmmanuel Vadot
205*0e8011faSEmmanuel Vadot			status = "disabled";
206*0e8011faSEmmanuel Vadot		};
207*0e8011faSEmmanuel Vadot
2088bab661aSEmmanuel Vadot		pm660_gpios: gpio@c000 {
209b97ee269SEmmanuel Vadot			compatible = "qcom,pm660-gpio", "qcom,spmi-gpio";
210c66ec88fSEmmanuel Vadot			reg = <0xc000>;
211c66ec88fSEmmanuel Vadot			gpio-controller;
212c66ec88fSEmmanuel Vadot			gpio-ranges = <&pm660_gpios 0 0 13>;
213c66ec88fSEmmanuel Vadot			#gpio-cells = <2>;
214c66ec88fSEmmanuel Vadot			interrupt-controller;
2156be33864SEmmanuel Vadot			#interrupt-cells = <2>;
216c66ec88fSEmmanuel Vadot		};
217c66ec88fSEmmanuel Vadot	};
218354d7675SEmmanuel Vadot
219354d7675SEmmanuel Vadot	pmic@1 {
220354d7675SEmmanuel Vadot		compatible = "qcom,pm660", "qcom,spmi-pmic";
221354d7675SEmmanuel Vadot		reg = <0x1 SPMI_USID>;
222354d7675SEmmanuel Vadot		#address-cells = <1>;
223354d7675SEmmanuel Vadot		#size-cells = <0>;
224354d7675SEmmanuel Vadot
2257ef62cebSEmmanuel Vadot		pm660_spmi_regulators: regulators {
226354d7675SEmmanuel Vadot			compatible = "qcom,pm660-regulators";
227354d7675SEmmanuel Vadot		};
228354d7675SEmmanuel Vadot	};
229c66ec88fSEmmanuel Vadot};
230