* [PATCH] clk: sophgo: cv1800: set mux parent in bypass_mux_set_parent()
@ 2026-11-20 10:57 Phuong Nguyen
0 siblings, 0 replies; only message in thread
From: Phuong Nguyen @ 2026-11-20 10:57 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Chen Wang,
Inochi Amaoto, linux-clk, sophgo
Cc: Inochi Amaoto
In bypass_mux_set_parent(), when index > 0, clearing the bypass bit
switches the clock to the mux path without updating the mux selector.
As a result, the hardware mux remains at parent 0 instead of selecting
the requested parent.
Call mux_set_parent(hw, index - 1) before clearing the bypass bit to
configure the mux selector before switching to the mux path.
Fixes: 80fd61ec4612 ("clk: sophgo: Add clock support for CV1800 SoC")
Signed-off-by: Phuong Nguyen <ndp2809@gmail.com>
---
drivers/clk/sophgo/clk-cv18xx-ip.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/sophgo/clk-cv18xx-ip.c b/drivers/clk/sophgo/clk-cv18xx-ip.c
index e936e3154003..34062ad7f2aa 100644
--- a/drivers/clk/sophgo/clk-cv18xx-ip.c
+++ b/drivers/clk/sophgo/clk-cv18xx-ip.c
@@ -588,10 +588,15 @@ static u8 bypass_mux_get_parent(struct clk_hw *hw)
static int bypass_mux_set_parent(struct clk_hw *hw, u8 index)
{
struct cv1800_clk_bypass_mux *mux = hw_to_cv1800_clk_bypass_mux(hw);
+ int ret;
if (index == 0)
return cv1800_clk_setbit(&mux->mux.common, &mux->bypass);
+ ret = mux_set_parent(hw, index - 1);
+ if (ret)
+ return ret;
+
return cv1800_clk_clearbit(&mux->mux.common, &mux->bypass);
}
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-20 10:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 10:57 [PATCH] clk: sophgo: cv1800: set mux parent in bypass_mux_set_parent() Phuong Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox