[PATCH 2/8] clk: move struct clk_gate into header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To make it reusable in a composite clock.

Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/clk/clk-gate.c | 12 +-----------
 include/linux/clk.h    | 12 ++++++++++++
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 695e19ab549c..89240ff79402 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -20,16 +20,6 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
-struct clk_gate {
-	struct clk clk;
-	void __iomem *reg;
-	int shift;
-	const char *parent;
-	unsigned flags;
-};
-
-#define to_clk_gate(_clk) container_of(_clk, struct clk_gate, clk)
-
 static void clk_gate_endisable(struct clk *clk, int enable)
 {
 	struct clk_gate *gate = container_of(clk, struct clk_gate, clk);
@@ -79,7 +69,7 @@ static int clk_gate_is_enabled(struct clk *clk)
 		return g->flags & CLK_GATE_INVERTED ? 1 : 0;
 }
 
-static struct clk_ops clk_gate_ops = {
+struct clk_ops clk_gate_ops = {
 	.set_rate = clk_parent_set_rate,
 	.round_rate = clk_parent_round_rate,
 	.enable = clk_gate_enable,
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 494221a43070..419a2c4c86b8 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -290,6 +290,18 @@ struct clk *clk_mux(const char *name, void __iomem *reg,
 		u8 shift, u8 width, const char **parents, u8 num_parents,
 		unsigned flags);
 
+struct clk_gate {
+	struct clk clk;
+	void __iomem *reg;
+	int shift;
+	const char *parent;
+	unsigned flags;
+};
+
+#define to_clk_gate(_clk) container_of(_clk, struct clk_gate, clk)
+
+extern struct clk_ops clk_gate_ops;
+
 struct clk *clk_gate_alloc(const char *name, const char *parent,
 		void __iomem *reg, u8 shift, unsigned flags,
 		u8 clk_gate_flags);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux