diff options
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/clock.c | 15 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/clock.h | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 9833d73511a1..08baa18497b2 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -126,7 +126,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
126 | ret = arch_clock->clk_set_rate(clk, rate); | 126 | ret = arch_clock->clk_set_rate(clk, rate); |
127 | if (ret == 0) { | 127 | if (ret == 0) { |
128 | if (clk->recalc) | 128 | if (clk->recalc) |
129 | clk->recalc(clk); | 129 | clk->rate = clk->recalc(clk); |
130 | propagate_rate(clk); | 130 | propagate_rate(clk); |
131 | } | 131 | } |
132 | spin_unlock_irqrestore(&clockfw_lock, flags); | 132 | spin_unlock_irqrestore(&clockfw_lock, flags); |
@@ -148,7 +148,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent) | |||
148 | ret = arch_clock->clk_set_parent(clk, parent); | 148 | ret = arch_clock->clk_set_parent(clk, parent); |
149 | if (ret == 0) { | 149 | if (ret == 0) { |
150 | if (clk->recalc) | 150 | if (clk->recalc) |
151 | clk->recalc(clk); | 151 | clk->rate = clk->recalc(clk); |
152 | propagate_rate(clk); | 152 | propagate_rate(clk); |
153 | } | 153 | } |
154 | spin_unlock_irqrestore(&clockfw_lock, flags); | 154 | spin_unlock_irqrestore(&clockfw_lock, flags); |
@@ -188,12 +188,9 @@ static int __init omap_clk_setup(char *str) | |||
188 | __setup("mpurate=", omap_clk_setup); | 188 | __setup("mpurate=", omap_clk_setup); |
189 | 189 | ||
190 | /* Used for clocks that always have same value as the parent clock */ | 190 | /* Used for clocks that always have same value as the parent clock */ |
191 | void followparent_recalc(struct clk *clk) | 191 | unsigned long followparent_recalc(struct clk *clk) |
192 | { | 192 | { |
193 | if (clk == NULL || IS_ERR(clk)) | 193 | return clk->parent->rate; |
194 | return; | ||
195 | |||
196 | clk->rate = clk->parent->rate; | ||
197 | } | 194 | } |
198 | 195 | ||
199 | void clk_reparent(struct clk *child, struct clk *parent) | 196 | void clk_reparent(struct clk *child, struct clk *parent) |
@@ -214,7 +211,7 @@ void propagate_rate(struct clk * tclk) | |||
214 | 211 | ||
215 | list_for_each_entry(clkp, &tclk->children, sibling) { | 212 | list_for_each_entry(clkp, &tclk->children, sibling) { |
216 | if (clkp->recalc) | 213 | if (clkp->recalc) |
217 | clkp->recalc(clkp); | 214 | clkp->rate = clkp->recalc(clkp); |
218 | propagate_rate(clkp); | 215 | propagate_rate(clkp); |
219 | } | 216 | } |
220 | } | 217 | } |
@@ -234,7 +231,7 @@ void recalculate_root_clocks(void) | |||
234 | 231 | ||
235 | list_for_each_entry(clkp, &root_clks, sibling) { | 232 | list_for_each_entry(clkp, &root_clks, sibling) { |
236 | if (clkp->recalc) | 233 | if (clkp->recalc) |
237 | clkp->recalc(clkp); | 234 | clkp->rate = clkp->recalc(clkp); |
238 | propagate_rate(clkp); | 235 | propagate_rate(clkp); |
239 | } | 236 | } |
240 | } | 237 | } |
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h index 0ba28462a497..7b6f6bcbff94 100644 --- a/arch/arm/plat-omap/include/mach/clock.h +++ b/arch/arm/plat-omap/include/mach/clock.h | |||
@@ -75,7 +75,7 @@ struct clk { | |||
75 | unsigned long rate; | 75 | unsigned long rate; |
76 | __u32 flags; | 76 | __u32 flags; |
77 | void __iomem *enable_reg; | 77 | void __iomem *enable_reg; |
78 | void (*recalc)(struct clk *); | 78 | unsigned long (*recalc)(struct clk *); |
79 | int (*set_rate)(struct clk *, unsigned long); | 79 | int (*set_rate)(struct clk *, unsigned long); |
80 | long (*round_rate)(struct clk *, unsigned long); | 80 | long (*round_rate)(struct clk *, unsigned long); |
81 | void (*init)(struct clk *); | 81 | void (*init)(struct clk *); |
@@ -123,7 +123,7 @@ extern void clk_reparent(struct clk *child, struct clk *parent); | |||
123 | extern void clk_unregister(struct clk *clk); | 123 | extern void clk_unregister(struct clk *clk); |
124 | extern void propagate_rate(struct clk *clk); | 124 | extern void propagate_rate(struct clk *clk); |
125 | extern void recalculate_root_clocks(void); | 125 | extern void recalculate_root_clocks(void); |
126 | extern void followparent_recalc(struct clk *clk); | 126 | extern unsigned long followparent_recalc(struct clk *clk); |
127 | extern void clk_enable_init_clocks(void); | 127 | extern void clk_enable_init_clocks(void); |
128 | #ifdef CONFIG_CPU_FREQ | 128 | #ifdef CONFIG_CPU_FREQ |
129 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | 129 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); |