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@83 {
114				reg = <ADC5_VPH_PWR>;
115				qcom,pre-scaling = <1 3>;
116				label = "vph_pwr";
117			};
118
119			adc-chan@84 {
120				reg = <ADC5_VBAT_SNS>;
121				qcom,pre-scaling = <1 3>;
122				label = "vbat_sns";
123			};
124
125			adc-chan@99 {
126				reg = <ADC5_SBUx>;
127				qcom,pre-scaling = <1 3>;
128				label = "chg_sbux";
129			};
130		};
131
132		pm7250b_adc_tm: adc-tm@3500 {
133			compatible = "qcom,spmi-adc-tm5";
134			reg = <0x3500>;
135			interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
136			#thermal-sensor-cells = <1>;
137			#address-cells = <1>;
138			#size-cells = <0>;
139			status = "disabled";
140		};
141	};
142
143	pmic@3 {
144		compatible = "qcom,pm7250b", "qcom,spmi-pmic";
145		reg = <0x3 SPMI_USID>;
146		#address-cells = <1>;
147		#size-cells = <0>;
148	};
149};
150