aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-01-26 22:12:57 -0500
committerPaul Walmsley <paul@pwsan.com>2010-01-26 22:12:57 -0500
commite9b98f6040f5a7a04d659759d83ea28d9c528800 (patch)
tree904811708c1e70cb26eb5e680e3974087085954f /arch/arm/plat-omap
parentced825293ac34d4f250775c40f13cc6330653309 (diff)
OMAP clock: make the fixed divisor clock code available for all OMAPs
One of the OMAP1 clocks can use the fixed divisor recalculation code introduced in the OMAP2 clock code, so rename the omap2_fixed_divisor_recalc() function to omap_fixed_divisor_recalc() and make it available to all OMAPs. A followup patch converts the OMAP1 clock. Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/clock.c11
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h3
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index d9f8c844c385..e0f72f48b8b1 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -199,6 +199,17 @@ unsigned long followparent_recalc(struct clk *clk)
199 return clk->parent->rate; 199 return clk->parent->rate;
200} 200}
201 201
202/*
203 * Used for clocks that have the same value as the parent clock,
204 * divided by some factor
205 */
206unsigned long omap_fixed_divisor_recalc(struct clk *clk)
207{
208 WARN_ON(!clk->fixed_div);
209
210 return clk->parent->rate / clk->fixed_div;
211}
212
202void clk_reparent(struct clk *child, struct clk *parent) 213void clk_reparent(struct clk *child, struct clk *parent)
203{ 214{
204 list_del_init(&child->sibling); 215 list_del_init(&child->sibling);
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 94fe2a0ce40a..896cedc923a7 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -88,9 +88,9 @@ struct clk {
88 void (*init)(struct clk *); 88 void (*init)(struct clk *);
89 __u8 enable_bit; 89 __u8 enable_bit;
90 __s8 usecount; 90 __s8 usecount;
91 u8 fixed_div;
91#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ 92#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
92 defined(CONFIG_ARCH_OMAP4) 93 defined(CONFIG_ARCH_OMAP4)
93 u8 fixed_div;
94 void __iomem *clksel_reg; 94 void __iomem *clksel_reg;
95 u32 clksel_mask; 95 u32 clksel_mask;
96 const struct clksel *clksel; 96 const struct clksel *clksel;
@@ -134,6 +134,7 @@ extern void propagate_rate(struct clk *clk);
134extern void recalculate_root_clocks(void); 134extern void recalculate_root_clocks(void);
135extern unsigned long followparent_recalc(struct clk *clk); 135extern unsigned long followparent_recalc(struct clk *clk);
136extern void clk_enable_init_clocks(void); 136extern void clk_enable_init_clocks(void);
137unsigned long omap_fixed_divisor_recalc(struct clk *clk);
137#ifdef CONFIG_CPU_FREQ 138#ifdef CONFIG_CPU_FREQ
138extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); 139extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
139extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); 140extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);