[PATCH] clk: clk-gpio: Add Kconfig symbol

Sascha Hauer s.hauer at pengutronix.de
Thu Mar 23 05:04:57 PDT 2023


clk-gpio is always compiled in with CONFIG_COMMON_CLK=y. It really
depends on CONFIG_COMMON_CLK_OF_PROVIDER though, without this
of_clk_init() just compiles to a static inline stub and the clk-gpio
driver becomes a no-op.
With the conversion to a driver in the next patch this no longer works
and compilation of the driver results in a undefined reference to
of_clk_get_parent_name. To avoid that create a Kconfig symbol for the
driver which defaults to yes when CONFIG_COMMON_CLK_OF_PROVIDER is set.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/clk/Kconfig  | 5 +++++
 drivers/clk/Makefile | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 0faea6488e..076e77c859 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -38,6 +38,11 @@ config COMMON_CLK_SCMI
 	  This driver uses SCMI Message Protocol to interact with the
 	  firmware providing all the clock controls.
 
+config COMMON_CLK_GPIO
+	bool
+	default y
+	depends on COMMON_CLK_OF_PROVIDER
+
 source "drivers/clk/sifive/Kconfig"
 
 endif
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index baf452de98..c865e4c274 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -2,7 +2,7 @@
 obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-fixed.o clk-divider.o clk-fixed-factor.o \
 				clk-mux.o clk-gate.o clk-composite.o \
 				clk-fractional-divider.o clk-conf.o \
-				clk-gate-shared.o clk-gpio.o \
+				clk-gate-shared.o \
 				clk-bulk.o
 obj-$(CONFIG_CLKDEV_LOOKUP)	+= clkdev.o
 
@@ -28,3 +28,4 @@ obj-$(CONFIG_COMMON_CLK_STM32F)		+= clk-stm32f4.o
 obj-$(CONFIG_MACH_RPI_COMMON)	+= clk-rpi.o
 obj-y				+= bcm/
 obj-$(CONFIG_COMMON_CLK_SCMI)	+= clk-scmi.o
+obj-$(CONFIG_COMMON_CLK_GPIO)   += clk-gpio.o
-- 
2.30.2




More information about the barebox mailing list