Skip to content

Commit

Permalink
ARM: 6926/1: SPEAr clock: Define common clk_init routine in plat/clock.c
Browse files Browse the repository at this point in the history
Define common clk_init routine in plat/clock.c for calling recalc_root_clocks.
This routine will be used for any common code across all machine families.
Whereas family specific spear*xx_clk_init routines will be used for family
specific code.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
viresh kumar authored and Russell King committed May 20, 2011
1 parent 16c29da commit b997f6e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-spear3xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,12 @@ static struct clk_lookup spear_clk_lookups[] = {
#endif
};

void __init clk_init(void)
void __init spear3xx_clk_init(void)
{
int i;

for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
clk_register(&spear_clk_lookups[i]);

recalc_root_clocks();
clk_init();
}
2 changes: 1 addition & 1 deletion arch/arm/mach-spear3xx/include/mach/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern struct amba_device uart_device;
extern struct sys_timer spear3xx_timer;

/* Add spear3xx family function declarations here */
void __init clk_init(void);
void __init spear3xx_clk_init(void);
void __init spear_setup_timer(void);
void __init spear3xx_map_io(void);
void __init spear3xx_init_irq(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-spear3xx/spear3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void __init spear3xx_map_io(void)
iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));

/* This will initialize clock framework */
clk_init();
spear3xx_clk_init();
}

/* pad multiplexing support */
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-spear6xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,12 +671,12 @@ static struct clk_lookup spear_clk_lookups[] = {
{ .dev_id = "gpio2", .clk = &gpio2_clk},
};

void __init clk_init(void)
void __init spear6xx_clk_init(void)
{
int i;

for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
clk_register(&spear_clk_lookups[i]);

recalc_root_clocks();
clk_init();
}
2 changes: 1 addition & 1 deletion arch/arm/mach-spear6xx/include/mach/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void __init spear6xx_map_io(void);
void __init spear6xx_init_irq(void);
void __init spear6xx_init(void);
void __init spear600_init(void);
void __init clk_init(void);
void __init spear6xx_clk_init(void);

/* Add spear600 machine device structure declarations here */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-spear6xx/spear6xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void __init spear6xx_map_io(void)
iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));

/* This will initialize clock framework */
clk_init();
spear6xx_clk_init();
}

static void __init spear6xx_timer_init(void)
Expand Down
5 changes: 5 additions & 0 deletions arch/arm/plat-spear/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,11 @@ void recalc_root_clocks(void)
spin_unlock_irqrestore(&clocks_lock, flags);
}

void __init clk_init(void)
{
recalc_root_clocks();
}

#ifdef CONFIG_DEBUG_FS
/*
* debugfs support to trace clock tree hierarchy and attributes
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-spear/include/plat/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ struct clcd_rate_tbl {
};

/* platform specific clock functions */
void __init clk_init(void);
void clk_register(struct clk_lookup *cl);
void recalc_root_clocks(void);

Expand Down

0 comments on commit b997f6e

Please sign in to comment.