Skip to content

Commit

Permalink
ARM: ux500: use machine specific hook for late init
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Shawn Guo committed May 8, 2012
1 parent 390e0cf commit a010bc2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
4 changes: 4 additions & 0 deletions arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
.timer = &ux500_timer,
.handle_irq = gic_handle_irq,
.init_machine = mop500_init_machine,
.init_late = ux500_init_late,
MACHINE_END

MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
Expand All @@ -731,6 +732,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
.timer = &ux500_timer,
.handle_irq = gic_handle_irq,
.init_machine = hrefv60_init_machine,
.init_late = ux500_init_late,
MACHINE_END

MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
Expand All @@ -741,6 +743,7 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
.timer = &ux500_timer,
.handle_irq = gic_handle_irq,
.init_machine = snowball_init_machine,
.init_late = ux500_init_late,
MACHINE_END

#ifdef CONFIG_MACH_UX500_DT
Expand Down Expand Up @@ -830,6 +833,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
.timer = &ux500_timer,
.handle_irq = gic_handle_irq,
.init_machine = u8500_init_machine,
.init_late = ux500_init_late,
.dt_compat = u8500_dt_board_compat,
MACHINE_END
#endif
6 changes: 2 additions & 4 deletions arch/arm/mach-ux500/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static int clk_debugfs_register(struct clk *c)
return 0;
}

static int __init clk_debugfs_init(void)
int __init clk_debugfs_init(void)
{
struct clk *c;
struct dentry *d;
Expand All @@ -655,7 +655,6 @@ static int __init clk_debugfs_init(void)
return err;
}

late_initcall(clk_debugfs_init);
#endif /* defined(CONFIG_DEBUG_FS) */

unsigned long clk_smp_twd_rate = 500000000;
Expand Down Expand Up @@ -694,12 +693,11 @@ static struct notifier_block clk_twd_cpufreq_nb = {
.notifier_call = clk_twd_cpufreq_transition,
};

static int clk_init_smp_twd_cpufreq(void)
int clk_init_smp_twd_cpufreq(void)
{
return cpufreq_register_notifier(&clk_twd_cpufreq_nb,
CPUFREQ_TRANSITION_NOTIFIER);
}
late_initcall(clk_init_smp_twd_cpufreq);

#endif

Expand Down
12 changes: 12 additions & 0 deletions arch/arm/mach-ux500/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,15 @@ struct clk clk_##_name = { \

int __init clk_db8500_ed_fixup(void);
int __init clk_init(void);

#ifdef CONFIG_DEBUG_FS
int clk_debugfs_init(void);
#else
static inline int clk_debugfs_init(void) { return 0; }
#endif

#ifdef CONFIG_CPU_FREQ
int clk_init_smp_twd_cpufreq(void);
#else
static inline int clk_init_smp_twd_cpufreq(void) { return 0; }
#endif
6 changes: 6 additions & 0 deletions arch/arm/mach-ux500/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ void __init ux500_init_irq(void)
clk_init();
}

void __init ux500_init_late(void)
{
clk_debugfs_init();
clk_init_smp_twd_cpufreq();
}

static const char * __init ux500_get_machine(void)
{
return kasprintf(GFP_KERNEL, "DB%4x", dbx500_partnumber());
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ux500/include/mach/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extern struct device * __init u5500_init_devices(void);
extern struct device * __init u8500_init_devices(void);

extern void __init ux500_init_irq(void);
extern void __init ux500_init_late(void);

extern void __init u5500_sdi_init(struct device *parent);

Expand Down

0 comments on commit a010bc2

Please sign in to comment.