diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-12-22 15:11:57 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-04 12:50:30 +0100 |
commit | 7378e5e3e1ab8a5f52b5007c1f0f2e66cc52ed1a (patch) | |
tree | 6092f1e4d03c57e6867ffed3c4982b67cc03d79c /drivers/clk | |
parent | 29abbb718d2ed9820df690726eda233251f6dc81 (diff) | |
download | barebox-7378e5e3e1ab8a5f52b5007c1f0f2e66cc52ed1a.tar.gz barebox-7378e5e3e1ab8a5f52b5007c1f0f2e66cc52ed1a.tar.xz |
clk: mux: forward round/set rate to parent if CLK_SET_RATE_PARENT
Prior to v2021.07.0, clk mux round/set rate ops were forwarded to
clk_parent_round_rate/clk_parent_set_rate, which would change nothing
unless CLK_SET_RATE_PARENT is set.
Since that release, barebox will instead try to reparent the mux
to arrive at a closer rate, unless CLK_SET_RATE_NO_REPARENT is
specified.
The correct behavior would have been for CLK_SET_RATE_NO_REPARENT
to fall back to the old behavior when NO_REPARENT is specified,
but instead CLK_SET_RATE_PARENT ended up ignored.
Fix this by calling clk_parent_round_rate/clk_parent_set_rate once again
in that case. When CLK_SET_RATE_PARENT is not set, they are equivalent
to the current open-coded behavior.
Fixes: d07c34e116cd ("clk: clk-mux: implement setting rate by reparenting")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221222141201.3087192-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-mux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 8463f1ee82..a92d94cdc9 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); |