1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright 2012 Linaro Ltd
4 */
5
6#include <dt-bindings/clock/ste-ab8500.h>
7
8/ {
9	/* Essential housekeeping hardware monitors */
10	iio-hwmon {
11		compatible = "iio-hwmon";
12		io-channels = <&gpadc 0x02>, /* Battery temperature */
13			      <&gpadc 0x08>, /* Main battery voltage */
14			      <&gpadc 0x09>, /* VBUS */
15			      <&gpadc 0x0b>, /* Charger current */
16			      <&gpadc 0x0c>, /* Backup battery voltage */
17			      <&gpadc 0x0d>; /* Die temperature */
18	};
19
20	soc {
21		prcmu@80157000 {
22			ab8505 {
23				compatible = "stericsson,ab8505";
24				interrupt-parent = <&intc>;
25				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
26				interrupt-controller;
27				#interrupt-cells = <2>;
28
29				ab8500_clock: clock-controller {
30					compatible = "stericsson,ab8500-clk";
31					#clock-cells = <1>;
32				};
33
34				ab8505_gpio: ab8505-gpiocontroller {
35					compatible = "stericsson,ab8505-gpio";
36					gpio-controller;
37					#gpio-cells = <2>;
38				};
39
40				ab8500-rtc {
41					compatible = "stericsson,ab8500-rtc";
42					interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
43						     <18 IRQ_TYPE_LEVEL_HIGH>;
44					interrupt-names = "60S", "ALARM";
45				};
46
47				gpadc: ab8500-gpadc {
48					compatible = "stericsson,ab8500-gpadc";
49					interrupts = <39 IRQ_TYPE_LEVEL_HIGH>;
50					interrupt-names = "SW_CONV_END";
51					vddadc-supply = <&ab8500_ldo_adc_reg>;
52					#address-cells = <1>;
53					#size-cells = <0>;
54					#io-channel-cells = <1>;
55
56					/* GPADC channels */
57					bat_ctrl: channel@1 {
58						reg = <0x01>;
59					};
60					btemp_ball: channel@2 {
61						reg = <0x02>;
62					};
63					acc_detect1: channel@4 {
64						reg = <0x04>;
65					};
66					acc_detect2: channel@5 {
67						reg = <0x05>;
68					};
69					adc_aux1: channel@6 {
70						reg = <0x06>;
71					};
72					adc_aux2: channel@7 {
73						reg = <0x07>;
74					};
75					main_batt_v: channel@8 {
76						reg = <0x08>;
77					};
78					vbus_v: channel@9 {
79						reg = <0x09>;
80					};
81					charger_c: channel@b {
82						reg = <0x0b>;
83					};
84					bk_bat_v: channel@c {
85						reg = <0x0c>;
86					};
87					die_temp: channel@d {
88						reg = <0x0d>;
89					};
90					usb_id: channel@e {
91						reg = <0x0e>;
92					};
93				};
94
95				ab8500_fg {
96					status = "disabled";
97					compatible = "stericsson,ab8500-fg";
98					interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
99						     <8 IRQ_TYPE_LEVEL_HIGH>,
100						     <28 IRQ_TYPE_LEVEL_HIGH>,
101						     <27 IRQ_TYPE_LEVEL_HIGH>,
102						     <26 IRQ_TYPE_LEVEL_HIGH>;
103					interrupt-names = "NCONV_ACCU",
104							  "BATT_OVV",
105							  "LOW_BAT_F",
106							  "CC_INT_CALIB",
107							  "CCEOC";
108					monitored-battery = <&battery>;
109					io-channels = <&gpadc 0x08>;
110					io-channel-names = "main_bat_v";
111				};
112
113				ab8500_btemp {
114					status = "disabled";
115					compatible = "stericsson,ab8500-btemp";
116					interrupts = <20 IRQ_TYPE_LEVEL_HIGH>,
117						     <80 IRQ_TYPE_LEVEL_HIGH>,
118						     <83 IRQ_TYPE_LEVEL_HIGH>,
119						     <81 IRQ_TYPE_LEVEL_HIGH>,
120						     <82 IRQ_TYPE_LEVEL_HIGH>;
121					interrupt-names = "BAT_CTRL_INDB",
122							  "BTEMP_LOW",
123							  "BTEMP_HIGH",
124							  "BTEMP_LOW_MEDIUM",
125							  "BTEMP_MEDIUM_HIGH";
126					monitored-battery = <&battery>;
127					io-channels = <&gpadc 0x02>,
128						      <&gpadc 0x01>;
129					io-channel-names = "btemp_ball",
130							  "bat_ctrl";
131				};
132
133				ab8500_charger {
134					status = "disabled";
135					compatible = "stericsson,ab8500-charger";
136					interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
137						     <11 IRQ_TYPE_LEVEL_HIGH>,
138						     <0 IRQ_TYPE_LEVEL_HIGH>,
139						     <107 IRQ_TYPE_LEVEL_HIGH>,
140						     <106 IRQ_TYPE_LEVEL_HIGH>,
141						     <14 IRQ_TYPE_LEVEL_HIGH>,
142						     <15 IRQ_TYPE_LEVEL_HIGH>,
143						     <79 IRQ_TYPE_LEVEL_HIGH>,
144						     <105 IRQ_TYPE_LEVEL_HIGH>,
145						     <104 IRQ_TYPE_LEVEL_HIGH>,
146						     <89 IRQ_TYPE_LEVEL_HIGH>,
147						     <22 IRQ_TYPE_LEVEL_HIGH>,
148						     <21 IRQ_TYPE_LEVEL_HIGH>,
149						     <16 IRQ_TYPE_LEVEL_HIGH>;
150					interrupt-names = "MAIN_CH_UNPLUG_DET",
151							  "MAIN_CHARGE_PLUG_DET",
152							  "MAIN_EXT_CH_NOT_OK",
153							  "MAIN_CH_TH_PROT_R",
154							  "MAIN_CH_TH_PROT_F",
155							  "VBUS_DET_F",
156							  "VBUS_DET_R",
157							  "USB_LINK_STATUS",
158							  "USB_CH_TH_PROT_R",
159							  "USB_CH_TH_PROT_F",
160							  "USB_CHARGER_NOT_OKR",
161							  "VBUS_OVV",
162							  "CH_WD_EXP",
163							  "VBUS_CH_DROP_END";
164					monitored-battery = <&battery>;
165					vddadc-supply = <&ab8500_ldo_adc_reg>;
166					io-channels = <&gpadc 0x09>,
167						      <&gpadc 0x0b>;
168					io-channel-names = "vbus_v",
169							  "usb_charger_c";
170				};
171
172				ab8500_chargalg {
173					status = "disabled";
174					compatible = "stericsson,ab8500-chargalg";
175					monitored-battery = <&battery>;
176				};
177
178				ab8500_usb: ab8500_usb {
179					compatible = "stericsson,ab8500-usb";
180					interrupts = <90 IRQ_TYPE_LEVEL_HIGH>,
181						     <96 IRQ_TYPE_LEVEL_HIGH>,
182						     <14 IRQ_TYPE_LEVEL_HIGH>,
183						     <15 IRQ_TYPE_LEVEL_HIGH>,
184						     <79 IRQ_TYPE_LEVEL_HIGH>,
185						     <74 IRQ_TYPE_LEVEL_HIGH>,
186						     <75 IRQ_TYPE_LEVEL_HIGH>;
187					interrupt-names = "ID_WAKEUP_R",
188							  "ID_WAKEUP_F",
189							  "VBUS_DET_F",
190							  "VBUS_DET_R",
191							  "USB_LINK_STATUS",
192							  "USB_ADP_PROBE_PLUG",
193							  "USB_ADP_PROBE_UNPLUG";
194					vddulpivio18-supply = <&ab8500_ldo_intcore_reg>;
195					v-ape-supply = <&db8500_vape_reg>;
196					musb_1v8-supply = <&db8500_vsmps2_reg>;
197					clocks = <&prcmu_clk PRCMU_SYSCLK>;
198					clock-names = "sysclk";
199					#phy-cells = <0>;
200				};
201
202				ab8500-ponkey {
203					compatible = "stericsson,ab8500-poweron-key";
204					interrupts = <6 IRQ_TYPE_LEVEL_HIGH>,
205						     <7 IRQ_TYPE_LEVEL_HIGH>;
206					interrupt-names = "ONKEY_DBF", "ONKEY_DBR";
207				};
208
209				ab8500-sysctrl {
210					compatible = "stericsson,ab8500-sysctrl";
211				};
212
213				ab8500-pwm {
214					compatible = "stericsson,ab8500-pwm";
215					clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
216					clock-names = "intclk";
217				};
218
219				ab8500-debugfs {
220					compatible = "stericsson,ab8500-debug";
221				};
222
223				codec: ab8500-codec {
224					compatible = "stericsson,ab8500-codec";
225
226					V-AUD-supply = <&ab8500_ldo_audio_reg>;
227					V-AMIC1-supply = <&ab8500_ldo_anamic1_reg>;
228					V-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;
229
230					clocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;
231					clock-names = "audioclk";
232
233					stericsson,earpeice-cmv = <950>; /* Units in mV. */
234				};
235
236				ab8505-regulators {
237					compatible = "stericsson,ab8505-regulator";
238
239					ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
240						regulator-min-microvolt = <2800000>;
241						regulator-max-microvolt = <3300000>;
242					};
243
244					ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
245						regulator-min-microvolt = <1100000>;
246						regulator-max-microvolt = <3300000>;
247					};
248
249					ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
250						regulator-min-microvolt = <1100000>;
251						regulator-max-microvolt = <3300000>;
252					};
253
254					ab8500_ldo_aux4_reg: ab8500_ldo_aux4 {
255						regulator-min-microvolt = <1100000>;
256						regulator-max-microvolt = <3300000>;
257					};
258
259					ab8500_ldo_aux5_reg: ab8500_ldo_aux5 {
260						regulator-min-microvolt = <1050000>;
261						regulator-max-microvolt = <2790000>;
262					};
263
264					ab8500_ldo_aux6_reg: ab8500_ldo_aux6 {
265						regulator-min-microvolt = <1050000>;
266						regulator-max-microvolt = <2790000>;
267					};
268
269					// supply for v-intcore12; VINTCORE12 LDO
270					ab8500_ldo_intcore_reg: ab8500_ldo_intcore {
271						regulator-min-microvolt = <1250000>;
272						regulator-max-microvolt = <1350000>;
273					};
274
275					// supply for gpadc; ADC LDO
276					ab8500_ldo_adc_reg: ab8500_ldo_adc {
277					};
278
279					// supply for ab8500-vaudio; VAUDIO LDO
280					ab8500_ldo_audio_reg: ab8500_ldo_audio {
281					};
282
283					// supply for v-anamic1 VAMIC1 LDO
284					ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
285					};
286
287					// supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1
288					ab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {
289					};
290
291					// supply for v-aux8; VAUX8 LDO
292					ab8500_ldo_aux8_reg: ab8500_ldo_aux8 {
293					};
294
295					// supply for U8500 CSI/DSI; VANA LDO
296					ab8500_ldo_ana_reg: ab8500_ldo_ana {
297					};
298				};
299			};
300		};
301
302		sound {
303			stericsson,audio-codec = <&codec>;
304			clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
305			clock-names = "sysclk", "ulpclk", "intclk";
306		};
307
308		mcde@a0350000 {
309			vana-supply = <&ab8500_ldo_ana_reg>;
310
311			dsi@a0351000 {
312				vana-supply = <&ab8500_ldo_ana_reg>;
313			};
314			dsi@a0352000 {
315				vana-supply = <&ab8500_ldo_ana_reg>;
316			};
317			dsi@a0353000 {
318				vana-supply = <&ab8500_ldo_ana_reg>;
319			};
320		};
321
322		usb_per5@a03e0000 {
323			phys = <&ab8500_usb>;
324			phy-names = "usb";
325		};
326	};
327};
328