mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/8] clk: move struct clk_gate into header
Date: Mon, 14 Jan 2019 17:42:05 +0100	[thread overview]
Message-ID: <20190114164211.10871-2-l.stach@pengutronix.de> (raw)
In-Reply-To: <20190114164211.10871-1-l.stach@pengutronix.de>

To make it reusable in a composite clock.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-01-14 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 16:42 [PATCH 1/8] clk: add missing list.h include Lucas Stach
2019-01-14 16:42 ` Lucas Stach [this message]
2019-01-14 16:42 ` [PATCH 3/8] clk: move struct clk_mux into header Lucas Stach
2019-01-14 16:42 ` [PATCH 4/8] clk: add divider_recalc_rate helper Lucas Stach
2019-01-15  0:20   ` Andrey Smirnov
2019-01-15  6:43     ` Sascha Hauer
2019-01-14 16:42 ` [PATCH 5/8] clk: imx: add imx8mq composite clock Lucas Stach
2019-01-14 16:42 ` [PATCH 6/8] clk: imx: sync imx8mq clock driver with upstream kernel Lucas Stach
2019-01-14 16:42 ` [PATCH 7/8] pinctrl: imx-v3: imx8mq does use the old binding Lucas Stach
2019-01-14 16:42 ` [PATCH 8/8] ARM: imx8mq: use upstream devicetree Lucas Stach
2019-01-15  0:41   ` Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190114164211.10871-2-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox