Commit | Line | Data |
---|---|---|
fea799e3 MN |
1 | /* |
2 | * Copyright (C) ST Ericsson SA 2011 | |
3 | * | |
4 | * License Terms: GNU General Public License v2 | |
5 | * | |
6 | * STE Ux500 PRCMU API | |
7 | */ | |
8 | #ifndef __MACH_PRCMU_H | |
9 | #define __MACH_PRCMU_H | |
10 | ||
11 | #include <linux/interrupt.h> | |
12 | #include <linux/notifier.h> | |
0508901c | 13 | #include <linux/err.h> |
fea799e3 | 14 | |
67f13daa LJ |
15 | #include <dt-bindings/mfd/dbx500-prcmu.h> /* For clock identifiers */ |
16 | ||
05ec260e LW |
17 | /* Offset for the firmware version within the TCPM */ |
18 | #define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4 | |
19 | #define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8 | |
20 | ||
fea799e3 MN |
21 | /* PRCMU Wakeup defines */ |
22 | enum prcmu_wakeup_index { | |
23 | PRCMU_WAKEUP_INDEX_RTC, | |
24 | PRCMU_WAKEUP_INDEX_RTT0, | |
25 | PRCMU_WAKEUP_INDEX_RTT1, | |
26 | PRCMU_WAKEUP_INDEX_HSI0, | |
27 | PRCMU_WAKEUP_INDEX_HSI1, | |
28 | PRCMU_WAKEUP_INDEX_USB, | |
29 | PRCMU_WAKEUP_INDEX_ABB, | |
30 | PRCMU_WAKEUP_INDEX_ABB_FIFO, | |
31 | PRCMU_WAKEUP_INDEX_ARM, | |
32 | PRCMU_WAKEUP_INDEX_CD_IRQ, | |
33 | NUM_PRCMU_WAKEUP_INDICES | |
34 | }; | |
35 | #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name)) | |
36 | ||
37 | /* EPOD (power domain) IDs */ | |
38 | ||
39 | /* | |
40 | * DB8500 EPODs | |
41 | * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP | |
42 | * - EPOD_ID_SVAPIPE: power domain for SVA pipe | |
43 | * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP | |
44 | * - EPOD_ID_SIAPIPE: power domain for SIA pipe | |
45 | * - EPOD_ID_SGA: power domain for SGA | |
46 | * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE | |
47 | * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2 | |
48 | * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4 | |
49 | * - NUM_EPOD_ID: number of power domains | |
50 | * | |
51 | * TODO: These should be prefixed. | |
52 | */ | |
53 | #define EPOD_ID_SVAMMDSP 0 | |
54 | #define EPOD_ID_SVAPIPE 1 | |
55 | #define EPOD_ID_SIAMMDSP 2 | |
56 | #define EPOD_ID_SIAPIPE 3 | |
57 | #define EPOD_ID_SGA 4 | |
58 | #define EPOD_ID_B2R2_MCDE 5 | |
59 | #define EPOD_ID_ESRAM12 6 | |
60 | #define EPOD_ID_ESRAM34 7 | |
61 | #define NUM_EPOD_ID 8 | |
62 | ||
fea799e3 MN |
63 | /* |
64 | * state definition for EPOD (power domain) | |
65 | * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged | |
66 | * - EPOD_STATE_OFF: The EPOD is switched off | |
67 | * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in | |
68 | * retention | |
69 | * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off | |
70 | * - EPOD_STATE_ON: Same as above, but with clock enabled | |
71 | */ | |
72 | #define EPOD_STATE_NO_CHANGE 0x00 | |
73 | #define EPOD_STATE_OFF 0x01 | |
74 | #define EPOD_STATE_RAMRET 0x02 | |
75 | #define EPOD_STATE_ON_CLK_OFF 0x03 | |
76 | #define EPOD_STATE_ON 0x04 | |
77 | ||
78 | /* | |
79 | * CLKOUT sources | |
80 | */ | |
81 | #define PRCMU_CLKSRC_CLK38M 0x00 | |
82 | #define PRCMU_CLKSRC_ACLK 0x01 | |
83 | #define PRCMU_CLKSRC_SYSCLK 0x02 | |
84 | #define PRCMU_CLKSRC_LCDCLK 0x03 | |
85 | #define PRCMU_CLKSRC_SDMMCCLK 0x04 | |
86 | #define PRCMU_CLKSRC_TVCLK 0x05 | |
87 | #define PRCMU_CLKSRC_TIMCLK 0x06 | |
88 | #define PRCMU_CLKSRC_CLK009 0x07 | |
89 | /* These are only valid for CLKOUT1: */ | |
90 | #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40 | |
91 | #define PRCMU_CLKSRC_I2CCLK 0x41 | |
92 | #define PRCMU_CLKSRC_MSP02CLK 0x42 | |
93 | #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43 | |
94 | #define PRCMU_CLKSRC_HSIRXCLK 0x44 | |
95 | #define PRCMU_CLKSRC_HSITXCLK 0x45 | |
96 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | |
97 | #define PRCMU_CLKSRC_HDMICLK 0x47 | |
98 | ||
98c60a0d FB |
99 | /** |
100 | * enum prcmu_wdog_id - PRCMU watchdog IDs | |
101 | * @PRCMU_WDOG_ALL: use all timers | |
102 | * @PRCMU_WDOG_CPU1: use first CPU timer only | |
103 | * @PRCMU_WDOG_CPU2: use second CPU timer conly | |
104 | */ | |
105 | enum prcmu_wdog_id { | |
106 | PRCMU_WDOG_ALL = 0x00, | |
107 | PRCMU_WDOG_CPU1 = 0x01, | |
108 | PRCMU_WDOG_CPU2 = 0x02, | |
109 | }; | |
110 | ||
fea799e3 MN |
111 | /** |
112 | * enum ape_opp - APE OPP states definition | |
113 | * @APE_OPP_INIT: | |
114 | * @APE_NO_CHANGE: The APE operating point is unchanged | |
115 | * @APE_100_OPP: The new APE operating point is ape100opp | |
116 | * @APE_50_OPP: 50% | |
4d64d2e3 | 117 | * @APE_50_PARTLY_25_OPP: 50%, except some clocks at 25%. |
fea799e3 MN |
118 | */ |
119 | enum ape_opp { | |
120 | APE_OPP_INIT = 0x00, | |
121 | APE_NO_CHANGE = 0x01, | |
122 | APE_100_OPP = 0x02, | |
4d64d2e3 MN |
123 | APE_50_OPP = 0x03, |
124 | APE_50_PARTLY_25_OPP = 0xFF, | |
fea799e3 MN |
125 | }; |
126 | ||
127 | /** | |
128 | * enum arm_opp - ARM OPP states definition | |
129 | * @ARM_OPP_INIT: | |
130 | * @ARM_NO_CHANGE: The ARM operating point is unchanged | |
131 | * @ARM_100_OPP: The new ARM operating point is arm100opp | |
132 | * @ARM_50_OPP: The new ARM operating point is arm50opp | |
133 | * @ARM_MAX_OPP: Operating point is "max" (more than 100) | |
134 | * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100 | |
135 | * @ARM_EXTCLK: The new ARM operating point is armExtClk | |
136 | */ | |
137 | enum arm_opp { | |
138 | ARM_OPP_INIT = 0x00, | |
139 | ARM_NO_CHANGE = 0x01, | |
140 | ARM_100_OPP = 0x02, | |
141 | ARM_50_OPP = 0x03, | |
142 | ARM_MAX_OPP = 0x04, | |
143 | ARM_MAX_FREQ100OPP = 0x05, | |
144 | ARM_EXTCLK = 0x07 | |
145 | }; | |
146 | ||
147 | /** | |
148 | * enum ddr_opp - DDR OPP states definition | |
149 | * @DDR_100_OPP: The new DDR operating point is ddr100opp | |
150 | * @DDR_50_OPP: The new DDR operating point is ddr50opp | |
151 | * @DDR_25_OPP: The new DDR operating point is ddr25opp | |
152 | */ | |
153 | enum ddr_opp { | |
154 | DDR_100_OPP = 0x00, | |
155 | DDR_50_OPP = 0x01, | |
156 | DDR_25_OPP = 0x02, | |
157 | }; | |
158 | ||
159 | /* | |
160 | * Definitions for controlling ESRAM0 in deep sleep. | |
161 | */ | |
162 | #define ESRAM0_DEEP_SLEEP_STATE_OFF 1 | |
163 | #define ESRAM0_DEEP_SLEEP_STATE_RET 2 | |
164 | ||
165 | /** | |
166 | * enum ddr_pwrst - DDR power states definition | |
167 | * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged | |
168 | * @DDR_PWR_STATE_ON: | |
169 | * @DDR_PWR_STATE_OFFLOWLAT: | |
170 | * @DDR_PWR_STATE_OFFHIGHLAT: | |
171 | */ | |
172 | enum ddr_pwrst { | |
173 | DDR_PWR_STATE_UNCHANGED = 0x00, | |
174 | DDR_PWR_STATE_ON = 0x01, | |
175 | DDR_PWR_STATE_OFFLOWLAT = 0x02, | |
176 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | |
177 | }; | |
178 | ||
05ec260e LW |
179 | #define DB8500_PRCMU_LEGACY_OFFSET 0xDD4 |
180 | ||
181 | struct prcmu_pdata | |
182 | { | |
183 | bool enable_set_ddr_opp; | |
184 | bool enable_ape_opp_100_voltage; | |
185 | struct ab8500_platform_data *ab_platdata; | |
186 | u32 version_offset; | |
187 | u32 legacy_offset; | |
188 | u32 adt_offset; | |
189 | }; | |
190 | ||
191 | #define PRCMU_FW_PROJECT_U8500 2 | |
192 | #define PRCMU_FW_PROJECT_U8400 3 | |
193 | #define PRCMU_FW_PROJECT_U9500 4 /* Customer specific */ | |
194 | #define PRCMU_FW_PROJECT_U8500_MBB 5 | |
195 | #define PRCMU_FW_PROJECT_U8500_C1 6 | |
196 | #define PRCMU_FW_PROJECT_U8500_C2 7 | |
197 | #define PRCMU_FW_PROJECT_U8500_C3 8 | |
198 | #define PRCMU_FW_PROJECT_U8500_C4 9 | |
199 | #define PRCMU_FW_PROJECT_U9500_MBL 10 | |
200 | #define PRCMU_FW_PROJECT_U8500_MBL 11 /* Customer specific */ | |
201 | #define PRCMU_FW_PROJECT_U8500_MBL2 12 /* Customer specific */ | |
202 | #define PRCMU_FW_PROJECT_U8520 13 | |
203 | #define PRCMU_FW_PROJECT_U8420 14 | |
204 | #define PRCMU_FW_PROJECT_A9420 20 | |
205 | /* [32..63] 9540 and derivatives */ | |
206 | #define PRCMU_FW_PROJECT_U9540 32 | |
207 | /* [64..95] 8540 and derivatives */ | |
208 | #define PRCMU_FW_PROJECT_L8540 64 | |
209 | /* [96..126] 8580 and derivatives */ | |
210 | #define PRCMU_FW_PROJECT_L8580 96 | |
211 | ||
212 | #define PRCMU_FW_PROJECT_NAME_LEN 20 | |
213 | struct prcmu_fw_version { | |
214 | u32 project; /* Notice, project shifted with 8 on ux540 */ | |
215 | u8 api_version; | |
216 | u8 func_version; | |
217 | u8 errata; | |
218 | char project_name[PRCMU_FW_PROJECT_NAME_LEN]; | |
219 | }; | |
220 | ||
fea799e3 | 221 | #include <linux/mfd/db8500-prcmu.h> |
fea799e3 | 222 | |
dece3709 | 223 | #if defined(CONFIG_UX500_SOC_DB8500) |
fea799e3 | 224 | |
9a47a8dc | 225 | static inline void prcmu_early_init(u32 phy_base, u32 size) |
fea799e3 | 226 | { |
9a47a8dc | 227 | return db8500_prcmu_early_init(phy_base, size); |
fea799e3 MN |
228 | } |
229 | ||
230 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |
231 | bool keep_ap_pll) | |
232 | { | |
dece3709 LW |
233 | return db8500_prcmu_set_power_state(state, keep_ulp_clk, |
234 | keep_ap_pll); | |
fea799e3 MN |
235 | } |
236 | ||
4d64d2e3 MN |
237 | static inline u8 prcmu_get_power_state_result(void) |
238 | { | |
dece3709 | 239 | return db8500_prcmu_get_power_state_result(); |
4d64d2e3 MN |
240 | } |
241 | ||
fea799e3 MN |
242 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) |
243 | { | |
dece3709 | 244 | return db8500_prcmu_set_epod(epod_id, epod_state); |
fea799e3 MN |
245 | } |
246 | ||
247 | static inline void prcmu_enable_wakeups(u32 wakeups) | |
248 | { | |
dece3709 | 249 | db8500_prcmu_enable_wakeups(wakeups); |
fea799e3 MN |
250 | } |
251 | ||
252 | static inline void prcmu_disable_wakeups(void) | |
253 | { | |
254 | prcmu_enable_wakeups(0); | |
255 | } | |
256 | ||
257 | static inline void prcmu_config_abb_event_readout(u32 abb_events) | |
258 | { | |
dece3709 | 259 | db8500_prcmu_config_abb_event_readout(abb_events); |
fea799e3 MN |
260 | } |
261 | ||
262 | static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | |
263 | { | |
dece3709 | 264 | db8500_prcmu_get_abb_event_buffer(buf); |
fea799e3 MN |
265 | } |
266 | ||
267 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | |
268 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | |
3c3e4898 | 269 | int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask, u8 size); |
fea799e3 MN |
270 | |
271 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | |
272 | ||
273 | static inline int prcmu_request_clock(u8 clock, bool enable) | |
274 | { | |
dece3709 | 275 | return db8500_prcmu_request_clock(clock, enable); |
fea799e3 MN |
276 | } |
277 | ||
0508901c MN |
278 | unsigned long prcmu_clock_rate(u8 clock); |
279 | long prcmu_round_clock_rate(u8 clock, unsigned long rate); | |
280 | int prcmu_set_clock_rate(u8 clock, unsigned long rate); | |
281 | ||
282 | static inline int prcmu_set_ddr_opp(u8 opp) | |
283 | { | |
dece3709 | 284 | return db8500_prcmu_set_ddr_opp(opp); |
0508901c MN |
285 | } |
286 | static inline int prcmu_get_ddr_opp(void) | |
287 | { | |
dece3709 | 288 | return db8500_prcmu_get_ddr_opp(); |
0508901c | 289 | } |
fea799e3 MN |
290 | |
291 | static inline int prcmu_set_arm_opp(u8 opp) | |
292 | { | |
dece3709 | 293 | return db8500_prcmu_set_arm_opp(opp); |
fea799e3 MN |
294 | } |
295 | ||
296 | static inline int prcmu_get_arm_opp(void) | |
297 | { | |
dece3709 | 298 | return db8500_prcmu_get_arm_opp(); |
fea799e3 MN |
299 | } |
300 | ||
0508901c MN |
301 | static inline int prcmu_set_ape_opp(u8 opp) |
302 | { | |
dece3709 | 303 | return db8500_prcmu_set_ape_opp(opp); |
0508901c MN |
304 | } |
305 | ||
306 | static inline int prcmu_get_ape_opp(void) | |
307 | { | |
dece3709 | 308 | return db8500_prcmu_get_ape_opp(); |
0508901c MN |
309 | } |
310 | ||
686f871b UH |
311 | static inline int prcmu_request_ape_opp_100_voltage(bool enable) |
312 | { | |
313 | return db8500_prcmu_request_ape_opp_100_voltage(enable); | |
314 | } | |
315 | ||
fea799e3 MN |
316 | static inline void prcmu_system_reset(u16 reset_code) |
317 | { | |
dece3709 | 318 | return db8500_prcmu_system_reset(reset_code); |
fea799e3 MN |
319 | } |
320 | ||
321 | static inline u16 prcmu_get_reset_code(void) | |
322 | { | |
dece3709 | 323 | return db8500_prcmu_get_reset_code(); |
fea799e3 MN |
324 | } |
325 | ||
5261e101 | 326 | int prcmu_ac_wake_req(void); |
fea799e3 | 327 | void prcmu_ac_sleep_req(void); |
0508901c MN |
328 | static inline void prcmu_modem_reset(void) |
329 | { | |
dece3709 | 330 | return db8500_prcmu_modem_reset(); |
0508901c MN |
331 | } |
332 | ||
fea799e3 MN |
333 | static inline bool prcmu_is_ac_wake_requested(void) |
334 | { | |
dece3709 | 335 | return db8500_prcmu_is_ac_wake_requested(); |
fea799e3 MN |
336 | } |
337 | ||
338 | static inline int prcmu_set_display_clocks(void) | |
339 | { | |
dece3709 | 340 | return db8500_prcmu_set_display_clocks(); |
fea799e3 MN |
341 | } |
342 | ||
343 | static inline int prcmu_disable_dsipll(void) | |
344 | { | |
dece3709 | 345 | return db8500_prcmu_disable_dsipll(); |
fea799e3 MN |
346 | } |
347 | ||
348 | static inline int prcmu_enable_dsipll(void) | |
349 | { | |
dece3709 | 350 | return db8500_prcmu_enable_dsipll(); |
fea799e3 MN |
351 | } |
352 | ||
353 | static inline int prcmu_config_esram0_deep_sleep(u8 state) | |
354 | { | |
dece3709 | 355 | return db8500_prcmu_config_esram0_deep_sleep(state); |
fea799e3 | 356 | } |
0508901c MN |
357 | |
358 | static inline int prcmu_config_hotdog(u8 threshold) | |
359 | { | |
dece3709 | 360 | return db8500_prcmu_config_hotdog(threshold); |
0508901c MN |
361 | } |
362 | ||
363 | static inline int prcmu_config_hotmon(u8 low, u8 high) | |
364 | { | |
dece3709 | 365 | return db8500_prcmu_config_hotmon(low, high); |
0508901c MN |
366 | } |
367 | ||
368 | static inline int prcmu_start_temp_sense(u16 cycles32k) | |
369 | { | |
dece3709 | 370 | return db8500_prcmu_start_temp_sense(cycles32k); |
0508901c MN |
371 | } |
372 | ||
373 | static inline int prcmu_stop_temp_sense(void) | |
374 | { | |
dece3709 | 375 | return db8500_prcmu_stop_temp_sense(); |
0508901c MN |
376 | } |
377 | ||
b4a6dbd5 MN |
378 | static inline u32 prcmu_read(unsigned int reg) |
379 | { | |
dece3709 | 380 | return db8500_prcmu_read(reg); |
b4a6dbd5 MN |
381 | } |
382 | ||
383 | static inline void prcmu_write(unsigned int reg, u32 value) | |
384 | { | |
dece3709 | 385 | db8500_prcmu_write(reg, value); |
b4a6dbd5 MN |
386 | } |
387 | ||
388 | static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) | |
389 | { | |
dece3709 | 390 | db8500_prcmu_write_masked(reg, mask, value); |
b4a6dbd5 MN |
391 | } |
392 | ||
0508901c MN |
393 | static inline int prcmu_enable_a9wdog(u8 id) |
394 | { | |
dece3709 | 395 | return db8500_prcmu_enable_a9wdog(id); |
0508901c MN |
396 | } |
397 | ||
398 | static inline int prcmu_disable_a9wdog(u8 id) | |
399 | { | |
dece3709 | 400 | return db8500_prcmu_disable_a9wdog(id); |
0508901c MN |
401 | } |
402 | ||
403 | static inline int prcmu_kick_a9wdog(u8 id) | |
404 | { | |
dece3709 | 405 | return db8500_prcmu_kick_a9wdog(id); |
0508901c MN |
406 | } |
407 | ||
408 | static inline int prcmu_load_a9wdog(u8 id, u32 timeout) | |
409 | { | |
dece3709 | 410 | return db8500_prcmu_load_a9wdog(id, timeout); |
0508901c MN |
411 | } |
412 | ||
413 | static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off) | |
414 | { | |
dece3709 | 415 | return db8500_prcmu_config_a9wdog(num, sleep_auto_off); |
0508901c | 416 | } |
fea799e3 MN |
417 | #else |
418 | ||
9a47a8dc | 419 | static inline void prcmu_early_init(u32 phy_base, u32 size) {} |
fea799e3 MN |
420 | |
421 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |
422 | bool keep_ap_pll) | |
423 | { | |
424 | return 0; | |
425 | } | |
426 | ||
427 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | |
428 | { | |
429 | return 0; | |
430 | } | |
431 | ||
432 | static inline void prcmu_enable_wakeups(u32 wakeups) {} | |
433 | ||
434 | static inline void prcmu_disable_wakeups(void) {} | |
435 | ||
436 | static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | |
437 | { | |
438 | return -ENOSYS; | |
439 | } | |
440 | ||
441 | static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | |
442 | { | |
443 | return -ENOSYS; | |
444 | } | |
445 | ||
3c3e4898 MN |
446 | static inline int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask, |
447 | u8 size) | |
448 | { | |
449 | return -ENOSYS; | |
450 | } | |
451 | ||
fea799e3 MN |
452 | static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) |
453 | { | |
454 | return 0; | |
455 | } | |
456 | ||
457 | static inline int prcmu_request_clock(u8 clock, bool enable) | |
458 | { | |
459 | return 0; | |
6b6fae2b MN |
460 | } |
461 | ||
462 | static inline long prcmu_round_clock_rate(u8 clock, unsigned long rate) | |
463 | { | |
464 | return 0; | |
465 | } | |
466 | ||
467 | static inline int prcmu_set_clock_rate(u8 clock, unsigned long rate) | |
468 | { | |
469 | return 0; | |
470 | } | |
471 | ||
472 | static inline unsigned long prcmu_clock_rate(u8 clock) | |
473 | { | |
474 | return 0; | |
fea799e3 MN |
475 | } |
476 | ||
477 | static inline int prcmu_set_ape_opp(u8 opp) | |
478 | { | |
479 | return 0; | |
480 | } | |
481 | ||
482 | static inline int prcmu_get_ape_opp(void) | |
483 | { | |
484 | return APE_100_OPP; | |
485 | } | |
486 | ||
686f871b UH |
487 | static inline int prcmu_request_ape_opp_100_voltage(bool enable) |
488 | { | |
489 | return 0; | |
490 | } | |
491 | ||
fea799e3 MN |
492 | static inline int prcmu_set_arm_opp(u8 opp) |
493 | { | |
494 | return 0; | |
495 | } | |
496 | ||
497 | static inline int prcmu_get_arm_opp(void) | |
498 | { | |
499 | return ARM_100_OPP; | |
500 | } | |
501 | ||
502 | static inline int prcmu_set_ddr_opp(u8 opp) | |
503 | { | |
504 | return 0; | |
505 | } | |
506 | ||
507 | static inline int prcmu_get_ddr_opp(void) | |
508 | { | |
509 | return DDR_100_OPP; | |
510 | } | |
511 | ||
512 | static inline void prcmu_system_reset(u16 reset_code) {} | |
513 | ||
514 | static inline u16 prcmu_get_reset_code(void) | |
515 | { | |
516 | return 0; | |
517 | } | |
518 | ||
5261e101 AM |
519 | static inline int prcmu_ac_wake_req(void) |
520 | { | |
521 | return 0; | |
522 | } | |
fea799e3 MN |
523 | |
524 | static inline void prcmu_ac_sleep_req(void) {} | |
525 | ||
526 | static inline void prcmu_modem_reset(void) {} | |
527 | ||
528 | static inline bool prcmu_is_ac_wake_requested(void) | |
529 | { | |
530 | return false; | |
531 | } | |
532 | ||
533 | static inline int prcmu_set_display_clocks(void) | |
534 | { | |
535 | return 0; | |
536 | } | |
537 | ||
538 | static inline int prcmu_disable_dsipll(void) | |
539 | { | |
540 | return 0; | |
541 | } | |
542 | ||
543 | static inline int prcmu_enable_dsipll(void) | |
544 | { | |
545 | return 0; | |
546 | } | |
547 | ||
548 | static inline int prcmu_config_esram0_deep_sleep(u8 state) | |
549 | { | |
550 | return 0; | |
551 | } | |
552 | ||
553 | static inline void prcmu_config_abb_event_readout(u32 abb_events) {} | |
554 | ||
555 | static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | |
556 | { | |
557 | *buf = NULL; | |
558 | } | |
559 | ||
0508901c MN |
560 | static inline int prcmu_config_hotdog(u8 threshold) |
561 | { | |
562 | return 0; | |
563 | } | |
564 | ||
565 | static inline int prcmu_config_hotmon(u8 low, u8 high) | |
566 | { | |
567 | return 0; | |
568 | } | |
569 | ||
570 | static inline int prcmu_start_temp_sense(u16 cycles32k) | |
571 | { | |
572 | return 0; | |
573 | } | |
574 | ||
575 | static inline int prcmu_stop_temp_sense(void) | |
576 | { | |
577 | return 0; | |
578 | } | |
579 | ||
b4a6dbd5 MN |
580 | static inline u32 prcmu_read(unsigned int reg) |
581 | { | |
582 | return 0; | |
583 | } | |
584 | ||
585 | static inline void prcmu_write(unsigned int reg, u32 value) {} | |
586 | ||
587 | static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) {} | |
588 | ||
589 | #endif | |
590 | ||
591 | static inline void prcmu_set(unsigned int reg, u32 bits) | |
592 | { | |
593 | prcmu_write_masked(reg, bits, bits); | |
594 | } | |
595 | ||
596 | static inline void prcmu_clear(unsigned int reg, u32 bits) | |
597 | { | |
598 | prcmu_write_masked(reg, bits, 0); | |
599 | } | |
600 | ||
fea799e3 MN |
601 | /* PRCMU QoS APE OPP class */ |
602 | #define PRCMU_QOS_APE_OPP 1 | |
603 | #define PRCMU_QOS_DDR_OPP 2 | |
4d64d2e3 | 604 | #define PRCMU_QOS_ARM_OPP 3 |
fea799e3 MN |
605 | #define PRCMU_QOS_DEFAULT_VALUE -1 |
606 | ||
4d64d2e3 | 607 | #ifdef CONFIG_DBX500_PRCMU_QOS_POWER |
fea799e3 MN |
608 | |
609 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | |
610 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | |
611 | void prcmu_qos_force_opp(int, s32); | |
612 | int prcmu_qos_requirement(int pm_qos_class); | |
613 | int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); | |
614 | int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value); | |
615 | void prcmu_qos_remove_requirement(int pm_qos_class, char *name); | |
616 | int prcmu_qos_add_notifier(int prcmu_qos_class, | |
617 | struct notifier_block *notifier); | |
618 | int prcmu_qos_remove_notifier(int prcmu_qos_class, | |
619 | struct notifier_block *notifier); | |
620 | ||
621 | #else | |
622 | ||
623 | static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void) | |
624 | { | |
625 | return 0; | |
626 | } | |
627 | ||
628 | static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {} | |
629 | ||
630 | static inline void prcmu_qos_force_opp(int prcmu_qos_class, s32 i) {} | |
631 | ||
632 | static inline int prcmu_qos_requirement(int prcmu_qos_class) | |
633 | { | |
634 | return 0; | |
635 | } | |
636 | ||
637 | static inline int prcmu_qos_add_requirement(int prcmu_qos_class, | |
638 | char *name, s32 value) | |
639 | { | |
640 | return 0; | |
641 | } | |
642 | ||
643 | static inline int prcmu_qos_update_requirement(int prcmu_qos_class, | |
644 | char *name, s32 new_value) | |
645 | { | |
646 | return 0; | |
647 | } | |
648 | ||
649 | static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) | |
650 | { | |
651 | } | |
652 | ||
653 | static inline int prcmu_qos_add_notifier(int prcmu_qos_class, | |
654 | struct notifier_block *notifier) | |
655 | { | |
656 | return 0; | |
657 | } | |
658 | static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, | |
659 | struct notifier_block *notifier) | |
660 | { | |
661 | return 0; | |
662 | } | |
663 | ||
664 | #endif | |
665 | ||
666 | #endif /* __MACH_PRCMU_H */ |