mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] clk: clk-gpio: Add Kconfig symbol
@ 2023-03-23 12:04 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2023-03-23 12:04 UTC (permalink / raw)
  To: Barebox List

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@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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-23 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 12:04 [PATCH] clk: clk-gpio: Add Kconfig symbol Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox