All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: sophgo: cv1800: set mux parent in bypass_mux_set_parent()
@ 2026-11-20 10:57 Phuong Nguyen
  2026-11-20 18:44 ` Jerome Brunet
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

end of thread, other threads:[~2026-11-20 18:44 UTC | newest]

Thread overview: 2+ messages (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
2026-11-20 18:44 ` Jerome Brunet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.