[PATCH v4 3/5] soc: st: stm32mp2-syscfg: register the clock device

From: Gabriel Fernandez

Date: Tue Nov 24 2026 - 08:41:55 EST


From: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx>

The STM32MP23x and STM32MP25x SYSCFG provides the LTDC pixel clock mux,
whose driver is an auxiliary driver since the SYSCFG node is bound to
this driver.

Create the auxiliary device for the clock driver.

Signed-off-by: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx>
[gabriel.fernandez@xxxxxxxxxxx: create the device on STM32MP23x too]
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@xxxxxxxxxxx>
---
drivers/soc/st/Kconfig | 1 +
drivers/soc/st/stm32mp2-syscfg.c | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/st/Kconfig b/drivers/soc/st/Kconfig
index 2a9d6a77be45..62bbe8c63238 100644
--- a/drivers/soc/st/Kconfig
+++ b/drivers/soc/st/Kconfig
@@ -5,6 +5,7 @@ config SOC_STM32MP2
tristate "STM32MP2 SoC family support"
depends on ARCH_STM32 || COMPILE_TEST
default ARCH_STM32 && ARM64
+ select AUXILIARY_BUS
select SOC_BUS
help
If you say yes here, you get support for the ST STM32MP2 family
diff --git a/drivers/soc/st/stm32mp2-syscfg.c b/drivers/soc/st/stm32mp2-syscfg.c
index 770321a4a6f7..1160b65d3dde 100644
--- a/drivers/soc/st/stm32mp2-syscfg.c
+++ b/drivers/soc/st/stm32mp2-syscfg.c
@@ -3,13 +3,25 @@
* Copyright 2026 Marek Vasut
*/

+#include <linux/auxiliary_bus.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>

static int stm32mp2_syscfg_probe(struct platform_device *pdev)
{
- return devm_of_platform_populate(&pdev->dev);
+ struct device *dev = &pdev->dev;
+ int ret;
+
+ ret = devm_of_platform_populate(dev);
+ if (ret)
+ return ret;
+
+ if (!devm_auxiliary_device_create(dev, "clk", NULL))
+ return dev_err_probe(dev, -ENODEV,
+ "failed to register the clock device\n");
+
+ return 0;
}

static const struct of_device_id stm32mp2_syscfg_ids[] = {

--
2.43.0