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