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	};
18
19	soc {
20		prcmu@80157000 {
21			ab8505 {
22				compatible = "stericsson,ab8505";
23				interrupt-parent = <&intc>;
24				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
25				interrupt-controller;
26				#interrupt-cells = <2>;
27
28				ab8500_clock: clock-controller {
29					compatible = "stericsson,ab8500-clk";
30					#clock-cells = <1>;
31				};
32
33				ab8505_gpio: ab8505-gpio {
34					compatible = "stericsson,ab8505-gpio";
35					gpio-controller;
36					#gpio-cells = <2>;
37				};
38
39				ab8500-rtc {
40					compatible = "stericsson,ab8500-rtc";
41					interrupts = <17 IRQ_TYPE_LEVEL_HIGH
42						      18 IRQ_TYPE_LEVEL_HIGH>;
43					interrupt-names = "60S", "ALARM";
44				};
45
46				gpadc: ab8500-gpadc {
47					compatible = "stericsson,ab8500-gpadc";
48					interrupts = <32 IRQ_TYPE_LEVEL_HIGH
49						      39 IRQ_TYPE_LEVEL_HIGH>;
50					interrupt-names = "HW_CONV_END", "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@01 {
58						reg = <0x01>;
59					};
60					btemp_ball: channel@02 {
61						reg = <0x02>;
62					};
63					acc_detect1: channel@04 {
64						reg = <0x04>;
65					};
66					acc_detect2: channel@05 {
67						reg = <0x05>;
68					};
69					adc_aux1: channel@06 {
70						reg = <0x06>;
71					};
72					adc_aux2: channel@07 {
73						reg = <0x07>;
74					};
75					main_batt_v: channel@08 {
76						reg = <0x08>;
77					};
78					vbus_v: channel@09 {
79						reg = <0x09>;
80					};
81					charger_c: channel@0b {
82						reg = <0x0b>;
83					};
84					bk_bat_v: channel@0c {
85						reg = <0x0c>;
86					};
87					usb_id: channel@0e {
88						reg = <0x0e>;
89					};
90				};
91
92				ab8500_battery: ab8500_battery {
93					status = "disabled";
94					thermistor-on-batctrl;
95				};
96
97				ab8500_fg {
98					status = "disabled";
99					compatible = "stericsson,ab8500-fg";
100					battery = <&ab8500_battery>;
101					io-channels = <&gpadc 0x08>;
102					io-channel-name = "main_bat_v";
103				};
104
105				ab8500_btemp {
106					status = "disabled";
107					compatible = "stericsson,ab8500-btemp";
108					battery = <&ab8500_battery>;
109					io-channels = <&gpadc 0x02>,
110						      <&gpadc 0x01>;
111					io-channel-name = "btemp_ball",
112							  "bat_ctrl";
113				};
114
115				ab8500_charger {
116					status = "disabled";
117					compatible = "stericsson,ab8500-charger";
118					battery = <&ab8500_battery>;
119					vddadc-supply = <&ab8500_ldo_adc_reg>;
120					io-channels = <&gpadc 0x09>,
121						      <&gpadc 0x0b>;
122					io-channel-name = "vbus_v",
123							  "usb_charger_c";
124				};
125
126				ab8500_chargalg {
127					status = "disabled";
128					compatible = "stericsson,ab8500-chargalg";
129					battery = <&ab8500_battery>;
130				};
131
132				ab8500_usb: ab8500_usb {
133					compatible = "stericsson,ab8500-usb";
134					interrupts = < 90 IRQ_TYPE_LEVEL_HIGH
135						       96 IRQ_TYPE_LEVEL_HIGH
136						       14 IRQ_TYPE_LEVEL_HIGH
137						       15 IRQ_TYPE_LEVEL_HIGH
138						       79 IRQ_TYPE_LEVEL_HIGH
139						       74 IRQ_TYPE_LEVEL_HIGH
140						       75 IRQ_TYPE_LEVEL_HIGH>;
141					interrupt-names = "ID_WAKEUP_R",
142							  "ID_WAKEUP_F",
143							  "VBUS_DET_F",
144							  "VBUS_DET_R",
145							  "USB_LINK_STATUS",
146							  "USB_ADP_PROBE_PLUG",
147							  "USB_ADP_PROBE_UNPLUG";
148					vddulpivio18-supply = <&ab8500_ldo_intcore_reg>;
149					v-ape-supply = <&db8500_vape_reg>;
150					musb_1v8-supply = <&db8500_vsmps2_reg>;
151					clocks = <&prcmu_clk PRCMU_SYSCLK>;
152					clock-names = "sysclk";
153				};
154
155				ab8500-ponkey {
156					compatible = "stericsson,ab8500-poweron-key";
157					interrupts = <6 IRQ_TYPE_LEVEL_HIGH
158						      7 IRQ_TYPE_LEVEL_HIGH>;
159					interrupt-names = "ONKEY_DBF", "ONKEY_DBR";
160				};
161
162				ab8500-sysctrl {
163					compatible = "stericsson,ab8500-sysctrl";
164				};
165
166				ab8500-pwm {
167					compatible = "stericsson,ab8500-pwm";
168					clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
169					clock-names = "intclk";
170				};
171
172				ab8500-debugfs {
173					compatible = "stericsson,ab8500-debug";
174				};
175
176				codec: ab8500-codec {
177					compatible = "stericsson,ab8500-codec";
178
179					V-AUD-supply = <&ab8500_ldo_audio_reg>;
180					V-AMIC1-supply = <&ab8500_ldo_anamic1_reg>;
181					V-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;
182
183					clocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;
184					clock-names = "audioclk";
185
186					stericsson,earpeice-cmv = <950>; /* Units in mV. */
187				};
188
189				ab8505-regulators {
190					compatible = "stericsson,ab8505-regulator";
191
192					ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
193						regulator-min-microvolt = <2800000>;
194						regulator-max-microvolt = <3300000>;
195					};
196
197					ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
198						regulator-min-microvolt = <1100000>;
199						regulator-max-microvolt = <3300000>;
200					};
201
202					ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
203						regulator-min-microvolt = <1100000>;
204						regulator-max-microvolt = <3300000>;
205					};
206
207					ab8500_ldo_aux4_reg: ab8500_ldo_aux4 {
208						regulator-min-microvolt = <1100000>;
209						regulator-max-microvolt = <3300000>;
210					};
211
212					ab8500_ldo_aux5_reg: ab8500_ldo_aux5 {
213						regulator-min-microvolt = <1050000>;
214						regulator-max-microvolt = <2790000>;
215					};
216
217					ab8500_ldo_aux6_reg: ab8500_ldo_aux6 {
218						regulator-min-microvolt = <1050000>;
219						regulator-max-microvolt = <2790000>;
220					};
221
222					// supply for v-intcore12; VINTCORE12 LDO
223					ab8500_ldo_intcore_reg: ab8500_ldo_intcore {
224						regulator-min-microvolt = <1250000>;
225						regulator-max-microvolt = <1350000>;
226					};
227
228					// supply for gpadc; ADC LDO
229					ab8500_ldo_adc_reg: ab8500_ldo_adc {
230					};
231
232					// supply for ab8500-vaudio; VAUDIO LDO
233					ab8500_ldo_audio_reg: ab8500_ldo_audio {
234					};
235
236					// supply for v-anamic1 VAMIC1 LDO
237					ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
238					};
239
240					// supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1
241					ab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {
242					};
243
244					// supply for v-aux8; VAUX8 LDO
245					ab8500_ldo_aux8_reg: ab8500_ldo_aux8 {
246					};
247
248					// supply for U8500 CSI/DSI; VANA LDO
249					ab8500_ldo_ana_reg: ab8500_ldo_ana {
250					};
251				};
252			};
253		};
254
255		sound {
256			stericsson,audio-codec = <&codec>;
257			clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
258			clock-names = "sysclk", "ulpclk", "intclk";
259		};
260
261		mcde@a0350000 {
262			vana-supply = <&ab8500_ldo_ana_reg>;
263
264			dsi@a0351000 {
265				vana-supply = <&ab8500_ldo_ana_reg>;
266			};
267			dsi@a0352000 {
268				vana-supply = <&ab8500_ldo_ana_reg>;
269			};
270			dsi@a0353000 {
271				vana-supply = <&ab8500_ldo_ana_reg>;
272			};
273		};
274	};
275};
276