Skip to content

Commit bcde924

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 bcde924

File tree

6 files changed

+733
-1
lines changed

6 files changed

+733
-1
lines changed

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: 223 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@56 {
47+
reg = <ADC5_GPIO5_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@57 {
55+
reg = <ADC5_GPIO6_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_VOLUMEUP>;
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,140 @@
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+
gpio-key,wakeup;
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>; /* It becomes the sensor provider */
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-governor = "step_wise";
272+
thermal-sensors = <&pm4125_tz>;
273+
274+
trips {
275+
pm4125_trip0: trip0 {
276+
temperature = <105000>;
277+
hysteresis = <0>;
278+
type = "passive";
279+
};
280+
281+
pm4125_trip1: trip1 {
282+
temperature = <125000>;
283+
hysteresis = <0>;
284+
type = "hot";
285+
};
286+
287+
pm4125_trip2: trip2 {
288+
temperature = <155000>;
289+
hysteresis = <0>;
290+
type = "critical";
291+
};
292+
};
293+
};
294+
295+
pm8005-tz {
296+
polling-delay-passive = <0>;
297+
polling-delay = <0>;
298+
thermal-sensors = <&pm8005_tz>;
299+
300+
trips {
301+
pm8005_trip0: trip0 {
302+
temperature = <105000>;
303+
hysteresis = <0>;
304+
type = "passive";
305+
};
306+
307+
pm8005_trip1: trip1 {
308+
temperature = <125000>;
309+
hysteresis = <0>;
310+
type = "passive";
311+
};
312+
313+
pm8005_trip2: trip2 {
314+
temperature = <145000>;
315+
hysteresis = <0>;
316+
type = "passive";
317+
};
318+
};
319+
};
320+
321+
sys-therm-1 {
322+
polling-delay-passive = <2000>;
323+
polling-delay = <0>;
324+
thermal-sensors = <&pm4125_pa_therm_bridge>;
325+
326+
trips {
327+
active-config0 {
328+
temperature = <125000>;
329+
hysteresis = <1000>;
330+
type = "passive";
331+
};
332+
};
333+
};
334+
335+
sys-therm-2 {
336+
polling-delay-passive = <2000>;
337+
polling-delay = <0>;
338+
thermal-sensors = <&pm4125_quiet_therm_bridge>;
339+
340+
trips {
341+
active-config0 {
342+
temperature = <125000>;
343+
hysteresis = <1000>;
344+
type = "passive";
345+
};
346+
};
347+
};
348+
349+
sys-therm-3 {
350+
polling-delay-passive = <2000>;
351+
polling-delay = <0>;
352+
thermal-sensors = <&pm4125_msm_therm_bridge>;
353+
354+
trips {
355+
active-config0 {
356+
temperature = <125000>;
357+
hysteresis = <1000>;
358+
type = "passive";
359+
};
360+
};
361+
};
362+
};

0 commit comments

Comments
 (0)