xref: /freebsd/sys/contrib/device-tree/src/arm/qcom/qcom-pm8226.dtsi (revision 96190b4fef3b4a0cc3ca0606b0c4e3e69a5e6717)
1// SPDX-License-Identifier: BSD-3-Clause
2#include <dt-bindings/iio/qcom,spmi-vadc.h>
3#include <dt-bindings/input/linux-event-codes.h>
4#include <dt-bindings/interrupt-controller/irq.h>
5#include <dt-bindings/spmi/spmi.h>
6
7/ {
8	thermal-zones {
9		pm8226-thermal {
10			polling-delay-passive = <100>;
11			polling-delay = <0>;
12			thermal-sensors = <&pm8226_temp>;
13
14			trips {
15				trip0 {
16					temperature = <105000>;
17					hysteresis = <2000>;
18					type = "passive";
19				};
20
21				trip1 {
22					temperature = <125000>;
23					hysteresis = <2000>;
24					type = "hot";
25				};
26
27				crit {
28					temperature = <145000>;
29					hysteresis = <2000>;
30					type = "critical";
31				};
32			};
33		};
34	};
35};
36
37&spmi_bus {
38	pm8226_0: pm8226@0 {
39		compatible = "qcom,pm8226", "qcom,spmi-pmic";
40		reg = <0x0 SPMI_USID>;
41		#address-cells = <1>;
42		#size-cells = <0>;
43
44		pon@800 {
45			compatible = "qcom,pm8916-pon";
46			reg = <0x800>;
47
48			pwrkey {
49				compatible = "qcom,pm8941-pwrkey";
50				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
51				debounce = <15625>;
52				bias-pull-up;
53				linux,code = <KEY_POWER>;
54			};
55
56			pm8226_resin: resin {
57				compatible = "qcom,pm8941-resin";
58				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
59				debounce = <15625>;
60				bias-pull-up;
61				status = "disabled";
62			};
63		};
64
65		smbb: charger@1000 {
66			compatible = "qcom,pm8226-charger";
67			reg = <0x1000>;
68			interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
69				     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
70				     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
71				     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
72				     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
73				     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
74				     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
75				     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
76			interrupt-names = "chg-done",
77					  "chg-fast",
78					  "chg-trkl",
79					  "bat-temp-ok",
80					  "bat-present",
81					  "chg-gone",
82					  "usb-valid",
83					  "dc-valid";
84
85			chg_otg: otg-vbus { };
86		};
87
88		pm8226_temp: temp-alarm@2400 {
89			compatible = "qcom,spmi-temp-alarm";
90			reg = <0x2400>;
91			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
92			io-channels = <&pm8226_vadc VADC_DIE_TEMP>;
93			io-channel-names = "thermal";
94			#thermal-sensor-cells = <0>;
95		};
96
97		pm8226_vadc: adc@3100 {
98			compatible = "qcom,spmi-vadc";
99			reg = <0x3100>;
100			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
101			#address-cells = <1>;
102			#size-cells = <0>;
103			#io-channel-cells = <1>;
104
105			channel@7 {
106				reg = <VADC_VSYS>;
107				qcom,pre-scaling = <1 3>;
108				label = "vph_pwr";
109			};
110			channel@8 {
111				reg = <VADC_DIE_TEMP>;
112				label = "die_temp";
113			};
114			channel@9 {
115				reg = <VADC_REF_625MV>;
116				label = "ref_625mv";
117			};
118			channel@a {
119				reg = <VADC_REF_1250MV>;
120				label = "ref_1250mv";
121			};
122			channel@e {
123				reg = <VADC_GND_REF>;
124			};
125			channel@f {
126				reg = <VADC_VDD_VADC>;
127			};
128		};
129
130		pm8226_iadc: adc@3600 {
131			compatible = "qcom,pm8226-iadc", "qcom,spmi-iadc";
132			reg = <0x3600>;
133			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
134		};
135
136		rtc@6000 {
137			compatible = "qcom,pm8941-rtc";
138			reg = <0x6000>, <0x6100>;
139			reg-names = "rtc", "alarm";
140			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
141		};
142
143		pm8226_mpps: mpps@a000 {
144			compatible = "qcom,pm8226-mpp", "qcom,spmi-mpp";
145			reg = <0xa000>;
146			gpio-controller;
147			#gpio-cells = <2>;
148			gpio-ranges = <&pm8226_mpps 0 0 8>;
149			interrupt-controller;
150			#interrupt-cells = <2>;
151		};
152
153		pm8226_gpios: gpio@c000 {
154			compatible = "qcom,pm8226-gpio", "qcom,spmi-gpio";
155			reg = <0xc000>;
156			gpio-controller;
157			#gpio-cells = <2>;
158			gpio-ranges = <&pm8226_gpios 0 0 8>;
159			interrupt-controller;
160			#interrupt-cells = <2>;
161		};
162	};
163
164	pm8226_1: pm8226@1 {
165		compatible = "qcom,pm8226", "qcom,spmi-pmic";
166		reg = <0x1 SPMI_USID>;
167		#address-cells = <1>;
168		#size-cells = <0>;
169
170		pm8226_spmi_regulators: regulators {
171			compatible = "qcom,pm8226-regulators";
172		};
173
174		pm8226_vib: vibrator@c000 {
175			compatible = "qcom,pm8916-vib";
176			reg = <0xc000>;
177			status = "disabled";
178		};
179	};
180};
181