diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 16:56:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 16:56:35 -0400 |
commit | 30304e5a79d424eb2c8707b3ff0e9b8bf6ab3e8f (patch) | |
tree | 63968fb97b86861e31922515395feef8a110f884 /include/linux/mfd/dbx500-prcmu.h | |
parent | 750f77064a290beb162352077b52c61b04bcae0e (diff) | |
parent | b8589e2a8065b8e7773742b60ae96b63b757bb69 (diff) |
Merge tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
- 4 new drivers: Freescale i.MX on-chip Anatop, Ricoh's RC5T583 and
TI's TPS65090 and TPS65217.
- New variants support (8420, 8520 ab9540), cleanups and bug fixes for
the abx500 and db8500 ST-E chipsets.
- Some minor fixes and update for the wm8994 from Mark.
- The beginning of a long term TWL cleanup effort coming from the TI
folks.
- Various fixes and cleanups for the s5m, TPS659xx, pm860x, and MAX8997
drivers.
Fix up trivial conflicts due to duplicate patches and header file
cleanups (<linux/device.h> removal etc).
* tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (97 commits)
gpio/twl: Add DT support to gpio-twl4030 driver
gpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support
mfd: Detach twl6040 from the pmic mfd driver
mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups
mfd: Micro-optimization on twl4030 IRQ handler
mfd: Make twl4030 SIH SPARSE_IRQ capable
mfd: Move twl-core IRQ allocation into twl[4030|6030]-irq files
mfd: Remove references already defineid in header file from twl-core
mfd: Remove unneeded header from twl-core
mfd: Make twl-core not depend on pdata->irq_base/end
ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
mfd: Return twl6030_mmc_card_detect IRQ for board setup
Revert "mfd: Add platform data for MAX8997 haptic driver"
mfd: Add support for TPS65090
mfd: Add some da9052-i2c section annotations
mfd: Build rtc5t583 only if I2C config is selected to y.
mfd: Add anatop mfd driver
mfd: Fix compilation error in tps65910.h
mfd: Add 8420 variant to db8500-prcmu
mfd: Add 8520 PRCMU variant to db8500-prcmu
...
Diffstat (limited to 'include/linux/mfd/dbx500-prcmu.h')
-rw-r--r-- | include/linux/mfd/dbx500-prcmu.h | 414 |
1 files changed, 390 insertions, 24 deletions
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index bac942f959c1..d7674eb7305f 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/notifier.h> | 12 | #include <linux/notifier.h> |
13 | #include <asm/mach-types.h> | 13 | #include <linux/err.h> |
14 | 14 | ||
15 | /* PRCMU Wakeup defines */ | 15 | /* PRCMU Wakeup defines */ |
16 | enum prcmu_wakeup_index { | 16 | enum prcmu_wakeup_index { |
@@ -80,6 +80,29 @@ enum prcmu_wakeup_index { | |||
80 | #define EPOD_STATE_ON_CLK_OFF 0x03 | 80 | #define EPOD_STATE_ON_CLK_OFF 0x03 |
81 | #define EPOD_STATE_ON 0x04 | 81 | #define EPOD_STATE_ON 0x04 |
82 | 82 | ||
83 | /* DB5500 CLKOUT IDs */ | ||
84 | enum { | ||
85 | DB5500_CLKOUT0 = 0, | ||
86 | DB5500_CLKOUT1, | ||
87 | }; | ||
88 | |||
89 | /* DB5500 CLKOUTx sources */ | ||
90 | enum { | ||
91 | DB5500_CLKOUT_REF_CLK_SEL0, | ||
92 | DB5500_CLKOUT_RTC_CLK0_SEL0, | ||
93 | DB5500_CLKOUT_ULP_CLK_SEL0, | ||
94 | DB5500_CLKOUT_STATIC0, | ||
95 | DB5500_CLKOUT_REFCLK, | ||
96 | DB5500_CLKOUT_ULPCLK, | ||
97 | DB5500_CLKOUT_ARMCLK, | ||
98 | DB5500_CLKOUT_SYSACC0CLK, | ||
99 | DB5500_CLKOUT_SOC0PLLCLK, | ||
100 | DB5500_CLKOUT_SOC1PLLCLK, | ||
101 | DB5500_CLKOUT_DDRPLLCLK, | ||
102 | DB5500_CLKOUT_TVCLK, | ||
103 | DB5500_CLKOUT_IRDACLK, | ||
104 | }; | ||
105 | |||
83 | /* | 106 | /* |
84 | * CLKOUT sources | 107 | * CLKOUT sources |
85 | */ | 108 | */ |
@@ -111,6 +134,7 @@ enum prcmu_clock { | |||
111 | PRCMU_MSP1CLK, | 134 | PRCMU_MSP1CLK, |
112 | PRCMU_I2CCLK, | 135 | PRCMU_I2CCLK, |
113 | PRCMU_SDMMCCLK, | 136 | PRCMU_SDMMCCLK, |
137 | PRCMU_SPARE1CLK, | ||
114 | PRCMU_SLIMCLK, | 138 | PRCMU_SLIMCLK, |
115 | PRCMU_PER1CLK, | 139 | PRCMU_PER1CLK, |
116 | PRCMU_PER2CLK, | 140 | PRCMU_PER2CLK, |
@@ -139,12 +163,20 @@ enum prcmu_clock { | |||
139 | PRCMU_IRRCCLK, | 163 | PRCMU_IRRCCLK, |
140 | PRCMU_SIACLK, | 164 | PRCMU_SIACLK, |
141 | PRCMU_SVACLK, | 165 | PRCMU_SVACLK, |
166 | PRCMU_ACLK, | ||
142 | PRCMU_NUM_REG_CLOCKS, | 167 | PRCMU_NUM_REG_CLOCKS, |
143 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | 168 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, |
169 | PRCMU_CDCLK, | ||
144 | PRCMU_TIMCLK, | 170 | PRCMU_TIMCLK, |
145 | PRCMU_PLLSOC0, | 171 | PRCMU_PLLSOC0, |
146 | PRCMU_PLLSOC1, | 172 | PRCMU_PLLSOC1, |
147 | PRCMU_PLLDDR, | 173 | PRCMU_PLLDDR, |
174 | PRCMU_PLLDSI, | ||
175 | PRCMU_DSI0CLK, | ||
176 | PRCMU_DSI1CLK, | ||
177 | PRCMU_DSI0ESCCLK, | ||
178 | PRCMU_DSI1ESCCLK, | ||
179 | PRCMU_DSI2ESCCLK, | ||
148 | }; | 180 | }; |
149 | 181 | ||
150 | /** | 182 | /** |
@@ -153,12 +185,14 @@ enum prcmu_clock { | |||
153 | * @APE_NO_CHANGE: The APE operating point is unchanged | 185 | * @APE_NO_CHANGE: The APE operating point is unchanged |
154 | * @APE_100_OPP: The new APE operating point is ape100opp | 186 | * @APE_100_OPP: The new APE operating point is ape100opp |
155 | * @APE_50_OPP: 50% | 187 | * @APE_50_OPP: 50% |
188 | * @APE_50_PARTLY_25_OPP: 50%, except some clocks at 25%. | ||
156 | */ | 189 | */ |
157 | enum ape_opp { | 190 | enum ape_opp { |
158 | APE_OPP_INIT = 0x00, | 191 | APE_OPP_INIT = 0x00, |
159 | APE_NO_CHANGE = 0x01, | 192 | APE_NO_CHANGE = 0x01, |
160 | APE_100_OPP = 0x02, | 193 | APE_100_OPP = 0x02, |
161 | APE_50_OPP = 0x03 | 194 | APE_50_OPP = 0x03, |
195 | APE_50_PARTLY_25_OPP = 0xFF, | ||
162 | }; | 196 | }; |
163 | 197 | ||
164 | /** | 198 | /** |
@@ -218,9 +252,11 @@ enum ddr_pwrst { | |||
218 | 252 | ||
219 | #if defined(CONFIG_UX500_SOC_DB8500) || defined(CONFIG_UX500_SOC_DB5500) | 253 | #if defined(CONFIG_UX500_SOC_DB8500) || defined(CONFIG_UX500_SOC_DB5500) |
220 | 254 | ||
255 | #include <mach/id.h> | ||
256 | |||
221 | static inline void __init prcmu_early_init(void) | 257 | static inline void __init prcmu_early_init(void) |
222 | { | 258 | { |
223 | if (machine_is_u5500()) | 259 | if (cpu_is_u5500()) |
224 | return db5500_prcmu_early_init(); | 260 | return db5500_prcmu_early_init(); |
225 | else | 261 | else |
226 | return db8500_prcmu_early_init(); | 262 | return db8500_prcmu_early_init(); |
@@ -229,7 +265,7 @@ static inline void __init prcmu_early_init(void) | |||
229 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | 265 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, |
230 | bool keep_ap_pll) | 266 | bool keep_ap_pll) |
231 | { | 267 | { |
232 | if (machine_is_u5500()) | 268 | if (cpu_is_u5500()) |
233 | return db5500_prcmu_set_power_state(state, keep_ulp_clk, | 269 | return db5500_prcmu_set_power_state(state, keep_ulp_clk, |
234 | keep_ap_pll); | 270 | keep_ap_pll); |
235 | else | 271 | else |
@@ -237,9 +273,65 @@ static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |||
237 | keep_ap_pll); | 273 | keep_ap_pll); |
238 | } | 274 | } |
239 | 275 | ||
276 | static inline u8 prcmu_get_power_state_result(void) | ||
277 | { | ||
278 | if (cpu_is_u5500()) | ||
279 | return -EINVAL; | ||
280 | else | ||
281 | return db8500_prcmu_get_power_state_result(); | ||
282 | } | ||
283 | |||
284 | static inline int prcmu_gic_decouple(void) | ||
285 | { | ||
286 | if (cpu_is_u5500()) | ||
287 | return -EINVAL; | ||
288 | else | ||
289 | return db8500_prcmu_gic_decouple(); | ||
290 | } | ||
291 | |||
292 | static inline int prcmu_gic_recouple(void) | ||
293 | { | ||
294 | if (cpu_is_u5500()) | ||
295 | return -EINVAL; | ||
296 | else | ||
297 | return db8500_prcmu_gic_recouple(); | ||
298 | } | ||
299 | |||
300 | static inline bool prcmu_gic_pending_irq(void) | ||
301 | { | ||
302 | if (cpu_is_u5500()) | ||
303 | return -EINVAL; | ||
304 | else | ||
305 | return db8500_prcmu_gic_pending_irq(); | ||
306 | } | ||
307 | |||
308 | static inline bool prcmu_is_cpu_in_wfi(int cpu) | ||
309 | { | ||
310 | if (cpu_is_u5500()) | ||
311 | return -EINVAL; | ||
312 | else | ||
313 | return db8500_prcmu_is_cpu_in_wfi(cpu); | ||
314 | } | ||
315 | |||
316 | static inline int prcmu_copy_gic_settings(void) | ||
317 | { | ||
318 | if (cpu_is_u5500()) | ||
319 | return -EINVAL; | ||
320 | else | ||
321 | return db8500_prcmu_copy_gic_settings(); | ||
322 | } | ||
323 | |||
324 | static inline bool prcmu_pending_irq(void) | ||
325 | { | ||
326 | if (cpu_is_u5500()) | ||
327 | return -EINVAL; | ||
328 | else | ||
329 | return db8500_prcmu_pending_irq(); | ||
330 | } | ||
331 | |||
240 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | 332 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) |
241 | { | 333 | { |
242 | if (machine_is_u5500()) | 334 | if (cpu_is_u5500()) |
243 | return -EINVAL; | 335 | return -EINVAL; |
244 | else | 336 | else |
245 | return db8500_prcmu_set_epod(epod_id, epod_state); | 337 | return db8500_prcmu_set_epod(epod_id, epod_state); |
@@ -247,7 +339,7 @@ static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | |||
247 | 339 | ||
248 | static inline void prcmu_enable_wakeups(u32 wakeups) | 340 | static inline void prcmu_enable_wakeups(u32 wakeups) |
249 | { | 341 | { |
250 | if (machine_is_u5500()) | 342 | if (cpu_is_u5500()) |
251 | db5500_prcmu_enable_wakeups(wakeups); | 343 | db5500_prcmu_enable_wakeups(wakeups); |
252 | else | 344 | else |
253 | db8500_prcmu_enable_wakeups(wakeups); | 345 | db8500_prcmu_enable_wakeups(wakeups); |
@@ -260,7 +352,7 @@ static inline void prcmu_disable_wakeups(void) | |||
260 | 352 | ||
261 | static inline void prcmu_config_abb_event_readout(u32 abb_events) | 353 | static inline void prcmu_config_abb_event_readout(u32 abb_events) |
262 | { | 354 | { |
263 | if (machine_is_u5500()) | 355 | if (cpu_is_u5500()) |
264 | db5500_prcmu_config_abb_event_readout(abb_events); | 356 | db5500_prcmu_config_abb_event_readout(abb_events); |
265 | else | 357 | else |
266 | db8500_prcmu_config_abb_event_readout(abb_events); | 358 | db8500_prcmu_config_abb_event_readout(abb_events); |
@@ -268,7 +360,7 @@ static inline void prcmu_config_abb_event_readout(u32 abb_events) | |||
268 | 360 | ||
269 | static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | 361 | static inline void prcmu_get_abb_event_buffer(void __iomem **buf) |
270 | { | 362 | { |
271 | if (machine_is_u5500()) | 363 | if (cpu_is_u5500()) |
272 | db5500_prcmu_get_abb_event_buffer(buf); | 364 | db5500_prcmu_get_abb_event_buffer(buf); |
273 | else | 365 | else |
274 | db8500_prcmu_get_abb_event_buffer(buf); | 366 | db8500_prcmu_get_abb_event_buffer(buf); |
@@ -276,25 +368,40 @@ static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | |||
276 | 368 | ||
277 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | 369 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); |
278 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | 370 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); |
371 | int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask, u8 size); | ||
279 | 372 | ||
280 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | 373 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); |
281 | 374 | ||
282 | static inline int prcmu_request_clock(u8 clock, bool enable) | 375 | static inline int prcmu_request_clock(u8 clock, bool enable) |
283 | { | 376 | { |
284 | if (machine_is_u5500()) | 377 | if (cpu_is_u5500()) |
285 | return db5500_prcmu_request_clock(clock, enable); | 378 | return db5500_prcmu_request_clock(clock, enable); |
286 | else | 379 | else |
287 | return db8500_prcmu_request_clock(clock, enable); | 380 | return db8500_prcmu_request_clock(clock, enable); |
288 | } | 381 | } |
289 | 382 | ||
290 | int prcmu_set_ape_opp(u8 opp); | 383 | unsigned long prcmu_clock_rate(u8 clock); |
291 | int prcmu_get_ape_opp(void); | 384 | long prcmu_round_clock_rate(u8 clock, unsigned long rate); |
292 | int prcmu_set_ddr_opp(u8 opp); | 385 | int prcmu_set_clock_rate(u8 clock, unsigned long rate); |
293 | int prcmu_get_ddr_opp(void); | 386 | |
387 | static inline int prcmu_set_ddr_opp(u8 opp) | ||
388 | { | ||
389 | if (cpu_is_u5500()) | ||
390 | return -EINVAL; | ||
391 | else | ||
392 | return db8500_prcmu_set_ddr_opp(opp); | ||
393 | } | ||
394 | static inline int prcmu_get_ddr_opp(void) | ||
395 | { | ||
396 | if (cpu_is_u5500()) | ||
397 | return -EINVAL; | ||
398 | else | ||
399 | return db8500_prcmu_get_ddr_opp(); | ||
400 | } | ||
294 | 401 | ||
295 | static inline int prcmu_set_arm_opp(u8 opp) | 402 | static inline int prcmu_set_arm_opp(u8 opp) |
296 | { | 403 | { |
297 | if (machine_is_u5500()) | 404 | if (cpu_is_u5500()) |
298 | return -EINVAL; | 405 | return -EINVAL; |
299 | else | 406 | else |
300 | return db8500_prcmu_set_arm_opp(opp); | 407 | return db8500_prcmu_set_arm_opp(opp); |
@@ -302,15 +409,31 @@ static inline int prcmu_set_arm_opp(u8 opp) | |||
302 | 409 | ||
303 | static inline int prcmu_get_arm_opp(void) | 410 | static inline int prcmu_get_arm_opp(void) |
304 | { | 411 | { |
305 | if (machine_is_u5500()) | 412 | if (cpu_is_u5500()) |
306 | return -EINVAL; | 413 | return -EINVAL; |
307 | else | 414 | else |
308 | return db8500_prcmu_get_arm_opp(); | 415 | return db8500_prcmu_get_arm_opp(); |
309 | } | 416 | } |
310 | 417 | ||
418 | static inline int prcmu_set_ape_opp(u8 opp) | ||
419 | { | ||
420 | if (cpu_is_u5500()) | ||
421 | return -EINVAL; | ||
422 | else | ||
423 | return db8500_prcmu_set_ape_opp(opp); | ||
424 | } | ||
425 | |||
426 | static inline int prcmu_get_ape_opp(void) | ||
427 | { | ||
428 | if (cpu_is_u5500()) | ||
429 | return -EINVAL; | ||
430 | else | ||
431 | return db8500_prcmu_get_ape_opp(); | ||
432 | } | ||
433 | |||
311 | static inline void prcmu_system_reset(u16 reset_code) | 434 | static inline void prcmu_system_reset(u16 reset_code) |
312 | { | 435 | { |
313 | if (machine_is_u5500()) | 436 | if (cpu_is_u5500()) |
314 | return db5500_prcmu_system_reset(reset_code); | 437 | return db5500_prcmu_system_reset(reset_code); |
315 | else | 438 | else |
316 | return db8500_prcmu_system_reset(reset_code); | 439 | return db8500_prcmu_system_reset(reset_code); |
@@ -318,7 +441,7 @@ static inline void prcmu_system_reset(u16 reset_code) | |||
318 | 441 | ||
319 | static inline u16 prcmu_get_reset_code(void) | 442 | static inline u16 prcmu_get_reset_code(void) |
320 | { | 443 | { |
321 | if (machine_is_u5500()) | 444 | if (cpu_is_u5500()) |
322 | return db5500_prcmu_get_reset_code(); | 445 | return db5500_prcmu_get_reset_code(); |
323 | else | 446 | else |
324 | return db8500_prcmu_get_reset_code(); | 447 | return db8500_prcmu_get_reset_code(); |
@@ -326,10 +449,17 @@ static inline u16 prcmu_get_reset_code(void) | |||
326 | 449 | ||
327 | void prcmu_ac_wake_req(void); | 450 | void prcmu_ac_wake_req(void); |
328 | void prcmu_ac_sleep_req(void); | 451 | void prcmu_ac_sleep_req(void); |
329 | void prcmu_modem_reset(void); | 452 | static inline void prcmu_modem_reset(void) |
453 | { | ||
454 | if (cpu_is_u5500()) | ||
455 | return; | ||
456 | else | ||
457 | return db8500_prcmu_modem_reset(); | ||
458 | } | ||
459 | |||
330 | static inline bool prcmu_is_ac_wake_requested(void) | 460 | static inline bool prcmu_is_ac_wake_requested(void) |
331 | { | 461 | { |
332 | if (machine_is_u5500()) | 462 | if (cpu_is_u5500()) |
333 | return db5500_prcmu_is_ac_wake_requested(); | 463 | return db5500_prcmu_is_ac_wake_requested(); |
334 | else | 464 | else |
335 | return db8500_prcmu_is_ac_wake_requested(); | 465 | return db8500_prcmu_is_ac_wake_requested(); |
@@ -337,7 +467,7 @@ static inline bool prcmu_is_ac_wake_requested(void) | |||
337 | 467 | ||
338 | static inline int prcmu_set_display_clocks(void) | 468 | static inline int prcmu_set_display_clocks(void) |
339 | { | 469 | { |
340 | if (machine_is_u5500()) | 470 | if (cpu_is_u5500()) |
341 | return db5500_prcmu_set_display_clocks(); | 471 | return db5500_prcmu_set_display_clocks(); |
342 | else | 472 | else |
343 | return db8500_prcmu_set_display_clocks(); | 473 | return db8500_prcmu_set_display_clocks(); |
@@ -345,7 +475,7 @@ static inline int prcmu_set_display_clocks(void) | |||
345 | 475 | ||
346 | static inline int prcmu_disable_dsipll(void) | 476 | static inline int prcmu_disable_dsipll(void) |
347 | { | 477 | { |
348 | if (machine_is_u5500()) | 478 | if (cpu_is_u5500()) |
349 | return db5500_prcmu_disable_dsipll(); | 479 | return db5500_prcmu_disable_dsipll(); |
350 | else | 480 | else |
351 | return db8500_prcmu_disable_dsipll(); | 481 | return db8500_prcmu_disable_dsipll(); |
@@ -353,7 +483,7 @@ static inline int prcmu_disable_dsipll(void) | |||
353 | 483 | ||
354 | static inline int prcmu_enable_dsipll(void) | 484 | static inline int prcmu_enable_dsipll(void) |
355 | { | 485 | { |
356 | if (machine_is_u5500()) | 486 | if (cpu_is_u5500()) |
357 | return db5500_prcmu_enable_dsipll(); | 487 | return db5500_prcmu_enable_dsipll(); |
358 | else | 488 | else |
359 | return db8500_prcmu_enable_dsipll(); | 489 | return db8500_prcmu_enable_dsipll(); |
@@ -361,11 +491,107 @@ static inline int prcmu_enable_dsipll(void) | |||
361 | 491 | ||
362 | static inline int prcmu_config_esram0_deep_sleep(u8 state) | 492 | static inline int prcmu_config_esram0_deep_sleep(u8 state) |
363 | { | 493 | { |
364 | if (machine_is_u5500()) | 494 | if (cpu_is_u5500()) |
365 | return -EINVAL; | 495 | return -EINVAL; |
366 | else | 496 | else |
367 | return db8500_prcmu_config_esram0_deep_sleep(state); | 497 | return db8500_prcmu_config_esram0_deep_sleep(state); |
368 | } | 498 | } |
499 | |||
500 | static inline int prcmu_config_hotdog(u8 threshold) | ||
501 | { | ||
502 | if (cpu_is_u5500()) | ||
503 | return -EINVAL; | ||
504 | else | ||
505 | return db8500_prcmu_config_hotdog(threshold); | ||
506 | } | ||
507 | |||
508 | static inline int prcmu_config_hotmon(u8 low, u8 high) | ||
509 | { | ||
510 | if (cpu_is_u5500()) | ||
511 | return -EINVAL; | ||
512 | else | ||
513 | return db8500_prcmu_config_hotmon(low, high); | ||
514 | } | ||
515 | |||
516 | static inline int prcmu_start_temp_sense(u16 cycles32k) | ||
517 | { | ||
518 | if (cpu_is_u5500()) | ||
519 | return -EINVAL; | ||
520 | else | ||
521 | return db8500_prcmu_start_temp_sense(cycles32k); | ||
522 | } | ||
523 | |||
524 | static inline int prcmu_stop_temp_sense(void) | ||
525 | { | ||
526 | if (cpu_is_u5500()) | ||
527 | return -EINVAL; | ||
528 | else | ||
529 | return db8500_prcmu_stop_temp_sense(); | ||
530 | } | ||
531 | |||
532 | static inline u32 prcmu_read(unsigned int reg) | ||
533 | { | ||
534 | if (cpu_is_u5500()) | ||
535 | return -EINVAL; | ||
536 | else | ||
537 | return db8500_prcmu_read(reg); | ||
538 | } | ||
539 | |||
540 | static inline void prcmu_write(unsigned int reg, u32 value) | ||
541 | { | ||
542 | if (cpu_is_u5500()) | ||
543 | return; | ||
544 | else | ||
545 | db8500_prcmu_write(reg, value); | ||
546 | } | ||
547 | |||
548 | static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) | ||
549 | { | ||
550 | if (cpu_is_u5500()) | ||
551 | return; | ||
552 | else | ||
553 | db8500_prcmu_write_masked(reg, mask, value); | ||
554 | } | ||
555 | |||
556 | static inline int prcmu_enable_a9wdog(u8 id) | ||
557 | { | ||
558 | if (cpu_is_u5500()) | ||
559 | return -EINVAL; | ||
560 | else | ||
561 | return db8500_prcmu_enable_a9wdog(id); | ||
562 | } | ||
563 | |||
564 | static inline int prcmu_disable_a9wdog(u8 id) | ||
565 | { | ||
566 | if (cpu_is_u5500()) | ||
567 | return -EINVAL; | ||
568 | else | ||
569 | return db8500_prcmu_disable_a9wdog(id); | ||
570 | } | ||
571 | |||
572 | static inline int prcmu_kick_a9wdog(u8 id) | ||
573 | { | ||
574 | if (cpu_is_u5500()) | ||
575 | return -EINVAL; | ||
576 | else | ||
577 | return db8500_prcmu_kick_a9wdog(id); | ||
578 | } | ||
579 | |||
580 | static inline int prcmu_load_a9wdog(u8 id, u32 timeout) | ||
581 | { | ||
582 | if (cpu_is_u5500()) | ||
583 | return -EINVAL; | ||
584 | else | ||
585 | return db8500_prcmu_load_a9wdog(id, timeout); | ||
586 | } | ||
587 | |||
588 | static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off) | ||
589 | { | ||
590 | if (cpu_is_u5500()) | ||
591 | return -EINVAL; | ||
592 | else | ||
593 | return db8500_prcmu_config_a9wdog(num, sleep_auto_off); | ||
594 | } | ||
369 | #else | 595 | #else |
370 | 596 | ||
371 | static inline void __init prcmu_early_init(void) {} | 597 | static inline void __init prcmu_early_init(void) {} |
@@ -395,6 +621,12 @@ static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | |||
395 | return -ENOSYS; | 621 | return -ENOSYS; |
396 | } | 622 | } |
397 | 623 | ||
624 | static inline int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask, | ||
625 | u8 size) | ||
626 | { | ||
627 | return -ENOSYS; | ||
628 | } | ||
629 | |||
398 | static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) | 630 | static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) |
399 | { | 631 | { |
400 | return 0; | 632 | return 0; |
@@ -405,6 +637,21 @@ static inline int prcmu_request_clock(u8 clock, bool enable) | |||
405 | return 0; | 637 | return 0; |
406 | } | 638 | } |
407 | 639 | ||
640 | static inline long prcmu_round_clock_rate(u8 clock, unsigned long rate) | ||
641 | { | ||
642 | return 0; | ||
643 | } | ||
644 | |||
645 | static inline int prcmu_set_clock_rate(u8 clock, unsigned long rate) | ||
646 | { | ||
647 | return 0; | ||
648 | } | ||
649 | |||
650 | static inline unsigned long prcmu_clock_rate(u8 clock) | ||
651 | { | ||
652 | return 0; | ||
653 | } | ||
654 | |||
408 | static inline int prcmu_set_ape_opp(u8 opp) | 655 | static inline int prcmu_set_ape_opp(u8 opp) |
409 | { | 656 | { |
410 | return 0; | 657 | return 0; |
@@ -480,14 +727,133 @@ static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | |||
480 | *buf = NULL; | 727 | *buf = NULL; |
481 | } | 728 | } |
482 | 729 | ||
730 | static inline int prcmu_config_hotdog(u8 threshold) | ||
731 | { | ||
732 | return 0; | ||
733 | } | ||
734 | |||
735 | static inline int prcmu_config_hotmon(u8 low, u8 high) | ||
736 | { | ||
737 | return 0; | ||
738 | } | ||
739 | |||
740 | static inline int prcmu_start_temp_sense(u16 cycles32k) | ||
741 | { | ||
742 | return 0; | ||
743 | } | ||
744 | |||
745 | static inline int prcmu_stop_temp_sense(void) | ||
746 | { | ||
747 | return 0; | ||
748 | } | ||
749 | |||
750 | static inline u32 prcmu_read(unsigned int reg) | ||
751 | { | ||
752 | return 0; | ||
753 | } | ||
754 | |||
755 | static inline void prcmu_write(unsigned int reg, u32 value) {} | ||
756 | |||
757 | static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) {} | ||
758 | |||
759 | #endif | ||
760 | |||
761 | static inline void prcmu_set(unsigned int reg, u32 bits) | ||
762 | { | ||
763 | prcmu_write_masked(reg, bits, bits); | ||
764 | } | ||
765 | |||
766 | static inline void prcmu_clear(unsigned int reg, u32 bits) | ||
767 | { | ||
768 | prcmu_write_masked(reg, bits, 0); | ||
769 | } | ||
770 | |||
771 | #if defined(CONFIG_UX500_SOC_DB8500) || defined(CONFIG_UX500_SOC_DB5500) | ||
772 | |||
773 | /** | ||
774 | * prcmu_enable_spi2 - Enables pin muxing for SPI2 on OtherAlternateC1. | ||
775 | */ | ||
776 | static inline void prcmu_enable_spi2(void) | ||
777 | { | ||
778 | if (cpu_is_u8500()) | ||
779 | prcmu_set(DB8500_PRCM_GPIOCR, DB8500_PRCM_GPIOCR_SPI2_SELECT); | ||
780 | } | ||
781 | |||
782 | /** | ||
783 | * prcmu_disable_spi2 - Disables pin muxing for SPI2 on OtherAlternateC1. | ||
784 | */ | ||
785 | static inline void prcmu_disable_spi2(void) | ||
786 | { | ||
787 | if (cpu_is_u8500()) | ||
788 | prcmu_clear(DB8500_PRCM_GPIOCR, DB8500_PRCM_GPIOCR_SPI2_SELECT); | ||
789 | } | ||
790 | |||
791 | /** | ||
792 | * prcmu_enable_stm_mod_uart - Enables pin muxing for STMMOD | ||
793 | * and UARTMOD on OtherAlternateC3. | ||
794 | */ | ||
795 | static inline void prcmu_enable_stm_mod_uart(void) | ||
796 | { | ||
797 | if (cpu_is_u8500()) { | ||
798 | prcmu_set(DB8500_PRCM_GPIOCR, | ||
799 | (DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 | | ||
800 | DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0)); | ||
801 | } | ||
802 | } | ||
803 | |||
804 | /** | ||
805 | * prcmu_disable_stm_mod_uart - Disables pin muxing for STMMOD | ||
806 | * and UARTMOD on OtherAlternateC3. | ||
807 | */ | ||
808 | static inline void prcmu_disable_stm_mod_uart(void) | ||
809 | { | ||
810 | if (cpu_is_u8500()) { | ||
811 | prcmu_clear(DB8500_PRCM_GPIOCR, | ||
812 | (DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 | | ||
813 | DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0)); | ||
814 | } | ||
815 | } | ||
816 | |||
817 | /** | ||
818 | * prcmu_enable_stm_ape - Enables pin muxing for STM APE on OtherAlternateC1. | ||
819 | */ | ||
820 | static inline void prcmu_enable_stm_ape(void) | ||
821 | { | ||
822 | if (cpu_is_u8500()) { | ||
823 | prcmu_set(DB8500_PRCM_GPIOCR, | ||
824 | DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD); | ||
825 | } | ||
826 | } | ||
827 | |||
828 | /** | ||
829 | * prcmu_disable_stm_ape - Disables pin muxing for STM APE on OtherAlternateC1. | ||
830 | */ | ||
831 | static inline void prcmu_disable_stm_ape(void) | ||
832 | { | ||
833 | if (cpu_is_u8500()) { | ||
834 | prcmu_clear(DB8500_PRCM_GPIOCR, | ||
835 | DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD); | ||
836 | } | ||
837 | } | ||
838 | |||
839 | #else | ||
840 | |||
841 | static inline void prcmu_enable_spi2(void) {} | ||
842 | static inline void prcmu_disable_spi2(void) {} | ||
843 | static inline void prcmu_enable_stm_mod_uart(void) {} | ||
844 | static inline void prcmu_disable_stm_mod_uart(void) {} | ||
845 | static inline void prcmu_enable_stm_ape(void) {} | ||
846 | static inline void prcmu_disable_stm_ape(void) {} | ||
847 | |||
483 | #endif | 848 | #endif |
484 | 849 | ||
485 | /* PRCMU QoS APE OPP class */ | 850 | /* PRCMU QoS APE OPP class */ |
486 | #define PRCMU_QOS_APE_OPP 1 | 851 | #define PRCMU_QOS_APE_OPP 1 |
487 | #define PRCMU_QOS_DDR_OPP 2 | 852 | #define PRCMU_QOS_DDR_OPP 2 |
853 | #define PRCMU_QOS_ARM_OPP 3 | ||
488 | #define PRCMU_QOS_DEFAULT_VALUE -1 | 854 | #define PRCMU_QOS_DEFAULT_VALUE -1 |
489 | 855 | ||
490 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | 856 | #ifdef CONFIG_DBX500_PRCMU_QOS_POWER |
491 | 857 | ||
492 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | 858 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); |
493 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | 859 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); |