aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/clock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/clock.h')
-rw-r--r--include/asm-sh/clock.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h
index b550a27a7042..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
9struct clk; 10struct clk;
10 11
@@ -30,6 +31,7 @@ struct clk {
30 31
31 unsigned long rate; 32 unsigned long rate;
32 unsigned long flags; 33 unsigned long flags;
34 unsigned long arch_flags;
33}; 35};
34 36
35#define CLK_ALWAYS_ENABLED (1 << 0) 37#define CLK_ALWAYS_ENABLED (1 << 0)
@@ -41,14 +43,27 @@ void arch_init_clk_ops(struct clk_ops **, int type);
41/* arch/sh/kernel/cpu/clock.c */ 43/* arch/sh/kernel/cpu/clock.c */
42int clk_init(void); 44int clk_init(void);
43 45
44int __clk_enable(struct clk *);
45void __clk_disable(struct clk *);
46
47void clk_recalc_rate(struct clk *); 46void clk_recalc_rate(struct clk *);
48 47
49int clk_register(struct clk *); 48int clk_register(struct clk *);
50void clk_unregister(struct clk *); 49void clk_unregister(struct clk *);
51 50
51static 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
52/* the exported API, in addition to clk_set_rate */ 67/* the exported API, in addition to clk_set_rate */
53/** 68/**
54 * 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