diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-20 11:04:27 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-20 11:04:27 +0100 |
commit | b8e1b0251dc07b49eb643a4e3bfc391661dcae28 (patch) | |
tree | 40dd93925248d2ed37b003ac26d75257400af7d7 /drivers/clk | |
parent | 37c23df635b737638bb775f5ebe6a2d4722711a8 (diff) | |
parent | 7c870920426cca199eb9c9897848f9a21d7b3b62 (diff) | |
download | barebox-b8e1b0251dc07b49eb643a4e3bfc391661dcae28.tar.gz barebox-b8e1b0251dc07b49eb643a4e3bfc391661dcae28.tar.xz |
Merge branch 'for-next/imx'
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-mux.c | 4 | ||||
-rw-r--r-- | drivers/clk/imx/clk.h | 30 |
2 files changed, 21 insertions, 13 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index ad82d97ea8..1d94e09167 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -118,7 +118,7 @@ long clk_mux_round_rate(struct clk_hw *hw, unsigned long rate, struct clk *bestparent; if (clk->flags & CLK_SET_RATE_NO_REPARENT) - return *prate; + return clk_parent_round_rate(hw, rate, prate); bestparent = clk_mux_best_parent(clk, rate, &rrate); @@ -135,7 +135,7 @@ static int clk_mux_set_rate(struct clk_hw *hw, unsigned long rate, int ret; if (clk->flags & CLK_SET_RATE_NO_REPARENT) - return 0; + return clk_parent_set_rate(hw, rate, parent_rate); parent = clk_mux_best_parent(clk, rate, &rrate); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index bc44d0c739..041592a064 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, |