summaryrefslogtreecommitdiffstats
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 @@
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/clk.h>
+#include <linux/err.h>
struct clk;
@@ -30,6 +31,7 @@ struct clk {
unsigned long rate;
unsigned long flags;
+ unsigned long arch_flags;
};
#define CLK_ALWAYS_ENABLED (1 << 0)
@@ -41,14 +43,27 @@ void arch_init_clk_ops(struct clk_ops **, int type);
/* arch/sh/kernel/cpu/clock.c */
int clk_init(void);
-int __clk_enable(struct clk *);
-void __clk_disable(struct clk *);
-
void clk_recalc_rate(struct clk *);
int clk_register(struct clk *);
void clk_unregister(struct clk *);
+static inline int clk_always_enable(const char *id)
+{
+ struct clk *clk;
+ int ret;
+
+ clk = clk_get(NULL, id);
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+ ret = clk_enable(clk);
+ if (ret)
+ clk_put(clk);
+
+ return ret;
+}
+
/* the exported API, in addition to clk_set_rate */
/**
* clk_set_rate_ex - set the clock rate for a clock source, with additional parameter