xref: /linux/scripts/dtc/include-prefixes/arm/qcom/pm8921.dtsi (revision bd05d27e076430326263a59bef2770da4eccce38)
1// SPDX-License-Identifier: GPL-2.0
2
3&ssbi {
4	pm8921: pmic {
5		compatible = "qcom,pm8921";
6		#interrupt-cells = <2>;
7		interrupt-controller;
8		#address-cells = <1>;
9		#size-cells = <0>;
10
11		pwrkey@1c {
12			compatible = "qcom,pm8921-pwrkey";
13			reg = <0x1c>;
14			interrupts-extended = <&pm8921 50 IRQ_TYPE_EDGE_RISING>,
15					      <&pm8921 51 IRQ_TYPE_EDGE_RISING>;
16			debounce = <15625>;
17			pull-up;
18		};
19
20		pm8921_mpps: mpps@50 {
21			compatible = "qcom,pm8921-mpp",
22				     "qcom,ssbi-mpp";
23			reg = <0x50>;
24			gpio-controller;
25			#gpio-cells = <2>;
26			gpio-ranges = <&pm8921_mpps 0 0 12>;
27			interrupt-controller;
28			#interrupt-cells = <2>;
29		};
30
31		rtc@11d {
32			compatible = "qcom,pm8921-rtc";
33			reg = <0x11d>;
34			interrupts-extended = <&pm8921 39 IRQ_TYPE_EDGE_RISING>;
35			allow-set-time;
36		};
37
38		pm8921_keypad: keypad@148 {
39			compatible = "qcom,pm8921-keypad";
40			reg = <0x148>;
41			interrupts-extended = <&pm8921 74 IRQ_TYPE_EDGE_RISING>,
42					      <&pm8921 75 IRQ_TYPE_EDGE_RISING>;
43			debounce = <15>;
44			scan-delay = <32>;
45			row-hold = <91500>;
46		};
47
48		pm8921_gpio: gpio@150 {
49
50			compatible = "qcom,pm8921-gpio",
51				     "qcom,ssbi-gpio";
52			reg = <0x150>;
53			interrupt-controller;
54			#interrupt-cells = <2>;
55			gpio-controller;
56			gpio-ranges = <&pm8921_gpio 0 0 44>;
57			#gpio-cells = <2>;
58
59		};
60
61		pm8921_xoadc: xoadc@197 {
62			compatible = "qcom,pm8921-adc";
63			reg = <0x197>;
64			interrupts-extended = <&pm8921 78 IRQ_TYPE_EDGE_RISING>;
65			#address-cells = <2>;
66			#size-cells = <0>;
67			#io-channel-cells = <2>;
68
69			vcoin: adc-channel@0 {
70				reg = <0x00 0x00>;
71			};
72
73			vbat: adc-channel@1 {
74				reg = <0x00 0x01>;
75			};
76
77			dcin: adc-channel@2 {
78				reg = <0x00 0x02>;
79			};
80
81			vph_pwr: adc-channel@4 {
82				reg = <0x00 0x04>;
83			};
84
85			batt_therm: adc-channel@8 {
86				reg = <0x00 0x08>;
87			};
88
89			batt_id: adc-channel@9 {
90				reg = <0x00 0x09>;
91			};
92
93			usb_vbus: adc-channel@a {
94				reg = <0x00 0x0a>;
95			};
96
97			die_temp: adc-channel@b {
98				reg = <0x00 0x0b>;
99			};
100
101			ref_625mv: adc-channel@c {
102				reg = <0x00 0x0c>;
103			};
104
105			ref_1250mv: adc-channel@d {
106				reg = <0x00 0x0d>;
107			};
108
109			chg_temp: adc-channel@e {
110				reg = <0x00 0x0e>;
111			};
112
113			ref_muxoff: adc-channel@f {
114				reg = <0x00 0x0f>;
115			};
116		};
117	};
118};
119
120/ {
121	/*
122	 * These channels from the ADC are simply hardware monitors.
123	 * That is why the ADC is referred to as "HKADC" - HouseKeeping
124	 * ADC.
125	 */
126	iio-hwmon {
127		compatible = "iio-hwmon";
128		io-channels = <&pm8921_xoadc 0x00 0x01>, /* Battery */
129			      <&pm8921_xoadc 0x00 0x02>, /* DC in (charger) */
130			      <&pm8921_xoadc 0x00 0x04>, /* VPH the main system voltage */
131			      <&pm8921_xoadc 0x00 0x0b>, /* Die temperature */
132			      <&pm8921_xoadc 0x00 0x0c>, /* Reference voltage 1.25V */
133			      <&pm8921_xoadc 0x00 0x0d>, /* Reference voltage 0.625V */
134			      <&pm8921_xoadc 0x00 0x0e>; /* Charger temperature */
135	};
136};
137