diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-11-04 12:59:52 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-08 06:38:40 -0500 |
commit | b36ee724208358bd892ad279efce629740517149 (patch) | |
tree | 01f8f3c5a5eeaf7a0a370677d08c512de8a8adf2 /arch/arm/mach-omap2/clock.c | |
parent | 57137181e3136d4c7b20b4b95b9817efd38f8f07 (diff) |
[ARM] omap: add default .ops to all remaining OMAP2 clocks
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 21fbe29810ac..8c09711d2eaf 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -264,16 +264,10 @@ static void omap2_clk_wait_ready(struct clk *clk) | |||
264 | omap2_wait_clock_ready(st_reg, bit, clk->name); | 264 | omap2_wait_clock_ready(st_reg, bit, clk->name); |
265 | } | 265 | } |
266 | 266 | ||
267 | /* Enables clock without considering parent dependencies or use count | 267 | static int omap2_dflt_clk_enable_wait(struct clk *clk) |
268 | * REVISIT: Maybe change this to use clk->enable like on omap1? | ||
269 | */ | ||
270 | int _omap2_clk_enable(struct clk *clk) | ||
271 | { | 268 | { |
272 | u32 regval32; | 269 | u32 regval32; |
273 | 270 | ||
274 | if (clk->ops && clk->ops->enable) | ||
275 | return clk->ops->enable(clk); | ||
276 | |||
277 | if (unlikely(clk->enable_reg == NULL)) { | 271 | if (unlikely(clk->enable_reg == NULL)) { |
278 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", | 272 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", |
279 | clk->name); | 273 | clk->name); |
@@ -293,16 +287,10 @@ int _omap2_clk_enable(struct clk *clk) | |||
293 | return 0; | 287 | return 0; |
294 | } | 288 | } |
295 | 289 | ||
296 | /* Disables clock without considering parent dependencies or use count */ | 290 | static void omap2_dflt_clk_disable(struct clk *clk) |
297 | void _omap2_clk_disable(struct clk *clk) | ||
298 | { | 291 | { |
299 | u32 regval32; | 292 | u32 regval32; |
300 | 293 | ||
301 | if (clk->ops && clk->ops->disable) { | ||
302 | clk->ops->disable(clk); | ||
303 | return; | ||
304 | } | ||
305 | |||
306 | if (clk->enable_reg == NULL) { | 294 | if (clk->enable_reg == NULL) { |
307 | /* | 295 | /* |
308 | * 'Independent' here refers to a clock which is not | 296 | * 'Independent' here refers to a clock which is not |
@@ -322,6 +310,25 @@ void _omap2_clk_disable(struct clk *clk) | |||
322 | wmb(); | 310 | wmb(); |
323 | } | 311 | } |
324 | 312 | ||
313 | const struct clkops clkops_omap2_dflt_wait = { | ||
314 | .enable = omap2_dflt_clk_enable_wait, | ||
315 | .disable = omap2_dflt_clk_disable, | ||
316 | }; | ||
317 | |||
318 | /* Enables clock without considering parent dependencies or use count | ||
319 | * REVISIT: Maybe change this to use clk->enable like on omap1? | ||
320 | */ | ||
321 | static int _omap2_clk_enable(struct clk *clk) | ||
322 | { | ||
323 | return clk->ops->enable(clk); | ||
324 | } | ||
325 | |||
326 | /* Disables clock without considering parent dependencies or use count */ | ||
327 | static void _omap2_clk_disable(struct clk *clk) | ||
328 | { | ||
329 | clk->ops->disable(clk); | ||
330 | } | ||
331 | |||
325 | void omap2_clk_disable(struct clk *clk) | 332 | void omap2_clk_disable(struct clk *clk) |
326 | { | 333 | { |
327 | if (clk->usecount > 0 && !(--clk->usecount)) { | 334 | if (clk->usecount > 0 && !(--clk->usecount)) { |