Skip to content

Commit a1a414d

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 16980ad commit a1a414d

6 files changed

Lines changed: 692 additions & 1 deletion

File tree

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

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,81 @@
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@4b {
106+
reg = <ADC5_BAT_ID_100K_PU>;
107+
label = "bat_id";
108+
qcom,ratiometric;
109+
qcom,hw-settle-time = <200>;
110+
qcom,pre-scaling = <1 1>;
111+
};
112+
};
113+
39114
pm4125_vbus: usb-vbus-regulator@1100 {
40115
compatible = "qcom,pm4125-vbus-reg", "qcom,pm8150b-vbus-reg";
41116
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 = <0x4 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
@@ -3,10 +3,96 @@
33
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
44
*/
55

6+
#include <dt-bindings/gpio/gpio.h>
7+
#include <dt-bindings/iio/qcom,spmi-vadc.h>
8+
#include <dt-bindings/input/input.h>
9+
610
#include "shikra.dtsi"
11+
#include "pm4125.dtsi"
12+
#include "pm8005.dtsi"
713

814
/* Modem, Cocos + Kunlun PMIC */
915

16+
&pm4125_gpios {
17+
key_vol_up {
18+
key_vol_up_default: key_vol_up_default {
19+
pins = "gpio9";
20+
function = "normal";
21+
input-enable;
22+
bias-pull-up;
23+
power-source = <0>;
24+
};
25+
};
26+
27+
adc_gpio5 {
28+
pm4125_adc_gpio5_default: pm4125_adc_gpio5_default {
29+
pins = "gpio5";
30+
bias-high-impedance;
31+
};
32+
};
33+
34+
adc_gpio6 {
35+
pm4125_adc_gpio6_default: pm4125_adc_gpio6_default {
36+
pins = "gpio6";
37+
bias-high-impedance;
38+
};
39+
};
40+
};
41+
42+
&pm4125_vadc {
43+
pinctrl-0 = <&pm4125_adc_gpio5_default>, <&pm4125_adc_gpio6_default>;
44+
pinctrl-names = "default";
45+
46+
channel@54 {
47+
reg = <ADC5_GPIO3_100K_PU>;
48+
label = "chgr_skin";
49+
qcom,ratiometric;
50+
qcom,hw-settle-time = <200>;
51+
qcom,pre-scaling = <1 1>;
52+
};
53+
54+
channel@55 {
55+
reg = <ADC5_GPIO4_100K_PU>;
56+
label = "gnss_therm";
57+
qcom,ratiometric;
58+
qcom,hw-settle-time = <200>;
59+
qcom,pre-scaling = <1 1>;
60+
};
61+
62+
channel@4d {
63+
reg = <ADC5_AMUX_THM1_100K_PU>;
64+
label = "pa_therm";
65+
qcom,ratiometric;
66+
qcom,hw-settle-time = <200>;
67+
qcom,pre-scaling = <1 1>;
68+
};
69+
70+
channel@4e {
71+
reg = <ADC5_AMUX_THM2_100K_PU>;
72+
label = "quiet_therm";
73+
qcom,ratiometric;
74+
qcom,hw-settle-time = <200>;
75+
qcom,pre-scaling = <1 1>;
76+
};
77+
78+
channel@4f {
79+
reg = <ADC5_AMUX_THM3_100K_PU>;
80+
label = "msm_therm";
81+
qcom,ratiometric;
82+
qcom,hw-settle-time = <200>;
83+
qcom,pre-scaling = <1 1>;
84+
};
85+
};
86+
87+
&pm4125_resin {
88+
linux,code = <KEY_VOLUMEDOWN>;
89+
status = "okay";
90+
};
91+
92+
&pm8005_regulators {
93+
status = "disabled";
94+
};
95+
1096
&rpm_requests {
1197
regulators {
1298
compatible = "qcom,rpm-pm2250-regulators";
@@ -137,3 +223,139 @@
137223
};
138224
};
139225
};
226+
227+
&soc {
228+
gpio_key {
229+
compatible = "gpio-keys";
230+
label = "gpio-keys";
231+
pinctrl-names = "default";
232+
pinctrl-0 = <&key_vol_up_default>;
233+
234+
vol_up {
235+
label = "volume_up";
236+
gpios = <&pm4125_gpios 9 GPIO_ACTIVE_LOW>;
237+
linux,input-type = <1>;
238+
linux,code = <KEY_VOLUMEUP>;
239+
wakeup-source;
240+
debounce-interval = <15>;
241+
linux,can-disable;
242+
};
243+
};
244+
245+
pm4125_pa_therm_bridge: pm4125_pa_therm_bridge {
246+
compatible = "generic-adc-thermal";
247+
io-channels = <&pm4125_vadc ADC5_AMUX_THM1_100K_PU>;
248+
io-channel-names = "sensor-channel";
249+
#thermal-sensor-cells = <0>;
250+
};
251+
252+
pm4125_quiet_therm_bridge: pm4125_quiet_therm_bridge {
253+
compatible = "generic-adc-thermal";
254+
io-channels = <&pm4125_vadc ADC5_AMUX_THM2_100K_PU>;
255+
io-channel-names = "sensor-channel";
256+
#thermal-sensor-cells = <0>;
257+
};
258+
259+
pm4125_msm_therm_bridge: pm4125_msm_therm_bridge {
260+
compatible = "generic-adc-thermal";
261+
io-channels = <&pm4125_vadc ADC5_AMUX_THM3_100K_PU>;
262+
io-channel-names = "sensor-channel";
263+
#thermal-sensor-cells = <0>;
264+
};
265+
};
266+
267+
&thermal_zones {
268+
pm4125-tz {
269+
polling-delay-passive = <100>;
270+
polling-delay = <0>;
271+
thermal-sensors = <&pm4125_tz>;
272+
273+
trips {
274+
pm4125_trip0: trip0 {
275+
temperature = <105000>;
276+
hysteresis = <0>;
277+
type = "passive";
278+
};
279+
280+
pm4125_trip1: trip1 {
281+
temperature = <125000>;
282+
hysteresis = <0>;
283+
type = "hot";
284+
};
285+
286+
pm4125_trip2: trip2 {
287+
temperature = <155000>;
288+
hysteresis = <0>;
289+
type = "critical";
290+
};
291+
};
292+
};
293+
294+
pm8005-tz {
295+
polling-delay-passive = <0>;
296+
polling-delay = <0>;
297+
thermal-sensors = <&pm8005_tz>;
298+
299+
trips {
300+
pm8005_trip0: trip0 {
301+
temperature = <105000>;
302+
hysteresis = <0>;
303+
type = "passive";
304+
};
305+
306+
pm8005_trip1: trip1 {
307+
temperature = <125000>;
308+
hysteresis = <0>;
309+
type = "passive";
310+
};
311+
312+
pm8005_trip2: trip2 {
313+
temperature = <145000>;
314+
hysteresis = <0>;
315+
type = "passive";
316+
};
317+
};
318+
};
319+
320+
sys-therm-1 {
321+
polling-delay-passive = <2000>;
322+
polling-delay = <0>;
323+
thermal-sensors = <&pm4125_pa_therm_bridge>;
324+
325+
trips {
326+
active-config0 {
327+
temperature = <125000>;
328+
hysteresis = <1000>;
329+
type = "passive";
330+
};
331+
};
332+
};
333+
334+
sys-therm-2 {
335+
polling-delay-passive = <2000>;
336+
polling-delay = <0>;
337+
thermal-sensors = <&pm4125_quiet_therm_bridge>;
338+
339+
trips {
340+
active-config0 {
341+
temperature = <125000>;
342+
hysteresis = <1000>;
343+
type = "passive";
344+
};
345+
};
346+
};
347+
348+
sys-therm-3 {
349+
polling-delay-passive = <2000>;
350+
polling-delay = <0>;
351+
thermal-sensors = <&pm4125_msm_therm_bridge>;
352+
353+
trips {
354+
active-config0 {
355+
temperature = <125000>;
356+
hysteresis = <1000>;
357+
type = "passive";
358+
};
359+
};
360+
};
361+
};

0 commit comments

Comments
 (0)