• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
90		};
91
92		pm8916_mpps: mpps@a000 {
93			compatible = "qcom,pm8916-mpp";
94			reg = <0xa000>;
95			gpio-controller;
96			#gpio-cells = <2>;
97			interrupts = <0 0xa0 0 IRQ_TYPE_NONE>,
98				     <0 0xa1 0 IRQ_TYPE_NONE>,
99				     <0 0xa2 0 IRQ_TYPE_NONE>,
100				     <0 0xa3 0 IRQ_TYPE_NONE>;
101		};
102
103		pm8916_gpios: gpios@c000 {
104			compatible = "qcom,pm8916-gpio";
105			reg = <0xc000>;
106			gpio-controller;
107			#gpio-cells = <2>;
108			interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
109				     <0 0xc1 0 IRQ_TYPE_NONE>,
110				     <0 0xc2 0 IRQ_TYPE_NONE>,
111				     <0 0xc3 0 IRQ_TYPE_NONE>;
112		};
113	};
114
115	pm8916_1: pmic@1 {
116		compatible = "qcom,pm8916", "qcom,spmi-pmic";
117		reg = <0x1 SPMI_USID>;
118		#address-cells = <1>;
119		#size-cells = <0>;
120
121		pm8916_vib: vibrator@c000 {
122			compatible = "qcom,pm8916-vib";
123			reg = <0xc000>;
124			status = "disabled";
125		};
126
127		wcd_codec: audio-codec@f000 {
128			compatible = "qcom,pm8916-wcd-analog-codec";
129			reg = <0xf000>;
130			reg-names = "pmic-codec-core";
131			clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
132			clock-names = "mclk";
133			interrupt-parent = <&spmi_bus>;
134			interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
135				     <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
136				     <0x1 0xf0 0x2 IRQ_TYPE_NONE>,
137				     <0x1 0xf0 0x3 IRQ_TYPE_NONE>,
138				     <0x1 0xf0 0x4 IRQ_TYPE_NONE>,
139				     <0x1 0xf0 0x5 IRQ_TYPE_NONE>,
140				     <0x1 0xf0 0x6 IRQ_TYPE_NONE>,
141				     <0x1 0xf0 0x7 IRQ_TYPE_NONE>,
142				     <0x1 0xf1 0x0 IRQ_TYPE_NONE>,
143				     <0x1 0xf1 0x1 IRQ_TYPE_NONE>,
144				     <0x1 0xf1 0x2 IRQ_TYPE_NONE>,
145				     <0x1 0xf1 0x3 IRQ_TYPE_NONE>,
146				     <0x1 0xf1 0x4 IRQ_TYPE_NONE>,
147				     <0x1 0xf1 0x5 IRQ_TYPE_NONE>;
148			interrupt-names = "cdc_spk_cnp_int",
149					  "cdc_spk_clip_int",
150					  "cdc_spk_ocp_int",
151					  "mbhc_ins_rem_det1",
152					  "mbhc_but_rel_det",
153					  "mbhc_but_press_det",
154					  "mbhc_ins_rem_det",
155					  "mbhc_switch_int",
156					  "cdc_ear_ocp_int",
157					  "cdc_hphr_ocp_int",
158					  "cdc_hphl_ocp_det",
159					  "cdc_ear_cnp_int",
160					  "cdc_hphr_cnp_int",
161					  "cdc_hphl_cnp_int";
162			vdd-cdc-io-supply = <&pm8916_l5>;
163			vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>;
164			vdd-micbias-supply = <&pm8916_l13>;
165			#sound-dai-cells = <1>;
166		};
167	};
168};
169