mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: "Leif Middelschulte" <leif.middelschulte@klsmartin.com>,
	uol@pengutronix.de, ore@pengutronix.de,
	"Søren Andersen" <san@skov.dk>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>
Subject: [PATCH 1/6] clk: imx: set CLK_SET_RATE_NO_REPARENT for all muxes
Date: Thu, 22 Dec 2022 15:11:56 +0100	[thread overview]
Message-ID: <20221222141201.3087192-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20221222141201.3087192-1-a.fatoum@pengutronix.de>

The Linux i.MX clk drivers instantiate all muxes with
CLK_SET_RATE_NO_REPARENT. Do likewise in barebox.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/clk/imx/clk.h | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index bc44d0c739e0..041592a06431 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -40,11 +40,19 @@ static inline struct clk *imx_clk_divider_table(const char *name,
 				 width, table, 0);
 }
 
+static inline struct clk *__imx_clk_mux(const char *name, void __iomem *reg,
+					u8 shift, u8 width, const char * const *parents,
+					u8 num_parents, unsigned flags, unsigned long clk_mux_flags)
+{
+	return clk_mux(name, CLK_SET_RATE_NO_REPARENT | flags, reg,
+		       shift, width, parents, num_parents, clk_mux_flags);
+}
+
 static inline struct clk *imx_clk_mux_ldb(const char *name, void __iomem *reg,
 		u8 shift, u8 width, const char * const *parents, int num_parents)
 {
-	return clk_mux(name, CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, reg,
-		       shift, width, parents, num_parents, CLK_MUX_READ_ONLY);
+	return __imx_clk_mux(name, reg, shift, width, parents, num_parents,
+			     CLK_SET_RATE_PARENT, CLK_MUX_READ_ONLY);
 }
 
 
@@ -59,36 +67,36 @@ static inline struct clk *imx_clk_mux_flags(const char *name, void __iomem *reg,
 					    const char * const *parents, u8 num_parents,
 					    unsigned long clk_flags)
 {
-	return clk_mux(name, clk_flags, reg, shift, width, parents, num_parents,
-		       0);
+	return __imx_clk_mux(name, reg, shift, width, parents, num_parents,
+			     clk_flags, 0);
 }
 
 static inline struct clk *imx_clk_mux2_flags(const char *name,
 		void __iomem *reg, u8 shift, u8 width, const char * const *parents,
 		int num_parents, unsigned long clk_flags)
 {
-	return clk_mux(name, clk_flags | CLK_OPS_PARENT_ENABLE, reg, shift,
-		       width, parents, num_parents, 0);
+	return __imx_clk_mux(name,reg, shift, width, parents, num_parents,
+			     clk_flags | CLK_OPS_PARENT_ENABLE, 0);
 }
 
 static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
 		u8 shift, u8 width, const char * const *parents, u8 num_parents)
 {
-	return clk_mux(name, 0, reg, shift, width, parents, num_parents, 0);
+	return __imx_clk_mux(name, reg, shift, width, parents, num_parents, 0, 0);
 }
 
 static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg,
 		u8 shift, u8 width, const char * const *parents, u8 num_parents)
 {
-	return clk_mux(name, CLK_OPS_PARENT_ENABLE, reg, shift, width, parents,
-		       num_parents, 0);
+	return __imx_clk_mux(name, reg, shift, width, parents,
+			     num_parents, CLK_OPS_PARENT_ENABLE, 0);
 }
 
 static inline struct clk *imx_clk_mux_p(const char *name, void __iomem *reg,
 		u8 shift, u8 width, const char * const *parents, u8 num_parents)
 {
-	return clk_mux(name, CLK_SET_RATE_PARENT, reg, shift, width, parents,
-		       num_parents, 0);
+	return __imx_clk_mux(name, reg, shift, width, parents, num_parents,
+			     CLK_SET_RATE_PARENT,  0);
 }
 
 static inline struct clk *imx_clk_gate(const char *name, const char *parent,
-- 
2.30.2




  reply	other threads:[~2022-12-22 14:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 14:11 [PATCH 0/6] ARM: i.MX6: Fix LVDS splash on skov and some others Ahmad Fatoum
2022-12-22 14:11 ` Ahmad Fatoum [this message]
2022-12-23  9:11   ` [PATCH 1/6] clk: imx: set CLK_SET_RATE_NO_REPARENT for all muxes Marco Felsch
2022-12-22 14:11 ` [PATCH 2/6] clk: mux: forward round/set rate to parent if CLK_SET_RATE_PARENT Ahmad Fatoum
2022-12-22 14:11 ` [PATCH 3/6] ARM: i.MX6: skov: refactor LVDS/parallel device tree fixups Ahmad Fatoum
2022-12-23  9:14   ` Marco Felsch
2022-12-22 14:11 ` [PATCH 4/6] ARM: i.MX6: skov: fix LVDS deep probe Ahmad Fatoum
2022-12-23  9:08   ` Marco Felsch
2022-12-22 14:12 ` [PATCH 5/6] video: edid: print debug message on EDID read out error Ahmad Fatoum
2022-12-23  9:06   ` Marco Felsch
2022-12-22 14:12 ` [PATCH 6/6] ARM: configs: imx_v7_defconfig: enable some useful options Ahmad Fatoum
2022-12-23  9:10   ` Marco Felsch
2023-01-04 12:01     ` Sascha Hauer
2023-01-04 12:04       ` Ahmad Fatoum
2023-01-04 12:07         ` Sascha Hauer

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=20221222141201.3087192-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=leif.middelschulte@klsmartin.com \
    --cc=ore@pengutronix.de \
    --cc=san@skov.dk \
    --cc=uol@pengutronix.de \
    /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