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