xref: /openbmc/linux/arch/arm64/boot/dts/qcom/pm7250b.dtsi (revision 8b46168c)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (C) 2022 Luca Weiss <luca.weiss@fairphone.com>
4 */
5
6#include <dt-bindings/interrupt-controller/irq.h>
7#include <dt-bindings/spmi/spmi.h>
8
9/ {
10	thermal-zones {
11		pm7250b-thermal {
12			polling-delay-passive = <100>;
13			polling-delay = <0>;
14
15			thermal-sensors = <&pm7250b_temp>;
16
17			trips {
18				trip0 {
19					temperature = <95000>;
20					hysteresis = <0>;
21					type = "passive";
22				};
23
24				trip1 {
25					temperature = <115000>;
26					hysteresis = <0>;
27					type = "hot";
28				};
29
30				trip2 {
31					temperature = <145000>;
32					hysteresis = <0>;
33					type = "critical";
34				};
35			};
36		};
37	};
38};
39
40&spmi_bus {
41	pmic@2 {
42		compatible = "qcom,pm7250b", "qcom,spmi-pmic";
43		reg = <0x2 SPMI_USID>;
44		#address-cells = <1>;
45		#size-cells = <0>;
46
47		pm7250b_temp: temp-alarm@2400 {
48			compatible = "qcom,spmi-temp-alarm";
49			reg = <0x2400>;
50			interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
51			io-channels = <&pm7250b_adc ADC5_DIE_TEMP>;
52			io-channel-names = "thermal";
53			#thermal-sensor-cells = <0>;
54		};
55
56		pm7250b_adc: adc@3100 {
57			compatible = "qcom,spmi-adc5";
58			reg = <0x3100>;
59			#address-cells = <1>;
60			#size-cells = <0>;
61			#io-channel-cells = <1>;
62			interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
63
64			adc-chan@0 {
65				reg = <ADC5_REF_GND>;
66				qcom,pre-scaling = <1 1>;
67				label = "ref_gnd";
68			};
69
70			adc-chan@1 {
71				reg = <ADC5_1P25VREF>;
72				qcom,pre-scaling = <1 1>;
73				label = "vref_1p25";
74			};
75
76			adc-chan@2 {
77				reg = <ADC5_DIE_TEMP>;
78				qcom,pre-scaling = <1 1>;
79				label = "die_temp";
80			};
81
82			adc-chan@7 {
83				reg = <ADC5_USB_IN_I>;
84				qcom,pre-scaling = <1 1>;
85				label = "usb_in_i_uv";
86			};
87
88			adc-chan@8 {
89				reg = <ADC5_USB_IN_V_16>;
90				qcom,pre-scaling = <1 16>;
91				label = "usb_in_v_div_16";
92			};
93
94			adc-chan@9 {
95				reg = <ADC5_CHG_TEMP>;
96				qcom,pre-scaling = <1 1>;
97				label = "chg_temp";
98			};
99
100			adc-chan@e {
101				reg = <ADC5_AMUX_THM2>;
102				qcom,hw-settle-time = <200>;
103				qcom,pre-scaling = <1 1>;
104				label = "smb1390_therm";
105			};
106
107			adc-chan@1e {
108				reg = <ADC5_MID_CHG_DIV6>;
109				qcom,pre-scaling = <1 6>;
110				label = "chg_mid";
111			};
112
113			adc-chan@4b {
114				reg = <ADC5_BAT_ID_100K_PU>;
115				qcom,hw-settle-time = <200>;
116				qcom,pre-scaling = <1 1>;
117				qcom,ratiometric;
118				label = "bat_id";
119			};
120
121			adc-chan@83 {
122				reg = <ADC5_VPH_PWR>;
123				qcom,pre-scaling = <1 3>;
124				label = "vph_pwr";
125			};
126
127			adc-chan@84 {
128				reg = <ADC5_VBAT_SNS>;
129				qcom,pre-scaling = <1 3>;
130				label = "vbat_sns";
131			};
132
133			adc-chan@99 {
134				reg = <ADC5_SBUx>;
135				qcom,pre-scaling = <1 3>;
136				label = "chg_sbux";
137			};
138		};
139
140		pm7250b_adc_tm: adc-tm@3500 {
141			compatible = "qcom,spmi-adc-tm5";
142			reg = <0x3500>;
143			interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
144			#thermal-sensor-cells = <1>;
145			#address-cells = <1>;
146			#size-cells = <0>;
147			status = "disabled";
148		};
149	};
150
151	pmic@3 {
152		compatible = "qcom,pm7250b", "qcom,spmi-pmic";
153		reg = <0x3 SPMI_USID>;
154		#address-cells = <1>;
155		#size-cells = <0>;
156	};
157};
158