Skip to content

Commit b8178ec

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 3b9d862 commit b8178ec

6 files changed

Lines changed: 686 additions & 1 deletion

File tree

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

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,83 @@
6666
status = "disabled";
6767
};
6868

69+
pm4125_tz: temp-alarm@2400 {
70+
compatible = "qcom,spmi-temp-alarm";
71+
reg = <0x2400>;
72+
interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
73+
io-channels = <&pm4125_adc ADC5_DIE_TEMP>;
74+
io-channel-names = "thermal";
75+
#thermal-sensor-cells = <0>;
76+
status = "disabled";
77+
};
78+
79+
pm4125_adc: adc@3100 {
80+
compatible = "qcom,spmi-adc5";
81+
reg = <0x3100>;
82+
#address-cells = <1>;
83+
#size-cells = <0>;
84+
#io-channel-cells = <1>;
85+
interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
86+
status = "disabled";
87+
88+
/* Channel nodes */
89+
channel@0 {
90+
reg = <ADC5_REF_GND>;
91+
label = "ref_gnd";
92+
qcom,pre-scaling = <1 1>;
93+
};
94+
95+
channel@1 {
96+
reg = <ADC5_1P25VREF>;
97+
label = "vref_1p25";
98+
qcom,pre-scaling = <1 1>;
99+
};
100+
101+
channel@6 {
102+
reg = <ADC5_DIE_TEMP>;
103+
label = "die_temp";
104+
qcom,pre-scaling = <1 1>;
105+
};
106+
107+
channel@7 {
108+
reg = <ADC5_USB_IN_I>;
109+
label = "usb_in_i_uv";
110+
qcom,pre-scaling = <1 1>;
111+
};
112+
113+
channel@8 {
114+
reg = <ADC5_USB_IN_V_16>;
115+
label = "usb_in_v_div_16";
116+
qcom,pre-scaling = <1 16>;
117+
};
118+
119+
channel@9 {
120+
reg = <ADC5_CHG_TEMP>;
121+
label = "chg_temp";
122+
qcom,pre-scaling = <1 1>;
123+
};
124+
125+
channel@4b {
126+
reg = <ADC5_BAT_ID_100K_PU>;
127+
label = "bat_id";
128+
qcom,ratiometric;
129+
qcom,hw-settle-time = <200>;
130+
qcom,pre-scaling = <1 1>;
131+
};
132+
133+
channel@83 {
134+
reg = <ADC5_VPH_PWR>;
135+
label = "vph_pwr";
136+
qcom,pre-scaling = <1 3>;
137+
};
138+
139+
channel@84 {
140+
reg = <ADC5_VBAT_SNS>;
141+
label = "vbat_sns";
142+
qcom,pre-scaling = <1 3>;
143+
};
144+
};
145+
69146
rtc@6000 {
70147
compatible = "qcom,pm8941-rtc";
71148
reg = <0x6000>, <0x6100>;

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,9 +3,116 @@
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 */
15+
/ {
16+
pm4125_msm_therm_bridge: pm4125-msm-therm-bridge {
17+
compatible = "generic-adc-thermal";
18+
io-channels = <&pm4125_adc ADC5_AMUX_THM3_100K_PU>;
19+
io-channel-names = "sensor-channel";
20+
#thermal-sensor-cells = <0>;
21+
};
22+
23+
pm4125_pa_therm_bridge: pm4125-pa-therm-bridge {
24+
compatible = "generic-adc-thermal";
25+
io-channels = <&pm4125_adc ADC5_AMUX_THM1_100K_PU>;
26+
io-channel-names = "sensor-channel";
27+
#thermal-sensor-cells = <0>;
28+
};
29+
30+
pm4125_quiet_therm_bridge: pm4125-quiet-therm-bridge {
31+
compatible = "generic-adc-thermal";
32+
io-channels = <&pm4125_adc ADC5_AMUX_THM2_100K_PU>;
33+
io-channel-names = "sensor-channel";
34+
#thermal-sensor-cells = <0>;
35+
};
36+
};
37+
38+
&pm4125_gpios {
39+
pm4125_adc_gpio5_default: pm4125-adc-gpio5-default {
40+
pins = "gpio5";
41+
bias-high-impedance;
42+
};
43+
44+
pm4125_adc_gpio6_default: pm4125-adc-gpio6-default {
45+
pins = "gpio6";
46+
bias-high-impedance;
47+
};
48+
49+
vol_up_n: vol-up-n-state {
50+
pins = "gpio9";
51+
function = "normal";
52+
input-enable;
53+
bias-pull-up;
54+
power-source = <0>;
55+
};
56+
};
57+
58+
&pm4125_adc {
59+
pinctrl-0 = <&pm4125_adc_gpio5_default>, <&pm4125_adc_gpio6_default>;
60+
pinctrl-names = "default";
61+
status = "okay";
62+
63+
channel@4d {
64+
reg = <ADC5_AMUX_THM1_100K_PU>;
65+
label = "pa_therm";
66+
qcom,ratiometric;
67+
qcom,hw-settle-time = <200>;
68+
qcom,pre-scaling = <1 1>;
69+
};
70+
71+
channel@4e {
72+
reg = <ADC5_AMUX_THM2_100K_PU>;
73+
label = "quiet_therm";
74+
qcom,ratiometric;
75+
qcom,hw-settle-time = <200>;
76+
qcom,pre-scaling = <1 1>;
77+
};
78+
79+
channel@4f {
80+
reg = <ADC5_AMUX_THM3_100K_PU>;
81+
label = "msm_therm";
82+
qcom,ratiometric;
83+
qcom,hw-settle-time = <200>;
84+
qcom,pre-scaling = <1 1>;
85+
};
86+
87+
channel@54 {
88+
reg = <ADC5_GPIO3_100K_PU>;
89+
label = "chgr_skin";
90+
qcom,ratiometric;
91+
qcom,hw-settle-time = <200>;
92+
qcom,pre-scaling = <1 1>;
93+
};
94+
95+
channel@55 {
96+
reg = <ADC5_GPIO4_100K_PU>;
97+
label = "gnss_therm";
98+
qcom,ratiometric;
99+
qcom,hw-settle-time = <200>;
100+
qcom,pre-scaling = <1 1>;
101+
};
102+
};
103+
104+
&pm4125_tz {
105+
status = "okay";
106+
};
107+
108+
&pm4125_resin {
109+
linux,code = <KEY_VOLUMEDOWN>;
110+
status = "okay";
111+
};
112+
113+
&pm8005_regulators {
114+
status = "disabled";
115+
};
9116

10117
&rpm_requests {
11118
regulators {
@@ -137,3 +244,118 @@
137244
};
138245
};
139246
};
247+
248+
&soc {
249+
gpio_key {
250+
compatible = "gpio-keys";
251+
label = "gpio-keys";
252+
pinctrl-names = "default";
253+
pinctrl-0 = <&vol_up_n>;
254+
255+
vol_up {
256+
label = "volume_up";
257+
gpios = <&pm4125_gpios 9 GPIO_ACTIVE_LOW>;
258+
linux,input-type = <1>;
259+
linux,code = <KEY_VOLUMEUP>;
260+
wakeup-source;
261+
debounce-interval = <15>;
262+
linux,can-disable;
263+
};
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)