[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251224-mtk-not-a-gate-v1-3-d4667e3b7856@collabora.com>
Date: Wed, 24 Dec 2025 08:30:12 +0100
From: Sjoerd Simons <sjoerd@...labora.com>
To: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Jianhui Zhao <zhaojh329@...il.com>, Daniel Golle <daniel@...rotopia.org>,
Sam Shih <sam.shih@...iatek.com>, Ryder Lee <ryder.lee@...nel.org>
Cc: kernel@...labora.com, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, Sjoerd Simons <sjoerd@...labora.com>
Subject: [PATCH 3/4] clk: mediatek: Declare MT7986 infra muxes as no-gate
muxes
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@...labora.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
Powered by blists - more mailing lists