diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-07-17 06:09:51 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 05:10:36 -0400 |
commit | de9254263b8c8b1809520a1009dd516e41976519 (patch) | |
tree | 0f75d7a40992b036f79ddbd8851ba877360ebc2f /include/asm-sh/clock.h | |
parent | 152fe36ebee82b63a9c6e510c52aaa82f4b1940d (diff) |
sh: Introduce clk_always_enable() function
Add SuperH specific funcion clk_always_enable(), useful to enable MSTPCR
bits in processor or board specific code.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/clock.h')
-rw-r--r-- | include/asm-sh/clock.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h index 252f15540ddb..720dfab7b15e 100644 --- a/include/asm-sh/clock.h +++ b/include/asm-sh/clock.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
7 | #include <linux/clk.h> | 7 | #include <linux/clk.h> |
8 | #include <linux/err.h> | ||
8 | 9 | ||
9 | struct clk; | 10 | struct clk; |
10 | 11 | ||
@@ -47,6 +48,22 @@ void clk_recalc_rate(struct clk *); | |||
47 | int clk_register(struct clk *); | 48 | int clk_register(struct clk *); |
48 | void clk_unregister(struct clk *); | 49 | void clk_unregister(struct clk *); |
49 | 50 | ||
51 | static inline int clk_always_enable(const char *id) | ||
52 | { | ||
53 | struct clk *clk; | ||
54 | int ret; | ||
55 | |||
56 | clk = clk_get(NULL, id); | ||
57 | if (IS_ERR(clk)) | ||
58 | return PTR_ERR(clk); | ||
59 | |||
60 | ret = clk_enable(clk); | ||
61 | if (ret) | ||
62 | clk_put(clk); | ||
63 | |||
64 | return ret; | ||
65 | } | ||
66 | |||
50 | /* the exported API, in addition to clk_set_rate */ | 67 | /* the exported API, in addition to clk_set_rate */ |
51 | /** | 68 | /** |
52 | * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter | 69 | * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter |