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 0x03>, /* Main charger voltage */
14			    <&gpadc 0x08>, /* Main battery voltage */
15			    <&gpadc 0x09>, /* VBUS */
16			    <&gpadc 0x0a>, /* Main charger current */
17			    <&gpadc 0x0b>, /* USB charger current */
18			    <&gpadc 0x0c>, /* Backup battery voltage */
19			    <&gpadc 0x0d>, /* Die temperature */
20			    <&gpadc 0x12>; /* Crystal temperature */
21	};
22
23	soc {
24		prcmu@80157000 {
25			ab8500 {
26				compatible = "stericsson,ab8500";
27				interrupt-parent = <&intc>;
28				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
29				interrupt-controller;
30				#interrupt-cells = <2>;
31
32				ab8500_clock: clock-controller {
33					compatible = "stericsson,ab8500-clk";
34					#clock-cells = <1>;
35				};
36
37				ab8500_gpio: ab8500-gpio {
38					compatible = "stericsson,ab8500-gpio";
39					gpio-controller;
40					#gpio-cells = <2>;
41				};
42
43				ab8500-rtc {
44					compatible = "stericsson,ab8500-rtc";
45					interrupts = <17 IRQ_TYPE_LEVEL_HIGH
46						      18 IRQ_TYPE_LEVEL_HIGH>;
47					interrupt-names = "60S", "ALARM";
48				};
49
50				gpadc: ab8500-gpadc {
51					compatible = "stericsson,ab8500-gpadc";
52					interrupts = <32 IRQ_TYPE_LEVEL_HIGH
53						      39 IRQ_TYPE_LEVEL_HIGH>;
54					interrupt-names = "HW_CONV_END", "SW_CONV_END";
55					vddadc-supply = <&ab8500_ldo_tvout_reg>;
56					#address-cells = <1>;
57					#size-cells = <0>;
58					#io-channel-cells = <1>;
59
60					/* GPADC channels */
61					bat_ctrl: channel@01 {
62						reg = <0x01>;
63					};
64					btemp_ball: channel@02 {
65						reg = <0x02>;
66					};
67					main_charger_v: channel@03 {
68						reg = <0x03>;
69					};
70					acc_detect1: channel@04 {
71						reg = <0x04>;
72					};
73					acc_detect2: channel@05 {
74						reg = <0x05>;
75					};
76					adc_aux1: channel@06 {
77						reg = <0x06>;
78					};
79					adc_aux2: channel@07 {
80						reg = <0x07>;
81					};
82					main_batt_v: channel@08 {
83						reg = <0x08>;
84					};
85					vbus_v: channel@09 {
86						reg = <0x09>;
87					};
88					main_charger_c: channel@0a {
89						reg = <0x0a>;
90					};
91					usb_charger_c: channel@0b {
92						reg = <0x0b>;
93					};
94					bk_bat_v: channel@0c {
95						reg = <0x0c>;
96					};
97					die_temp: channel@0d {
98						reg = <0x0d>;
99					};
100					usb_id: channel@0e {
101						reg = <0x0e>;
102					};
103					xtal_temp: channel@12 {
104						reg = <0x12>;
105					};
106					vbat_true_meas: channel@13 {
107						reg = <0x13>;
108					};
109					bat_ctrl_and_ibat: channel@1c {
110						reg = <0x1c>;
111					};
112					vbat_meas_and_ibat: channel@1d {
113						reg = <0x1d>;
114					};
115					vbat_true_meas_and_ibat: channel@1e {
116						reg = <0x1e>;
117					};
118					bat_temp_and_ibat: channel@1f {
119						reg = <0x1f>;
120					};
121				};
122
123				ab8500_temp {
124					compatible = "stericsson,abx500-temp";
125					io-channels = <&gpadc 0x06>,
126						      <&gpadc 0x07>;
127					io-channel-name = "aux1", "aux2";
128				};
129
130				ab8500_battery: ab8500_battery {
131					stericsson,battery-type = "LIPO";
132					thermistor-on-batctrl;
133				};
134
135				ab8500_fg {
136					compatible = "stericsson,ab8500-fg";
137					battery	   = <&ab8500_battery>;
138					io-channels = <&gpadc 0x08>;
139					io-channel-name = "main_bat_v";
140				};
141
142				ab8500_btemp {
143					compatible = "stericsson,ab8500-btemp";
144					battery	   = <&ab8500_battery>;
145					io-channels = <&gpadc 0x02>,
146						      <&gpadc 0x01>;
147					io-channel-name = "btemp_ball",
148							"bat_ctrl";
149				};
150
151				ab8500_charger {
152					compatible	= "stericsson,ab8500-charger";
153					battery		= <&ab8500_battery>;
154					vddadc-supply	= <&ab8500_ldo_tvout_reg>;
155					io-channels = <&gpadc 0x03>,
156						      <&gpadc 0x0a>,
157						      <&gpadc 0x09>,
158						      <&gpadc 0x0b>;
159					io-channel-name = "main_charger_v",
160							"main_charger_c",
161							"vbus_v",
162							"usb_charger_c";
163				};
164
165				ab8500_chargalg {
166					compatible	= "stericsson,ab8500-chargalg";
167					battery		= <&ab8500_battery>;
168				};
169
170				ab8500_usb {
171					compatible = "stericsson,ab8500-usb";
172					interrupts = < 90 IRQ_TYPE_LEVEL_HIGH
173						       96 IRQ_TYPE_LEVEL_HIGH
174						       14 IRQ_TYPE_LEVEL_HIGH
175						       15 IRQ_TYPE_LEVEL_HIGH
176						       79 IRQ_TYPE_LEVEL_HIGH
177						       74 IRQ_TYPE_LEVEL_HIGH
178						       75 IRQ_TYPE_LEVEL_HIGH>;
179					interrupt-names = "ID_WAKEUP_R",
180							  "ID_WAKEUP_F",
181							  "VBUS_DET_F",
182							  "VBUS_DET_R",
183							  "USB_LINK_STATUS",
184							  "USB_ADP_PROBE_PLUG",
185							  "USB_ADP_PROBE_UNPLUG";
186					vddulpivio18-supply = <&ab8500_ldo_intcore_reg>;
187					v-ape-supply = <&db8500_vape_reg>;
188					musb_1v8-supply = <&db8500_vsmps2_reg>;
189					clocks = <&prcmu_clk PRCMU_SYSCLK>;
190					clock-names = "sysclk";
191				};
192
193				ab8500-ponkey {
194					compatible = "stericsson,ab8500-poweron-key";
195					interrupts = <6 IRQ_TYPE_LEVEL_HIGH
196						      7 IRQ_TYPE_LEVEL_HIGH>;
197					interrupt-names = "ONKEY_DBF", "ONKEY_DBR";
198				};
199
200				ab8500-sysctrl {
201					compatible = "stericsson,ab8500-sysctrl";
202				};
203
204				ab8500-pwm {
205					compatible = "stericsson,ab8500-pwm";
206					clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
207					clock-names = "intclk";
208				};
209
210				ab8500-debugfs {
211					compatible = "stericsson,ab8500-debug";
212				};
213
214				codec: ab8500-codec {
215					compatible = "stericsson,ab8500-codec";
216
217					V-AUD-supply = <&ab8500_ldo_audio_reg>;
218					V-AMIC1-supply = <&ab8500_ldo_anamic1_reg>;
219					V-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;
220					V-DMIC-supply = <&ab8500_ldo_dmic_reg>;
221
222					clocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;
223					clock-names = "audioclk";
224
225					stericsson,earpeice-cmv = <950>; /* Units in mV. */
226				};
227
228				ext_regulators: ab8500-ext-regulators {
229					compatible = "stericsson,ab8500-ext-regulator";
230
231					ab8500_ext1_reg: ab8500_ext1 {
232						regulator-min-microvolt = <1800000>;
233						regulator-max-microvolt = <1800000>;
234						regulator-boot-on;
235						regulator-always-on;
236					};
237
238					ab8500_ext2_reg: ab8500_ext2 {
239						regulator-min-microvolt = <1360000>;
240						regulator-max-microvolt = <1360000>;
241						regulator-boot-on;
242						regulator-always-on;
243					};
244
245					ab8500_ext3_reg: ab8500_ext3 {
246						regulator-min-microvolt = <3400000>;
247						regulator-max-microvolt = <3400000>;
248						regulator-boot-on;
249					};
250				};
251
252				ab8500-regulators {
253					compatible = "stericsson,ab8500-regulator";
254					vin-supply = <&ab8500_ext3_reg>;
255
256					// supplies to the display/camera
257					ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
258						regulator-min-microvolt = <2500000>;
259						regulator-max-microvolt = <2900000>;
260						regulator-boot-on;
261						/* BUG: If turned off MMC will be affected. */
262						regulator-always-on;
263					};
264
265					// supplies to the on-board eMMC
266					ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
267						regulator-min-microvolt = <1100000>;
268						regulator-max-microvolt = <3300000>;
269					};
270
271					// supply for VAUX3; SDcard slots
272					ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
273						regulator-min-microvolt = <1100000>;
274						regulator-max-microvolt = <3300000>;
275					};
276
277					// supply for v-intcore12; VINTCORE12 LDO
278					ab8500_ldo_intcore_reg: ab8500_ldo_intcore {
279					};
280
281					// supply for tvout; gpadc; TVOUT LDO
282					ab8500_ldo_tvout_reg: ab8500_ldo_tvout {
283					};
284
285					// supply for ab8500-vaudio; VAUDIO LDO
286					ab8500_ldo_audio_reg: ab8500_ldo_audio {
287					};
288
289					// supply for v-anamic1 VAMIC1 LDO
290					ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
291					};
292
293					// supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1
294					ab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {
295					};
296
297					// supply for v-dmic; VDMIC LDO
298					ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
299					};
300
301					// supply for U8500 CSI/DSI; VANA LDO
302					ab8500_ldo_ana_reg: ab8500_ldo_ana {
303					};
304				};
305			};
306		};
307
308		sound {
309			stericsson,audio-codec = <&codec>;
310			clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
311			clock-names = "sysclk", "ulpclk", "intclk";
312		};
313
314		mcde@a0350000 {
315			vana-supply = <&ab8500_ldo_ana_reg>;
316
317			dsi@a0351000 {
318				vana-supply = <&ab8500_ldo_ana_reg>;
319			};
320			dsi@a0352000 {
321				vana-supply = <&ab8500_ldo_ana_reg>;
322			};
323			dsi@a0353000 {
324				vana-supply = <&ab8500_ldo_ana_reg>;
325			};
326		};
327	};
328};
329