aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-03-31 11:15:45 -0400
committerPaul Walmsley <paul@pwsan.com>2014-05-16 00:35:04 -0400
commitb550e47f5e9e74999f754371bdc79331d19f84a3 (patch)
tree7d549eb62e5af53722e0373a89b2b192977e1306 /arch/arm/mach-omap2
parent2541d15f16479fd56debe1ea55dee03c3886e33c (diff)
ARM: OMAP3/4: PRM: add support of late_init call to prm_ll_ops
SoC specific late_init call is now registered during PRM init, and will be called automatically by PRM core. This helps to get rid of some redundant initcalls and cpu_is_X checks from the PRM code. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/prm.h2
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c7
-rw-r--r--arch/arm/mach-omap2/prm44xx.c7
-rw-r--r--arch/arm/mach-omap2/prm_common.c8
4 files changed, 16 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 04426c441fff..48480d557b61 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -126,6 +126,7 @@ struct prm_reset_src_map {
126 * @read_reset_sources: ptr to the SoC PRM-specific get_reset_source impl 126 * @read_reset_sources: ptr to the SoC PRM-specific get_reset_source impl
127 * @was_any_context_lost_old: ptr to the SoC PRM context loss test fn 127 * @was_any_context_lost_old: ptr to the SoC PRM context loss test fn
128 * @clear_context_loss_flags_old: ptr to the SoC PRM context loss flag clear fn 128 * @clear_context_loss_flags_old: ptr to the SoC PRM context loss flag clear fn
129 * @late_init: ptr to the late init function
129 * 130 *
130 * XXX @was_any_context_lost_old and @clear_context_loss_flags_old are 131 * XXX @was_any_context_lost_old and @clear_context_loss_flags_old are
131 * deprecated. 132 * deprecated.
@@ -134,6 +135,7 @@ struct prm_ll_data {
134 u32 (*read_reset_sources)(void); 135 u32 (*read_reset_sources)(void);
135 bool (*was_any_context_lost_old)(u8 part, s16 inst, u16 idx); 136 bool (*was_any_context_lost_old)(u8 part, s16 inst, u16 idx);
136 void (*clear_context_loss_flags_old)(u8 part, s16 inst, u16 idx); 137 void (*clear_context_loss_flags_old)(u8 part, s16 inst, u16 idx);
138 int (*late_init)(void);
137}; 139};
138 140
139extern int prm_register(struct prm_ll_data *pld); 141extern int prm_register(struct prm_ll_data *pld);
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 9c95ac21c5b3..4a792fd1363c 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -401,8 +401,11 @@ struct pwrdm_ops omap3_pwrdm_operations = {
401 * 401 *
402 */ 402 */
403 403
404static int omap3xxx_prm_late_init(void);
405
404static struct prm_ll_data omap3xxx_prm_ll_data = { 406static struct prm_ll_data omap3xxx_prm_ll_data = {
405 .read_reset_sources = &omap3xxx_prm_read_reset_sources, 407 .read_reset_sources = &omap3xxx_prm_read_reset_sources,
408 .late_init = &omap3xxx_prm_late_init,
406}; 409};
407 410
408int __init omap3xxx_prm_init(void) 411int __init omap3xxx_prm_init(void)
@@ -417,9 +420,6 @@ static int __init omap3xxx_prm_late_init(void)
417{ 420{
418 int ret; 421 int ret;
419 422
420 if (!cpu_is_omap34xx())
421 return 0;
422
423 if (!(prm_features & PRM_HAS_IO_WAKEUP)) 423 if (!(prm_features & PRM_HAS_IO_WAKEUP))
424 return 0; 424 return 0;
425 425
@@ -431,7 +431,6 @@ static int __init omap3xxx_prm_late_init(void)
431 431
432 return ret; 432 return ret;
433} 433}
434omap_subsys_initcall(omap3xxx_prm_late_init);
435 434
436static void __exit omap3xxx_prm_exit(void) 435static void __exit omap3xxx_prm_exit(void)
437{ 436{
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index e4e52f14dbbf..edf49ef867e1 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -650,6 +650,8 @@ struct pwrdm_ops omap4_pwrdm_operations = {
650 .pwrdm_has_voltdm = omap4_check_vcvp, 650 .pwrdm_has_voltdm = omap4_check_vcvp,
651}; 651};
652 652
653static int omap44xx_prm_late_init(void);
654
653/* 655/*
654 * XXX document 656 * XXX document
655 */ 657 */
@@ -657,6 +659,7 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
657 .read_reset_sources = &omap44xx_prm_read_reset_sources, 659 .read_reset_sources = &omap44xx_prm_read_reset_sources,
658 .was_any_context_lost_old = &omap44xx_prm_was_any_context_lost_old, 660 .was_any_context_lost_old = &omap44xx_prm_was_any_context_lost_old,
659 .clear_context_loss_flags_old = &omap44xx_prm_clear_context_loss_flags_old, 661 .clear_context_loss_flags_old = &omap44xx_prm_clear_context_loss_flags_old,
662 .late_init = &omap44xx_prm_late_init,
660}; 663};
661 664
662int __init omap44xx_prm_init(void) 665int __init omap44xx_prm_init(void)
@@ -669,9 +672,6 @@ int __init omap44xx_prm_init(void)
669 672
670static int __init omap44xx_prm_late_init(void) 673static int __init omap44xx_prm_late_init(void)
671{ 674{
672 if (!cpu_is_omap44xx())
673 return 0;
674
675 if (!(prm_features & PRM_HAS_IO_WAKEUP)) 675 if (!(prm_features & PRM_HAS_IO_WAKEUP))
676 return 0; 676 return 0;
677 677
@@ -679,7 +679,6 @@ static int __init omap44xx_prm_late_init(void)
679 679
680 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); 680 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
681} 681}
682omap_subsys_initcall(omap44xx_prm_late_init);
683 682
684static void __exit omap44xx_prm_exit(void) 683static void __exit omap44xx_prm_exit(void)
685{ 684{
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index aa2550dd2ac1..25e8b8232115 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -527,3 +527,11 @@ int __init of_prcm_init(void)
527 527
528 return 0; 528 return 0;
529} 529}
530
531static int __init prm_late_init(void)
532{
533 if (prm_ll_data->late_init)
534 return prm_ll_data->late_init();
535 return 0;
536}
537subsys_initcall(prm_late_init);