[PATCH 3/4] clk: mediatek: Declare MT7986 infra muxes as no-gate muxes
Sjoerd Simons
sjoerd at collabora.com
Tue Dec 23 23:30:12 PST 2025
A MUX_GATE without a gate, is really just a MUX. Adjust the mux
declarations to match that. This fixes out-of-bounds shifts due to no
longer trying to enable/disable the gate with a shift of (u8)-1.
Fixes: ec97d23c8e22 ("clk: mediatek: add mt7986 clock support")
Signed-off-by: Sjoerd Simons <sjoerd at collabora.com>
---
drivers/clk/mediatek/clk-mt7986-infracfg.c | 45 ++++++++++++------------------
1 file changed, 18 insertions(+), 27 deletions(-)
diff --git a/drivers/clk/mediatek/clk-mt7986-infracfg.c b/drivers/clk/mediatek/clk-mt7986-infracfg.c
index 732c65e616de..458b26ff2efc 100644
--- a/drivers/clk/mediatek/clk-mt7986-infracfg.c
+++ b/drivers/clk/mediatek/clk-mt7986-infracfg.c
@@ -37,34 +37,25 @@ static const char *const infra_pcie_parents[] __initconst = {
static const struct mtk_mux infra_muxes[] = {
/* MODULE_CLK_SEL_0 */
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_UART0_SEL, "infra_uart0_sel",
- infra_uart_parent, 0x0018, 0x0010, 0x0014, 0, 1,
- -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_UART1_SEL, "infra_uart1_sel",
- infra_uart_parent, 0x0018, 0x0010, 0x0014, 1, 1,
- -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_UART2_SEL, "infra_uart2_sel",
- infra_uart_parent, 0x0018, 0x0010, 0x0014, 2, 1,
- -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_SPI0_SEL, "infra_spi0_sel",
- infra_spi_parents, 0x0018, 0x0010, 0x0014, 4, 1,
- -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_SPI1_SEL, "infra_spi1_sel",
- infra_spi_parents, 0x0018, 0x0010, 0x0014, 5, 1,
- -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_PWM1_SEL, "infra_pwm1_sel",
- infra_pwm_bsel_parents, 0x0018, 0x0010, 0x0014, 9,
- 2, -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_PWM2_SEL, "infra_pwm2_sel",
- infra_pwm_bsel_parents, 0x0018, 0x0010, 0x0014, 11,
- 2, -1, -1, -1),
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_PWM_BSEL, "infra_pwm_bsel",
- infra_pwm_bsel_parents, 0x0018, 0x0010, 0x0014, 13,
- 2, -1, -1, -1),
+ MUX_CLR_SET(CLK_INFRA_UART0_SEL, "infra_uart0_sel",
+ infra_uart_parent, 0x0018, 0x0010, 0x0014, 0, 1),
+ MUX_CLR_SET(CLK_INFRA_UART1_SEL, "infra_uart1_sel",
+ infra_uart_parent, 0x0018, 0x0010, 0x0014, 1, 1),
+ MUX_CLR_SET(CLK_INFRA_UART2_SEL, "infra_uart2_sel",
+ infra_uart_parent, 0x0018, 0x0010, 0x0014, 2, 1),
+ MUX_CLR_SET(CLK_INFRA_SPI0_SEL, "infra_spi0_sel",
+ infra_spi_parents, 0x0018, 0x0010, 0x0014, 4, 1),
+ MUX_CLR_SET(CLK_INFRA_SPI1_SEL, "infra_spi1_sel",
+ infra_spi_parents, 0x0018, 0x0010, 0x0014, 5, 1),
+ MUX_CLR_SET(CLK_INFRA_PWM1_SEL, "infra_pwm1_sel",
+ infra_pwm_bsel_parents, 0x0018, 0x0010, 0x0014, 9, 2),
+ MUX_CLR_SET(CLK_INFRA_PWM2_SEL, "infra_pwm2_sel",
+ infra_pwm_bsel_parents, 0x0018, 0x0010, 0x0014, 11, 2),
+ MUX_CLR_SET(CLK_INFRA_PWM_BSEL, "infra_pwm_bsel",
+ infra_pwm_bsel_parents, 0x0018, 0x0010, 0x0014, 13, 2),
/* MODULE_CLK_SEL_1 */
- MUX_GATE_CLR_SET_UPD(CLK_INFRA_PCIE_SEL, "infra_pcie_sel",
- infra_pcie_parents, 0x0028, 0x0020, 0x0024, 0, 2,
- -1, -1, -1),
+ MUX_CLR_SET(CLK_INFRA_PCIE_SEL, "infra_pcie_sel",
+ infra_pcie_parents, 0x0028, 0x0020, 0x0024, 0, 2),
};
static const struct mtk_gate_regs infra0_cg_regs = {
--
2.51.0
More information about the Linux-mediatek
mailing list