Skip to content

Commit 824d72f

Browse files
committed
arm64: dts: qcom: shikra: Add PMIC thermal and ADC support
Add PMIC topic overlay changes for Shikra SOM variants (CQM, CQS, IQS): - Add pm4125 temp-alarm and VADC channel nodes - Add pm8005 temp-alarm node - Add thermal zones for PMIC and system thermistors - Add GPIO key (volume up) bindings - Add ADC thermal bridge nodes for pa/quiet/msm thermistors - Disable pm8005 regulators across SOM variants - Switch SPMI interrupt to MPM edge-triggered Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
1 parent 5a13504 commit 824d72f

6 files changed

Lines changed: 722 additions & 1 deletion

File tree

arch/arm64/boot/dts/qcom/pm4125.dtsi

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,111 @@
3636
};
3737
};
3838

39+
pm4125_tz: temp-alarm@2400 {
40+
compatible = "qcom,spmi-temp-alarm";
41+
reg = <0x2400>;
42+
interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
43+
io-channels = <&pm4125_vadc ADC5_DIE_TEMP>;
44+
io-channel-names = "thermal";
45+
#thermal-sensor-cells = <0>;
46+
};
47+
48+
pm4125_vadc: vadc@3100 {
49+
compatible = "qcom,spmi-adc5";
50+
reg = <0x3100>;
51+
#address-cells = <1>;
52+
#size-cells = <0>;
53+
#io-channel-cells = <1>;
54+
interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
55+
56+
/* Channel nodes */
57+
channel@0 {
58+
reg = <ADC5_REF_GND>;
59+
label = "ref_gnd";
60+
qcom,pre-scaling = <1 1>;
61+
};
62+
63+
channel@1 {
64+
reg = <ADC5_1P25VREF>;
65+
label = "vref_1p25";
66+
qcom,pre-scaling = <1 1>;
67+
};
68+
69+
channel@6 {
70+
reg = <ADC5_DIE_TEMP>;
71+
label = "die_temp";
72+
qcom,pre-scaling = <1 1>;
73+
};
74+
75+
channel@7 {
76+
reg = <ADC5_USB_IN_I>;
77+
label = "usb_in_i_uv";
78+
qcom,pre-scaling = <1 1>;
79+
};
80+
81+
channel@8 {
82+
reg = <ADC5_USB_IN_V_16>;
83+
label = "usb_in_v_div_16";
84+
qcom,pre-scaling = <1 16>;
85+
};
86+
87+
channel@9 {
88+
reg = <ADC5_CHG_TEMP>;
89+
label = "chg_temp";
90+
qcom,pre-scaling = <1 1>;
91+
};
92+
93+
channel@83 {
94+
reg = <ADC5_VPH_PWR>;
95+
label = "vph_pwr";
96+
qcom,pre-scaling = <1 3>;
97+
};
98+
99+
channel@84 {
100+
reg = <ADC5_VBAT_SNS>;
101+
label = "vbat_sns";
102+
qcom,pre-scaling = <1 3>;
103+
};
104+
105+
channel@2a {
106+
reg = <ADC5_BAT_THERM_30K_PU>;
107+
label = "bat_therm_30k";
108+
qcom,ratiometric;
109+
qcom,hw-settle-time = <200>;
110+
qcom,pre-scaling = <1 1>;
111+
};
112+
113+
channel@4a {
114+
reg = <ADC5_BAT_THERM_100K_PU>;
115+
label = "bat_therm";
116+
qcom,ratiometric;
117+
qcom,hw-settle-time = <200>;
118+
qcom,pre-scaling = <1 1>;
119+
};
120+
121+
channel@4b {
122+
reg = <ADC5_BAT_ID_100K_PU>;
123+
label = "bat_id";
124+
qcom,ratiometric;
125+
qcom,hw-settle-time = <200>;
126+
qcom,pre-scaling = <1 1>;
127+
};
128+
129+
channel@6a {
130+
reg = <ADC5_BAT_THERM_400K_PU>;
131+
label = "bat_therm_400k";
132+
qcom,ratiometric;
133+
qcom,hw-settle-time = <200>;
134+
qcom,pre-scaling = <1 1>;
135+
};
136+
137+
channel@a5 {
138+
reg = <ADC5_PARALLEL_ISENSE>;
139+
label = "i_parallel";
140+
qcom,pre-scaling = <1 1>;
141+
};
142+
};
143+
39144
pm4125_vbus: usb-vbus-regulator@1100 {
40145
compatible = "qcom,pm4125-vbus-reg", "qcom,pm8150b-vbus-reg";
41146
reg = <0x1100>;

arch/arm64/boot/dts/qcom/pm8005.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
#address-cells = <1>;
1212
#size-cells = <0>;
1313

14+
pm8005_tz: temp-alarm@2400 {
15+
compatible = "qcom,spmi-temp-alarm";
16+
reg = <0x2400>;
17+
interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
18+
#thermal-sensor-cells = <0>;
19+
};
20+
1421
pm8005_gpios: gpio@c000 {
1522
compatible = "qcom,pm8005-gpio", "qcom,spmi-gpio";
1623
reg = <0xc000>;

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
*/
55

66
#include "shikra.dtsi"
7+
#include <dt-bindings/gpio/gpio.h>
8+
#include <dt-bindings/input/input.h>
9+
#include <dt-bindings/iio/qcom,spmi-vadc.h>
710

11+
#include "pm4125.dtsi"
12+
#include "pm8005.dtsi"
813
/* Modem, Cocos + Kunlun PMIC */
914

1015
&rpm_requests {
@@ -137,3 +142,220 @@
137142
};
138143
};
139144
};
145+
146+
&thermal_zones {
147+
pm4125-tz {
148+
polling-delay-passive = <100>;
149+
polling-delay = <0>;
150+
thermal-governor = "step_wise";
151+
thermal-sensors = <&pm4125_tz>;
152+
153+
trips {
154+
pm4125_trip0: trip0 {
155+
temperature = <105000>;
156+
hysteresis = <0>;
157+
type = "passive";
158+
};
159+
160+
pm4125_trip1: trip1 {
161+
temperature = <125000>;
162+
hysteresis = <0>;
163+
type = "hot";
164+
};
165+
166+
pm4125_trip2: trip2 {
167+
temperature = <155000>;
168+
hysteresis = <0>;
169+
type = "critical";
170+
};
171+
};
172+
};
173+
174+
pm8005-tz {
175+
polling-delay-passive = <0>;
176+
polling-delay = <0>;
177+
thermal-sensors = <&pm8005_tz>;
178+
179+
trips {
180+
pm8005_trip0: trip0 {
181+
temperature = <105000>;
182+
hysteresis = <0>;
183+
type = "passive";
184+
};
185+
186+
pm8005_trip1: trip1 {
187+
temperature = <125000>;
188+
hysteresis = <0>;
189+
type = "passive";
190+
};
191+
192+
pm8005_trip2: trip2 {
193+
temperature = <145000>;
194+
hysteresis = <0>;
195+
type = "passive";
196+
};
197+
};
198+
};
199+
200+
sys-therm-1 {
201+
polling-delay-passive = <2000>;
202+
polling-delay = <0>;
203+
thermal-sensors = <&pm4125_pa_therm_bridge>;
204+
205+
trips {
206+
active-config0 {
207+
temperature = <125000>;
208+
hysteresis = <1000>;
209+
type = "passive";
210+
};
211+
};
212+
};
213+
214+
sys-therm-2 {
215+
polling-delay-passive = <2000>;
216+
polling-delay = <0>;
217+
thermal-sensors = <&pm4125_quiet_therm_bridge>;
218+
219+
trips {
220+
active-config0 {
221+
temperature = <125000>;
222+
hysteresis = <1000>;
223+
type = "passive";
224+
};
225+
};
226+
};
227+
228+
sys-therm-3 {
229+
polling-delay-passive = <2000>;
230+
polling-delay = <0>;
231+
thermal-sensors = <&pm4125_msm_therm_bridge>;
232+
233+
trips {
234+
active-config0 {
235+
temperature = <125000>;
236+
hysteresis = <1000>;
237+
type = "passive";
238+
};
239+
};
240+
};
241+
};
242+
243+
&pm4125_gpios {
244+
key_vol_up {
245+
key_vol_up_default: key_vol_up_default {
246+
pins = "gpio9";
247+
function = "normal";
248+
input-enable;
249+
bias-pull-up;
250+
power-source = <0>;
251+
};
252+
};
253+
254+
adc_gpio5 {
255+
pm4125_adc_gpio5_default: pm4125_adc_gpio5_default {
256+
pins = "gpio5";
257+
bias-high-impedance;
258+
};
259+
};
260+
261+
adc_gpio6 {
262+
pm4125_adc_gpio6_default: pm4125_adc_gpio6_default {
263+
pins = "gpio6";
264+
bias-high-impedance;
265+
};
266+
};
267+
};
268+
269+
&soc {
270+
gpio_key {
271+
compatible = "gpio-keys";
272+
label = "gpio-keys";
273+
pinctrl-names = "default";
274+
pinctrl-0 = <&key_vol_up_default>;
275+
276+
vol_up {
277+
label = "volume_up";
278+
gpios = <&pm4125_gpios 9 GPIO_ACTIVE_LOW>;
279+
linux,input-type = <1>;
280+
linux,code = <KEY_VOLUMEUP>;
281+
gpio-key,wakeup;
282+
debounce-interval = <15>;
283+
linux,can-disable;
284+
};
285+
};
286+
287+
pm4125_pa_therm_bridge: pm4125_pa_therm_bridge {
288+
compatible = "generic-adc-thermal";
289+
io-channels = <&pm4125_vadc ADC5_AMUX_THM1_100K_PU>;
290+
io-channel-names = "sensor-channel";
291+
#thermal-sensor-cells = <0>; /* It becomes the sensor provider */
292+
};
293+
294+
pm4125_quiet_therm_bridge: pm4125_quiet_therm_bridge {
295+
compatible = "generic-adc-thermal";
296+
io-channels = <&pm4125_vadc ADC5_AMUX_THM2_100K_PU>;
297+
io-channel-names = "sensor-channel";
298+
#thermal-sensor-cells = <0>;
299+
};
300+
301+
pm4125_msm_therm_bridge: pm4125_msm_therm_bridge {
302+
compatible = "generic-adc-thermal";
303+
io-channels = <&pm4125_vadc ADC5_AMUX_THM3_100K_PU>;
304+
io-channel-names = "sensor-channel";
305+
#thermal-sensor-cells = <0>;
306+
};
307+
};
308+
309+
&pm4125_vadc {
310+
pinctrl-0 = <&pm4125_adc_gpio5_default>, <&pm4125_adc_gpio6_default>;
311+
pinctrl-names = "default";
312+
313+
channel@56 {
314+
reg = <ADC5_GPIO5_100K_PU>;
315+
label = "chgr_skin";
316+
qcom,ratiometric;
317+
qcom,hw-settle-time = <200>;
318+
qcom,pre-scaling = <1 1>;
319+
};
320+
321+
channel@57 {
322+
reg = <ADC5_GPIO6_100K_PU>;
323+
label = "gnss_therm";
324+
qcom,ratiometric;
325+
qcom,hw-settle-time = <200>;
326+
qcom,pre-scaling = <1 1>;
327+
};
328+
329+
channel@4d {
330+
reg = <ADC5_AMUX_THM1_100K_PU>;
331+
label = "pa_therm";
332+
qcom,ratiometric;
333+
qcom,hw-settle-time = <200>;
334+
qcom,pre-scaling = <1 1>;
335+
};
336+
337+
channel@4e {
338+
reg = <ADC5_AMUX_THM2_100K_PU>;
339+
label = "quiet_therm";
340+
qcom,ratiometric;
341+
qcom,hw-settle-time = <200>;
342+
qcom,pre-scaling = <1 1>;
343+
};
344+
345+
channel@4f {
346+
reg = <ADC5_AMUX_THM3_100K_PU>;
347+
label = "msm_therm";
348+
qcom,ratiometric;
349+
qcom,hw-settle-time = <200>;
350+
qcom,pre-scaling = <1 1>;
351+
};
352+
};
353+
354+
&pm4125_resin {
355+
status = "okay";
356+
linux,code = <KEY_VOLUMEUP>;
357+
};
358+
359+
&pm8005_regulators {
360+
status = "disabled";
361+
};

0 commit comments

Comments
 (0)