xref: /linux/arch/arm64/boot/dts/qcom/pm8916.dtsi (revision 561add0da6d3d07c9bccb0832fb6ed5619167d26)
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_usbin: usb-detect@1300 {
45			compatible = "qcom,pm8941-misc";
46			reg = <0x1300>;
47			interrupts = <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>;
48			interrupt-names = "usb_vbus";
49			status = "disabled";
50		};
51
52		pm8916_temp: temp-alarm@2400 {
53			compatible = "qcom,spmi-temp-alarm";
54			reg = <0x2400>;
55			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
56			io-channels = <&pm8916_vadc VADC_DIE_TEMP>;
57			io-channel-names = "thermal";
58			#thermal-sensor-cells = <0>;
59		};
60
61		pm8916_vadc: adc@3100 {
62			compatible = "qcom,spmi-vadc";
63			reg = <0x3100>;
64			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
65			#address-cells = <1>;
66			#size-cells = <0>;
67			#io-channel-cells = <1>;
68
69			channel@0 {
70				reg = <VADC_USBIN>;
71				qcom,pre-scaling = <1 10>;
72			};
73			channel@7 {
74				reg = <VADC_VSYS>;
75				qcom,pre-scaling = <1 3>;
76			};
77			channel@8 {
78				reg = <VADC_DIE_TEMP>;
79			};
80			channel@9 {
81				reg = <VADC_REF_625MV>;
82			};
83			channel@a {
84				reg = <VADC_REF_1250MV>;
85			};
86			channel@e {
87				reg = <VADC_GND_REF>;
88			};
89			channel@f {
90				reg = <VADC_VDD_VADC>;
91			};
92		};
93
94		rtc@6000 {
95			compatible = "qcom,pm8941-rtc";
96			reg = <0x6000>, <0x6100>;
97			reg-names = "rtc", "alarm";
98			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
99		};
100
101		pm8916_mpps: mpps@a000 {
102			compatible = "qcom,pm8916-mpp", "qcom,spmi-mpp";
103			reg = <0xa000>;
104			gpio-controller;
105			#gpio-cells = <2>;
106			gpio-ranges = <&pm8916_mpps 0 0 4>;
107			interrupt-controller;
108			#interrupt-cells = <2>;
109		};
110
111		pm8916_gpios: gpio@c000 {
112			compatible = "qcom,pm8916-gpio", "qcom,spmi-gpio";
113			reg = <0xc000>;
114			gpio-controller;
115			gpio-ranges = <&pm8916_gpios 0 0 4>;
116			#gpio-cells = <2>;
117			interrupt-controller;
118			#interrupt-cells = <2>;
119		};
120	};
121
122	pm8916_1: pmic@1 {
123		compatible = "qcom,pm8916", "qcom,spmi-pmic";
124		reg = <0x1 SPMI_USID>;
125		#address-cells = <1>;
126		#size-cells = <0>;
127
128		pm8916_pwm: pwm {
129			compatible = "qcom,pm8916-pwm";
130
131			#pwm-cells = <2>;
132
133			status = "disabled";
134		};
135
136		pm8916_vib: vibrator@c000 {
137			compatible = "qcom,pm8916-vib";
138			reg = <0xc000>;
139			status = "disabled";
140		};
141
142		pm8916_codec: audio-codec@f000 {
143			compatible = "qcom,pm8916-wcd-analog-codec";
144			reg = <0xf000>;
145			reg-names = "pmic-codec-core";
146			clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
147			clock-names = "mclk";
148			interrupt-parent = <&spmi_bus>;
149			interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
150				     <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
151				     <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
152				     <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
153				     <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
154				     <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
155				     <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
156				     <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
157				     <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
158				     <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
159				     <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
160				     <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
161				     <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
162				     <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
163			interrupt-names = "cdc_spk_cnp_int",
164					  "cdc_spk_clip_int",
165					  "cdc_spk_ocp_int",
166					  "mbhc_ins_rem_det1",
167					  "mbhc_but_rel_det",
168					  "mbhc_but_press_det",
169					  "mbhc_ins_rem_det",
170					  "mbhc_switch_int",
171					  "cdc_ear_ocp_int",
172					  "cdc_hphr_ocp_int",
173					  "cdc_hphl_ocp_det",
174					  "cdc_ear_cnp_int",
175					  "cdc_hphr_cnp_int",
176					  "cdc_hphl_cnp_int";
177			#sound-dai-cells = <1>;
178			status = "disabled";
179		};
180	};
181};
182