[PATCH 1/3] clk: stm32mp13: define the number of clocks in the driver

From: Gabriel Fernandez

Date: Tue Oct 20 2026 - 04:32:57 EST


The size of the clock provider is given by STM32MP1_LAST_CLK, defined in
the binding header. This is not part of the binding ABI: it has to be
updated each time an ID is added, and the number of clocks handled by a
given driver does not belong to a binding.

Define the number of clocks in the driver instead, as done for the
STM32MP21 driver, so that the binding header can drop it.

No functional change, the value is unchanged (162).

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@xxxxxxxxxxx>
---
drivers/clk/stm32/clk-stm32mp13.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/stm32/clk-stm32mp13.c b/drivers/clk/stm32/clk-stm32mp13.c
index 9bc94c3c5df8..76cede5e47bc 100644
--- a/drivers/clk/stm32/clk-stm32mp13.c
+++ b/drivers/clk/stm32/clk-stm32mp13.c
@@ -16,6 +16,9 @@
#define STM32MP1_RESET_ID_MASK GENMASK(15, 0)
#define RCC_CLR_OFFSET 0x4

+/* Number of clock identifiers of the binding: highest ID + 1 */
+#define STM32MP13_LAST_CLK (SAI2 + 1)
+
/* STM32 Gates definition */
enum enum_gate_cfg {
GATE_MCO1,
@@ -1523,7 +1526,7 @@ static const struct stm32_rcc_match_data stm32mp13_data = {
.num_clocks = ARRAY_SIZE(stm32mp13_clock_cfg),
.clock_data = &stm32mp13_clock_data,
.check_security = &stm32mp13_clock_is_provided_by_secure,
- .maxbinding = STM32MP1_LAST_CLK,
+ .maxbinding = STM32MP13_LAST_CLK,
.reset_data = &stm32mp13_reset_data,
};


--
2.43.0