From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/8] clk: move struct clk_mux into header
Date: Mon, 14 Jan 2019 17:42:06 +0100 [thread overview]
Message-ID: <20190114164211.10871-3-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-mux.c | 11 +----------
include/linux/clk.h | 11 +++++++++++
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 22e131faae61..d5fe640dce1b 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -20,15 +20,6 @@
#include <linux/clk.h>
#include <linux/err.h>
-struct clk_mux {
- struct clk clk;
- void __iomem *reg;
- int shift;
- int width;
-};
-
-#define to_clk_mux(_clk) container_of(_clk, struct clk_mux, clk)
-
static int clk_mux_get_parent(struct clk *clk)
{
struct clk_mux *m = container_of(clk, struct clk_mux, clk);
@@ -53,7 +44,7 @@ static int clk_mux_set_parent(struct clk *clk, u8 idx)
return 0;
}
-static struct clk_ops clk_mux_ops = {
+struct clk_ops clk_mux_ops = {
.set_rate = clk_parent_set_rate,
.round_rate = clk_parent_round_rate,
.get_parent = clk_mux_get_parent,
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 419a2c4c86b8..13b1e529f57b 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -282,6 +282,17 @@ struct clk *clk_fractional_divider(
u8 clk_divider_flags);
void clk_fractional_divider_free(struct clk *clk_fd);
+struct clk_mux {
+ struct clk clk;
+ void __iomem *reg;
+ int shift;
+ int width;
+};
+
+#define to_clk_mux(_clk) container_of(_clk, struct clk_mux, clk)
+
+extern struct clk_ops clk_mux_ops;
+
struct clk *clk_mux_alloc(const char *name, void __iomem *reg,
u8 shift, u8 width, const char **parents, u8 num_parents,
unsigned flags);
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent 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 ` [PATCH 2/8] clk: move struct clk_gate into header Lucas Stach
2019-01-14 16:42 ` Lucas Stach [this message]
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-3-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