xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/pm8916.dtsi (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1// SPDX-License-Identifier: GPL-2.0
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&spmi_bus {
8
9	pm8916_0: pmic@0 {
10		compatible = "qcom,pm8916", "qcom,spmi-pmic";
11		reg = <0x0 SPMI_USID>;
12		#address-cells = <1>;
13		#size-cells = <0>;
14
15		pon@800 {
16			compatible = "qcom,pm8916-pon";
17			reg = <0x800>;
18			mode-bootloader = <0x2>;
19			mode-recovery = <0x1>;
20
21			pwrkey {
22				compatible = "qcom,pm8941-pwrkey";
23				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
24				debounce = <15625>;
25				bias-pull-up;
26				linux,code = <KEY_POWER>;
27			};
28
29			pm8916_resin: resin {
30				compatible = "qcom,pm8941-resin";
31				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
32				debounce = <15625>;
33				bias-pull-up;
34				status = "disabled";
35			};
36
37			watchdog {
38				compatible = "qcom,pm8916-wdt";
39				interrupts = <0x0 0x8 6 IRQ_TYPE_EDGE_RISING>;
40				timeout-sec = <60>;
41			};
42		};
43
44		pm8916_temp: temp-alarm@2400 {
45			compatible = "qcom,spmi-temp-alarm";
46			reg = <0x2400>;
47			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
48			io-channels = <&pm8916_vadc VADC_DIE_TEMP>;
49			io-channel-names = "thermal";
50			#thermal-sensor-cells = <0>;
51		};
52
53		pm8916_vadc: adc@3100 {
54			compatible = "qcom,spmi-vadc";
55			reg = <0x3100>;
56			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
57			#address-cells = <1>;
58			#size-cells = <0>;
59			#io-channel-cells = <1>;
60
61			adc-chan@0 {
62				reg = <VADC_USBIN>;
63				qcom,pre-scaling = <1 10>;
64			};
65			adc-chan@7 {
66				reg = <VADC_VSYS>;
67				qcom,pre-scaling = <1 3>;
68			};
69			adc-chan@8 {
70				reg = <VADC_DIE_TEMP>;
71			};
72			adc-chan@9 {
73				reg = <VADC_REF_625MV>;
74			};
75			adc-chan@a {
76				reg = <VADC_REF_1250MV>;
77			};
78			adc-chan@e {
79				reg = <VADC_GND_REF>;
80			};
81			adc-chan@f {
82				reg = <VADC_VDD_VADC>;
83			};
84		};
85
86		rtc@6000 {
87			compatible = "qcom,pm8941-rtc";
88			reg = <0x6000>;
89			reg-names = "rtc", "alarm";
90			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
91		};
92
93		pm8916_mpps: mpps@a000 {
94			compatible = "qcom,pm8916-mpp";
95			reg = <0xa000>;
96			gpio-controller;
97			#gpio-cells = <2>;
98			interrupts = <0 0xa0 0 IRQ_TYPE_NONE>,
99				     <0 0xa1 0 IRQ_TYPE_NONE>,
100				     <0 0xa2 0 IRQ_TYPE_NONE>,
101				     <0 0xa3 0 IRQ_TYPE_NONE>;
102		};
103
104		pm8916_gpios: gpios@c000 {
105			compatible = "qcom,pm8916-gpio";
106			reg = <0xc000>;
107			gpio-controller;
108			#gpio-cells = <2>;
109			interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
110				     <0 0xc1 0 IRQ_TYPE_NONE>,
111				     <0 0xc2 0 IRQ_TYPE_NONE>,
112				     <0 0xc3 0 IRQ_TYPE_NONE>;
113		};
114	};
115
116	pm8916_1: pmic@1 {
117		compatible = "qcom,pm8916", "qcom,spmi-pmic";
118		reg = <0x1 SPMI_USID>;
119		#address-cells = <1>;
120		#size-cells = <0>;
121
122		pm8916_vib: vibrator@c000 {
123			compatible = "qcom,pm8916-vib";
124			reg = <0xc000>;
125			status = "disabled";
126		};
127
128		wcd_codec: audio-codec@f000 {
129			compatible = "qcom,pm8916-wcd-analog-codec";
130			reg = <0xf000>;
131			reg-names = "pmic-codec-core";
132			clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
133			clock-names = "mclk";
134			interrupt-parent = <&spmi_bus>;
135			interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
136				     <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
137				     <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
138				     <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
139				     <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
140				     <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
141				     <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
142				     <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
143				     <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
144				     <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
145				     <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
146				     <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
147				     <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
148				     <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
149			interrupt-names = "cdc_spk_cnp_int",
150					  "cdc_spk_clip_int",
151					  "cdc_spk_ocp_int",
152					  "mbhc_ins_rem_det1",
153					  "mbhc_but_rel_det",
154					  "mbhc_but_press_det",
155					  "mbhc_ins_rem_det",
156					  "mbhc_switch_int",
157					  "cdc_ear_ocp_int",
158					  "cdc_hphr_ocp_int",
159					  "cdc_hphl_ocp_det",
160					  "cdc_ear_cnp_int",
161					  "cdc_hphr_cnp_int",
162					  "cdc_hphl_cnp_int";
163			vdd-cdc-io-supply = <&pm8916_l5>;
164			vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
165			vdd-micbias-supply = <&pm8916_l13>;
166			#sound-dai-cells = <1>;
167		};
168	};
169};
170