xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/pm8916.dtsi (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
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: extcon@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			adc-chan@0 {
70				reg = <VADC_USBIN>;
71				qcom,pre-scaling = <1 10>;
72			};
73			adc-chan@7 {
74				reg = <VADC_VSYS>;
75				qcom,pre-scaling = <1 3>;
76			};
77			adc-chan@8 {
78				reg = <VADC_DIE_TEMP>;
79			};
80			adc-chan@9 {
81				reg = <VADC_REF_625MV>;
82			};
83			adc-chan@a {
84				reg = <VADC_REF_1250MV>;
85			};
86			adc-chan@e {
87				reg = <VADC_GND_REF>;
88			};
89			adc-chan@f {
90				reg = <VADC_VDD_VADC>;
91			};
92		};
93
94		rtc@6000 {
95			compatible = "qcom,pm8941-rtc";
96			reg = <0x6000>;
97			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
98		};
99
100		pm8916_mpps: mpps@a000 {
101			compatible = "qcom,pm8916-mpp", "qcom,spmi-mpp";
102			reg = <0xa000>;
103			gpio-controller;
104			#gpio-cells = <2>;
105			gpio-ranges = <&pm8916_mpps 0 0 4>;
106			interrupt-controller;
107			#interrupt-cells = <2>;
108		};
109
110		pm8916_gpios: gpios@c000 {
111			compatible = "qcom,pm8916-gpio", "qcom,spmi-gpio";
112			reg = <0xc000>;
113			gpio-controller;
114			gpio-ranges = <&pm8916_gpios 0 0 4>;
115			#gpio-cells = <2>;
116			interrupt-controller;
117			#interrupt-cells = <2>;
118		};
119	};
120
121	pm8916_1: pmic@1 {
122		compatible = "qcom,pm8916", "qcom,spmi-pmic";
123		reg = <0x1 SPMI_USID>;
124		#address-cells = <1>;
125		#size-cells = <0>;
126
127		pm8916_pwm: pwm {
128			compatible = "qcom,pm8916-pwm";
129
130			#pwm-cells = <2>;
131
132			status = "disabled";
133		};
134
135		pm8916_vib: vibrator@c000 {
136			compatible = "qcom,pm8916-vib";
137			reg = <0xc000>;
138			status = "disabled";
139		};
140
141		wcd_codec: audio-codec@f000 {
142			compatible = "qcom,pm8916-wcd-analog-codec";
143			reg = <0xf000>;
144			reg-names = "pmic-codec-core";
145			clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
146			clock-names = "mclk";
147			interrupt-parent = <&spmi_bus>;
148			interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
149				     <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
150				     <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
151				     <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
152				     <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
153				     <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
154				     <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
155				     <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
156				     <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
157				     <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
158				     <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
159				     <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
160				     <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
161				     <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
162			interrupt-names = "cdc_spk_cnp_int",
163					  "cdc_spk_clip_int",
164					  "cdc_spk_ocp_int",
165					  "mbhc_ins_rem_det1",
166					  "mbhc_but_rel_det",
167					  "mbhc_but_press_det",
168					  "mbhc_ins_rem_det",
169					  "mbhc_switch_int",
170					  "cdc_ear_ocp_int",
171					  "cdc_hphr_ocp_int",
172					  "cdc_hphl_ocp_det",
173					  "cdc_ear_cnp_int",
174					  "cdc_hphr_cnp_int",
175					  "cdc_hphl_cnp_int";
176			vdd-cdc-io-supply = <&pm8916_l5>;
177			vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
178			vdd-micbias-supply = <&pm8916_l13>;
179			#sound-dai-cells = <1>;
180		};
181	};
182};
183