diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-02-16 08:27:06 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-03-13 05:33:50 -0400 |
commit | d1755e3592305f8866b4d60d63a481959d5e58bf (patch) | |
tree | 237953bbce244a53398a967e61ea0c63ec95cb6e /arch/arm | |
parent | e65fb0099fe4fe82d59ffe84f1e88a489218d7f9 (diff) |
[ARM] MXC: add clkdev support
This patch only adds general clkdev support without actually switching
any MXC architecture to clkdev.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-mxc/clock.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/clkdev.h | 7 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/clock.h | 4 |
3 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c index 888dd33abf76..92e13566cd4f 100644 --- a/arch/arm/plat-mxc/clock.c +++ b/arch/arm/plat-mxc/clock.c | |||
@@ -48,6 +48,11 @@ static DEFINE_MUTEX(clocks_mutex); | |||
48 | *-------------------------------------------------------------------------*/ | 48 | *-------------------------------------------------------------------------*/ |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * All the code inside #ifndef CONFIG_COMMON_CLKDEV can be removed once all | ||
52 | * MXC architectures have switched to using clkdev. | ||
53 | */ | ||
54 | #ifndef CONFIG_COMMON_CLKDEV | ||
55 | /* | ||
51 | * Retrieve a clock by name. | 56 | * Retrieve a clock by name. |
52 | * | 57 | * |
53 | * Note that we first try to use device id on the bus | 58 | * Note that we first try to use device id on the bus |
@@ -110,6 +115,7 @@ found: | |||
110 | return clk; | 115 | return clk; |
111 | } | 116 | } |
112 | EXPORT_SYMBOL(clk_get); | 117 | EXPORT_SYMBOL(clk_get); |
118 | #endif | ||
113 | 119 | ||
114 | static void __clk_disable(struct clk *clk) | 120 | static void __clk_disable(struct clk *clk) |
115 | { | 121 | { |
@@ -187,6 +193,7 @@ unsigned long clk_get_rate(struct clk *clk) | |||
187 | } | 193 | } |
188 | EXPORT_SYMBOL(clk_get_rate); | 194 | EXPORT_SYMBOL(clk_get_rate); |
189 | 195 | ||
196 | #ifndef CONFIG_COMMON_CLKDEV | ||
190 | /* Decrement the clock's module reference count */ | 197 | /* Decrement the clock's module reference count */ |
191 | void clk_put(struct clk *clk) | 198 | void clk_put(struct clk *clk) |
192 | { | 199 | { |
@@ -194,6 +201,7 @@ void clk_put(struct clk *clk) | |||
194 | module_put(clk->owner); | 201 | module_put(clk->owner); |
195 | } | 202 | } |
196 | EXPORT_SYMBOL(clk_put); | 203 | EXPORT_SYMBOL(clk_put); |
204 | #endif | ||
197 | 205 | ||
198 | /* Round the requested clock rate to the nearest supported | 206 | /* Round the requested clock rate to the nearest supported |
199 | * rate that is less than or equal to the requested rate. | 207 | * rate that is less than or equal to the requested rate. |
@@ -257,6 +265,7 @@ struct clk *clk_get_parent(struct clk *clk) | |||
257 | } | 265 | } |
258 | EXPORT_SYMBOL(clk_get_parent); | 266 | EXPORT_SYMBOL(clk_get_parent); |
259 | 267 | ||
268 | #ifndef CONFIG_COMMON_CLKDEV | ||
260 | /* | 269 | /* |
261 | * Add a new clock to the clock tree. | 270 | * Add a new clock to the clock tree. |
262 | */ | 271 | */ |
@@ -327,6 +336,7 @@ static int __init mxc_setup_proc_entry(void) | |||
327 | } | 336 | } |
328 | 337 | ||
329 | late_initcall(mxc_setup_proc_entry); | 338 | late_initcall(mxc_setup_proc_entry); |
339 | #endif /* CONFIG_PROC_FS */ | ||
330 | #endif | 340 | #endif |
331 | 341 | ||
332 | /* | 342 | /* |
diff --git a/arch/arm/plat-mxc/include/mach/clkdev.h b/arch/arm/plat-mxc/include/mach/clkdev.h new file mode 100644 index 000000000000..04b37a89801c --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/clkdev.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #define __clk_get(clk) ({ 1; }) | ||
5 | #define __clk_put(clk) do { } while (0) | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/plat-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h index b830655514eb..43a82d0c534d 100644 --- a/arch/arm/plat-mxc/include/mach/clock.h +++ b/arch/arm/plat-mxc/include/mach/clock.h | |||
@@ -26,9 +26,13 @@ | |||
26 | struct module; | 26 | struct module; |
27 | 27 | ||
28 | struct clk { | 28 | struct clk { |
29 | #ifndef CONFIG_COMMON_CLKDEV | ||
30 | /* As soon as i.MX1 and i.MX31 switched to clkdev, this | ||
31 | * block can go away */ | ||
29 | struct list_head node; | 32 | struct list_head node; |
30 | struct module *owner; | 33 | struct module *owner; |
31 | const char *name; | 34 | const char *name; |
35 | #endif | ||
32 | int id; | 36 | int id; |
33 | /* Source clock this clk depends on */ | 37 | /* Source clock this clk depends on */ |
34 | struct clk *parent; | 38 | struct clk *parent; |