All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: Introduce clk_always_enable() function
@ 2008-07-17 10:09 Magnus Damm
  0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2008-07-17 10:09 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@igel.co.jp>

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>
---

 include/asm-sh/clock.h |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--- 0008/include/asm-sh/clock.h
+++ work/include/asm-sh/clock.h	2008-07-17 12:42:28.000000000 +0900
@@ -5,6 +5,7 @@
 #include <linux/list.h>
 #include <linux/seq_file.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 struct clk;
 
@@ -47,6 +48,22 @@ 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-17 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 10:09 [PATCH] sh: Introduce clk_always_enable() function Magnus Damm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.