[PATCH linux-next 10/33] clk: mediatek: Fix MT2701 onecell IDs after common probe migration

From: Akari Tsuyukusa

Date: Sat Nov 28 2026 - 20:48:23 EST


Migrating the MT2701 topckgen, infracfg, pericfg and apmixedsys clock
drivers to the common probe/remove helpers stopped using CLK_*_NR for
onecell data allocation, causing out-of-bounds registrations due to
missing dummy slots for ID 0.

Add the missing dummy slots so all clock IDs stay within bounds.

Fixes: ecc3a07f599f ("clk: mediatek: mt2701: Switch to common probe/remove helpers")
Signed-off-by: Akari Tsuyukusa <akkun11.open@xxxxxxxxx>
---
drivers/clk/mediatek/clk-mt2701.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c
index 73df452e1cfb..0db3af1a478d 100644
--- a/drivers/clk/mediatek/clk-mt2701.c
+++ b/drivers/clk/mediatek/clk-mt2701.c
@@ -638,6 +638,7 @@ static const struct mtk_gate_regs top_aud_cg_regs = {
GATE_MTK(_id, _name, _parent, &top_aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)

static const struct mtk_gate top_clks[] = {
+ GATE_DUMMY(CLK_DUMMY, "topck_dummy"),
GATE_TOP_AUD(CLK_TOP_AUD_48K_TIMING, "a1sys_hp_ck", "aud_mux1_div",
21),
GATE_TOP_AUD(CLK_TOP_AUD_44K_TIMING, "a2sys_hp_ck", "aud_mux2_div",
@@ -680,6 +681,7 @@ static const struct mtk_gate_regs infra_cg_regs = {
GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)

static const struct mtk_gate infra_clks[] = {
+ GATE_DUMMY(CLK_DUMMY, "infra_dummy"),
GATE_ICG(CLK_INFRA_DBG, "dbgclk", "axi_sel", 0),
GATE_ICG(CLK_INFRA_SMI, "smi_ck", "mm_sel", 1),
GATE_ICG(CLK_INFRA_QAXI_CM4, "cm4_ck", "axi_sel", 2),
@@ -742,6 +744,7 @@ static const struct mtk_gate_regs peri1_cg_regs = {
GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)

static const struct mtk_gate peri_clks[] = {
+ GATE_DUMMY(CLK_DUMMY, "peri_dummy"),
GATE_PERI0(CLK_PERI_USB0_MCU, "usb0_mcu_ck", "axi_sel", 31),
GATE_PERI0(CLK_PERI_ETH, "eth_ck", "clk26m", 30),
GATE_PERI0(CLK_PERI_SPI0, "spi0_ck", "spi0_sel", 29),
@@ -874,7 +877,13 @@ static const struct mtk_fixed_factor apmixed_fixed_divs[] = {
FACTOR(CLK_APMIXED_HDMI_REF, "hdmi_ref", "tvdpll", 1, 1),
};

+static const struct mtk_gate apmixed_clks[] = {
+ GATE_DUMMY(CLK_DUMMY, "apmixed_dummy"),
+};
+
static const struct mtk_clk_desc apmixedsys_desc = {
+ .clks = apmixed_clks,
+ .num_clks = ARRAY_SIZE(apmixed_clks),
.plls = apmixed_plls,
.num_plls = ARRAY_SIZE(apmixed_plls),
.factor_clks = apmixed_fixed_divs,
--
2.56.0