[PATCH 1/4] clk: mediatek: clk-mux: Add helper for muxes without UPD
Sjoerd Simons
sjoerd at collabora.com
Tue Dec 23 23:30:10 PST 2025
Not all muxes have an update register. This is already handled by the
driver when the upd_shift field is set negative. Add a small helper
macro to declare these muxes, without having to pass a bunch of -1's.
Signed-off-by: Sjoerd Simons <sjoerd at collabora.com>
---
drivers/clk/mediatek/clk-mux.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/clk/mediatek/clk-mux.h b/drivers/clk/mediatek/clk-mux.h
index 151e56dcf884..1a385cdd00d0 100644
--- a/drivers/clk/mediatek/clk-mux.h
+++ b/drivers/clk/mediatek/clk-mux.h
@@ -126,6 +126,13 @@ extern const struct clk_ops mtk_mux_gate_hwv_fenc_clr_set_upd_ops;
0, _upd_ofs, _upd, CLK_SET_RATE_PARENT, \
mtk_mux_clr_set_upd_ops)
+#define MUX_CLR_SET(_id, _name, _parents, _mux_ofs, \
+ _mux_set_ofs, _mux_clr_ofs, _shift, _width) \
+ GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \
+ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \
+ 0, 0, -1, CLK_SET_RATE_PARENT, \
+ mtk_mux_clr_set_upd_ops)
+
#define MUX_GATE_HWV_FENC_CLR_SET_UPD_FLAGS(_id, _name, _parents, \
_mux_ofs, _mux_set_ofs, _mux_clr_ofs, \
_hwv_sta_ofs, _hwv_set_ofs, _hwv_clr_ofs, \
--
2.51.0
More information about the Linux-mediatek
mailing list