GNU Linux-libre 6.1.90-gnu
[releases.git] / arch / arm64 / boot / dts / qcom / pm7250b.dtsi
1 // SPDX-License-Identifier: BSD-3-Clause
2 /*
3  * Copyright (C) 2022 Luca Weiss <luca.weiss@fairphone.com>
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                 pm7250b-thermal {
13                         polling-delay-passive = <100>;
14                         polling-delay = <0>;
15
16                         thermal-sensors = <&pm7250b_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 = <145000>;
33                                         hysteresis = <0>;
34                                         type = "critical";
35                                 };
36                         };
37                 };
38         };
39 };
40
41 &spmi_bus {
42         pmic@2 {
43                 compatible = "qcom,pm7250b", "qcom,spmi-pmic";
44                 reg = <0x2 SPMI_USID>;
45                 #address-cells = <1>;
46                 #size-cells = <0>;
47
48                 pm7250b_temp: temp-alarm@2400 {
49                         compatible = "qcom,spmi-temp-alarm";
50                         reg = <0x2400>;
51                         interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
52                         io-channels = <&pm7250b_adc ADC5_DIE_TEMP>;
53                         io-channel-names = "thermal";
54                         #thermal-sensor-cells = <0>;
55                 };
56
57                 pm7250b_adc: adc@3100 {
58                         compatible = "qcom,spmi-adc5";
59                         reg = <0x3100>;
60                         #address-cells = <1>;
61                         #size-cells = <0>;
62                         #io-channel-cells = <1>;
63                         interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
64
65                         adc-chan@0 {
66                                 reg = <ADC5_REF_GND>;
67                                 qcom,pre-scaling = <1 1>;
68                                 label = "ref_gnd";
69                         };
70
71                         adc-chan@1 {
72                                 reg = <ADC5_1P25VREF>;
73                                 qcom,pre-scaling = <1 1>;
74                                 label = "vref_1p25";
75                         };
76
77                         adc-chan@2 {
78                                 reg = <ADC5_DIE_TEMP>;
79                                 qcom,pre-scaling = <1 1>;
80                                 label = "die_temp";
81                         };
82
83                         adc-chan@7 {
84                                 reg = <ADC5_USB_IN_I>;
85                                 qcom,pre-scaling = <1 1>;
86                                 label = "usb_in_i_uv";
87                         };
88
89                         adc-chan@8 {
90                                 reg = <ADC5_USB_IN_V_16>;
91                                 qcom,pre-scaling = <1 16>;
92                                 label = "usb_in_v_div_16";
93                         };
94
95                         adc-chan@9 {
96                                 reg = <ADC5_CHG_TEMP>;
97                                 qcom,pre-scaling = <1 1>;
98                                 label = "chg_temp";
99                         };
100
101                         adc-chan@e {
102                                 reg = <ADC5_AMUX_THM2>;
103                                 qcom,hw-settle-time = <200>;
104                                 qcom,pre-scaling = <1 1>;
105                                 label = "smb1390_therm";
106                         };
107
108                         adc-chan@1e {
109                                 reg = <ADC5_MID_CHG_DIV6>;
110                                 qcom,pre-scaling = <1 6>;
111                                 label = "chg_mid";
112                         };
113
114                         adc-chan@83 {
115                                 reg = <ADC5_VPH_PWR>;
116                                 qcom,pre-scaling = <1 3>;
117                                 label = "vph_pwr";
118                         };
119
120                         adc-chan@84 {
121                                 reg = <ADC5_VBAT_SNS>;
122                                 qcom,pre-scaling = <1 3>;
123                                 label = "vbat_sns";
124                         };
125
126                         adc-chan@99 {
127                                 reg = <ADC5_SBUx>;
128                                 qcom,pre-scaling = <1 3>;
129                                 label = "chg_sbux";
130                         };
131                 };
132
133                 pm7250b_adc_tm: adc-tm@3500 {
134                         compatible = "qcom,spmi-adc-tm5";
135                         reg = <0x3500>;
136                         interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
137                         #thermal-sensor-cells = <1>;
138                         #address-cells = <1>;
139                         #size-cells = <0>;
140                         status = "disabled";
141                 };
142         };
143
144         pmic@3 {
145                 compatible = "qcom,pm7250b", "qcom,spmi-pmic";
146                 reg = <0x3 SPMI_USID>;
147                 #address-cells = <1>;
148                 #size-cells = <0>;
149         };
150 };