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";
112			reg = <0xc000>;
113			gpio-controller;
114			#gpio-cells = <2>;
115			interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
116				     <0 0xc1 0 IRQ_TYPE_NONE>,
117				     <0 0xc2 0 IRQ_TYPE_NONE>,
118				     <0 0xc3 0 IRQ_TYPE_NONE>;
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_vib: vibrator@c000 {
129			compatible = "qcom,pm8916-vib";
130			reg = <0xc000>;
131			status = "disabled";
132		};
133
134		wcd_codec: audio-codec@f000 {
135			compatible = "qcom,pm8916-wcd-analog-codec";
136			reg = <0xf000>;
137			reg-names = "pmic-codec-core";
138			clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
139			clock-names = "mclk";
140			interrupt-parent = <&spmi_bus>;
141			interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
142				     <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
143				     <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
144				     <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
145				     <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
146				     <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
147				     <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
148				     <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
149				     <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
150				     <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
151				     <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
152				     <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
153				     <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
154				     <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
155			interrupt-names = "cdc_spk_cnp_int",
156					  "cdc_spk_clip_int",
157					  "cdc_spk_ocp_int",
158					  "mbhc_ins_rem_det1",
159					  "mbhc_but_rel_det",
160					  "mbhc_but_press_det",
161					  "mbhc_ins_rem_det",
162					  "mbhc_switch_int",
163					  "cdc_ear_ocp_int",
164					  "cdc_hphr_ocp_int",
165					  "cdc_hphl_ocp_det",
166					  "cdc_ear_cnp_int",
167					  "cdc_hphr_cnp_int",
168					  "cdc_hphl_cnp_int";
169			vdd-cdc-io-supply = <&pm8916_l5>;
170			vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
171			vdd-micbias-supply = <&pm8916_l13>;
172			#sound-dai-cells = <1>;
173		};
174	};
175};
176