clk: sophgo: cv1800: set mux parent in bypass_mux_set_parent()
Subsystems (2)
PATCH 1/1 clk: sophgo: cv1800: set mux parent in bypass_mux_set_parent()
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.
--- drivers/clk/sophgo/clk-cv18xx-ip.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/clk/sophgo/clk-cv18xx-ip.c +5 -0
@@ -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); }
Signature · 1 line
2.43.0
Quoted 9 lines · Phuong Nguyen
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.[...]
Signature · 1 line
Jerome
Applied to local tree (clk-sophgo), thanks!
[1/1] clk: sophgo: cv1800: set mux parent in bypass_mux_set_parent()
commit: 2c6c86e016e6b4394c4de23891423cfe65ba8d43
Best regards,
--
Jerome