xref: /linux/arch/arm64/boot/dts/qcom/pmi632.dtsi (revision 7255fcc80d4b525cc10cfaaf7f485830d4ed2000)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (C) 2023 Luca Weiss <luca@z3ntu.xyz>
4 */
5
6#include <dt-bindings/iio/qcom,spmi-vadc.h>
7#include <dt-bindings/interrupt-controller/irq.h>
8#include <dt-bindings/spmi/spmi.h>
9
10/ {
11	thermal-zones {
12		pmi632-thermal {
13			polling-delay-passive = <100>;
14			polling-delay = <0>;
15
16			thermal-sensors = <&pmi632_temp>;
17
18			trips {
19				trip0 {
20					temperature = <95000>;
21					hysteresis = <0>;
22					type = "passive";
23				};
24
25				trip1 {
26					temperature = <115000>;
27					hysteresis = <0>;
28					type = "hot";
29				};
30
31				trip2 {
32					temperature = <125000>;
33					hysteresis = <0>;
34					type = "critical";
35				};
36			};
37		};
38	};
39};
40
41&spmi_bus {
42	pmic@2 {
43		compatible = "qcom,pmi632", "qcom,spmi-pmic";
44		reg = <0x2 SPMI_USID>;
45		#address-cells = <1>;
46		#size-cells = <0>;
47
48		pmi632_vbus: usb-vbus-regulator@1100 {
49			compatible = "qcom,pmi632-vbus-reg", "qcom,pm8150b-vbus-reg";
50			reg = <0x1100>;
51			status = "disabled";
52		};
53
54		pmi632_typec: typec@1500 {
55			compatible = "qcom,pmi632-typec";
56			reg = <0x1500>;
57			interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>,
58				     <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>,
59				     <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>,
60				     <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>,
61				     <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>,
62				     <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>,
63				     <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>,
64				     <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>;
65			interrupt-names = "or-rid-detect-change",
66					  "vpd-detect",
67					  "cc-state-change",
68					  "vconn-oc",
69					  "vbus-change",
70					  "attach-detach",
71					  "legacy-cable-detect",
72					  "try-snk-src-detect";
73			vdd-vbus-supply = <&pmi632_vbus>;
74
75			status = "disabled";
76		};
77
78		pmi632_temp: temp-alarm@2400 {
79			compatible = "qcom,spmi-temp-alarm";
80			reg = <0x2400>;
81			interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
82			#thermal-sensor-cells = <0>;
83		};
84
85		pmi632_adc: adc@3100 {
86			compatible = "qcom,spmi-adc5";
87			reg = <0x3100>;
88			#address-cells = <1>;
89			#size-cells = <0>;
90			#io-channel-cells = <1>;
91			interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
92
93			channel@0 {
94				reg = <ADC5_REF_GND>;
95				qcom,pre-scaling = <1 1>;
96				label = "ref_gnd";
97			};
98
99			channel@1 {
100				reg = <ADC5_1P25VREF>;
101				qcom,pre-scaling = <1 1>;
102				label = "vref_1p25";
103			};
104
105			channel@6 {
106				reg = <ADC5_DIE_TEMP>;
107				qcom,pre-scaling = <1 1>;
108				label = "die_temp";
109			};
110
111			channel@7 {
112				reg = <ADC5_USB_IN_I>;
113				qcom,pre-scaling = <1 1>;
114				label = "usb_in_i_uv";
115			};
116
117			channel@8 {
118				reg = <ADC5_USB_IN_V_16>;
119				qcom,pre-scaling = <1 16>;
120				label = "usb_in_v_div_16";
121			};
122
123			channel@9 {
124				reg = <ADC5_CHG_TEMP>;
125				qcom,pre-scaling = <1 1>;
126				label = "chg_temp";
127			};
128
129			channel@4b {
130				reg = <ADC5_BAT_ID_100K_PU>;
131				qcom,hw-settle-time = <200>;
132				qcom,pre-scaling = <1 1>;
133				qcom,ratiometric;
134				label = "bat_id";
135			};
136
137			channel@83 {
138				reg = <ADC5_VPH_PWR>;
139				qcom,pre-scaling = <1 3>;
140				label = "vph_pwr";
141			};
142
143			channel@84 {
144				reg = <ADC5_VBAT_SNS>;
145				qcom,pre-scaling = <1 3>;
146				label = "vbat_sns";
147			};
148		};
149
150		pmi632_adc_tm: adc-tm@3500 {
151			compatible = "qcom,spmi-adc-tm5";
152			reg = <0x3500>;
153			interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
154			#thermal-sensor-cells = <1>;
155			#address-cells = <1>;
156			#size-cells = <0>;
157			status = "disabled";
158		};
159
160		pmi632_pbs_client3: pbs@7400 {
161			compatible = "qcom,pmi632-pbs", "qcom,pbs";
162			reg = <0x7400>;
163		};
164
165		pmi632_sdam_7: nvram@b600 {
166			compatible = "qcom,spmi-sdam";
167			reg = <0xb600>;
168			#address-cells = <1>;
169			#size-cells = <1>;
170			ranges = <0 0xb600 0x100>;
171		};
172
173		pmi632_gpios: gpio@c000 {
174			compatible = "qcom,pmi632-gpio", "qcom,spmi-gpio";
175			reg = <0xc000>;
176			gpio-controller;
177			gpio-ranges = <&pmi632_gpios 0 0 8>;
178			#gpio-cells = <2>;
179			interrupt-controller;
180			#interrupt-cells = <2>;
181		};
182	};
183
184	pmic@3 {
185		compatible = "qcom,pmi632", "qcom,spmi-pmic";
186		reg = <0x3 SPMI_USID>;
187		#address-cells = <1>;
188		#size-cells = <0>;
189
190		pmi632_lpg: pwm {
191			compatible = "qcom,pmi632-lpg";
192
193			nvmem = <&pmi632_sdam_7>;
194			nvmem-names = "lpg_chan_sdam";
195			qcom,pbs = <&pmi632_pbs_client3>;
196
197			#address-cells = <1>;
198			#size-cells = <0>;
199			#pwm-cells = <2>;
200
201			status = "disabled";
202		};
203	};
204};
205