diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-11-04 11:35:03 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-08 06:38:39 -0500 |
commit | 897dcded6fb6565f4d1c22a55d21f135403db132 (patch) | |
tree | da9c4028ed49a1482445131760b4fc45c6524abe /arch/arm/plat-omap | |
parent | 548d849574847b788fe846fe21a41386063be161 (diff) |
[ARM] omap: provide a NULL clock operations structure
... and use it for clocks which are ALWAYS_ENABLED. These clocks
use a non-NULL enable_reg pointer for other purposes (such as
selecting clock rates.)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/clock.c | 23 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/clock.h | 4 |
2 files changed, 24 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index be6aab9c6834..529c4a9f012e 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -358,6 +358,23 @@ void clk_enable_init_clocks(void) | |||
358 | } | 358 | } |
359 | EXPORT_SYMBOL(clk_enable_init_clocks); | 359 | EXPORT_SYMBOL(clk_enable_init_clocks); |
360 | 360 | ||
361 | /* | ||
362 | * Low level helpers | ||
363 | */ | ||
364 | static int clkll_enable_null(struct clk *clk) | ||
365 | { | ||
366 | return 0; | ||
367 | } | ||
368 | |||
369 | static void clkll_disable_null(struct clk *clk) | ||
370 | { | ||
371 | } | ||
372 | |||
373 | const struct clkops clkops_null = { | ||
374 | .enable = clkll_enable_null, | ||
375 | .disable = clkll_disable_null, | ||
376 | }; | ||
377 | |||
361 | #ifdef CONFIG_CPU_FREQ | 378 | #ifdef CONFIG_CPU_FREQ |
362 | void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | 379 | void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) |
363 | { | 380 | { |
@@ -383,8 +400,10 @@ static int __init clk_disable_unused(void) | |||
383 | unsigned long flags; | 400 | unsigned long flags; |
384 | 401 | ||
385 | list_for_each_entry(ck, &clocks, node) { | 402 | list_for_each_entry(ck, &clocks, node) { |
386 | if (ck->usecount > 0 || (ck->flags & ALWAYS_ENABLED) || | 403 | if (ck->ops == &clkops_null) |
387 | ck->enable_reg == 0) | 404 | continue; |
405 | |||
406 | if (ck->usecount > 0 || ck->enable_reg == 0) | ||
388 | continue; | 407 | continue; |
389 | 408 | ||
390 | spin_lock_irqsave(&clockfw_lock, flags); | 409 | spin_lock_irqsave(&clockfw_lock, flags); |
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h index 4fe5084e8cc2..c1e484463ed5 100644 --- a/arch/arm/plat-omap/include/mach/clock.h +++ b/arch/arm/plat-omap/include/mach/clock.h | |||
@@ -125,11 +125,13 @@ extern void clk_deny_idle(struct clk *clk); | |||
125 | extern int clk_get_usecount(struct clk *clk); | 125 | extern int clk_get_usecount(struct clk *clk); |
126 | extern void clk_enable_init_clocks(void); | 126 | extern void clk_enable_init_clocks(void); |
127 | 127 | ||
128 | extern const struct clkops clkops_null; | ||
129 | |||
128 | /* Clock flags */ | 130 | /* Clock flags */ |
129 | #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ | 131 | #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ |
130 | #define RATE_FIXED (1 << 1) /* Fixed clock rate */ | 132 | #define RATE_FIXED (1 << 1) /* Fixed clock rate */ |
131 | #define RATE_PROPAGATES (1 << 2) /* Program children too */ | 133 | #define RATE_PROPAGATES (1 << 2) /* Program children too */ |
132 | #define ALWAYS_ENABLED (1 << 4) /* Clock cannot be disabled */ | 134 | /* bits 3-4 are free */ |
133 | #define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ | 135 | #define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ |
134 | #define VIRTUAL_IO_ADDRESS (1 << 6) /* Clock in virtual address */ | 136 | #define VIRTUAL_IO_ADDRESS (1 << 6) /* Clock in virtual address */ |
135 | #define CLOCK_IDLE_CONTROL (1 << 7) | 137 | #define CLOCK_IDLE_CONTROL (1 << 7) |