clk: Allow the common clk framework to be selectable
authorStephen Boyd <sboyd@kernel.org>
Thu, 9 Apr 2020 06:44:13 +0000 (23:44 -0700)
committerStephen Boyd <sboyd@kernel.org>
Tue, 5 May 2020 19:34:11 +0000 (12:34 -0700)
Enable build testing and configuration control of the common clk
framework so that more code coverage and testing can be done on the
common clk framework across various architectures. This also nicely
removes the requirement that architectures must select the framework
when they don't use it in architecture code.

There's one snag with doing this, and that's making sure that randconfig
builds don't select this option when some architecture or platform
implements 'struct clk' outside of the common clk framework. Introduce a
new config option 'HAVE_LEGACY_CLK' to indicate those platforms that
haven't migrated to the common clk framework and therefore shouldn't be
allowed to select this new config option. Also add a note that we hope
one day to remove this config entirely.

Based on a patch by Mark Brown <broonie@kernel.org>.

Cc: Mark Brown <broonie@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: <linux-mips@vger.kernel.org>
Cc: <linux-c6x-dev@linux-c6x.org>
Cc: <linux-m68k@lists.linux-m68k.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: <linux-sh@vger.kernel.org>
Link: https://lore.kernel.org/r/1470915049-15249-1-git-send-email-broonie@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20200409064416.83340-8-sboyd@kernel.org
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/Kconfig
arch/c6x/Kconfig
arch/m68k/Kconfig.cpu
arch/mips/Kconfig
arch/mips/loongson2ef/Kconfig
arch/mips/ralink/Kconfig
arch/sh/boards/Kconfig
arch/unicore32/Kconfig
drivers/clk/Kconfig

index 6b56a4bc3b9f5211145be1a0ce75e61c9872780a..6e15460cf1f2722bae22ada298ac0fc528ab0a3c 100644 (file)
@@ -363,6 +363,7 @@ config ARCH_EP93XX
        select CPU_ARM920T
        select GENERIC_CLOCKEVENTS
        select GPIOLIB
+       select HAVE_LEGACY_CLK
        help
          This enables support for the Cirrus EP93xx series of CPUs.
 
@@ -521,6 +522,7 @@ config ARCH_OMAP1
        select GENERIC_IRQ_MULTI_HANDLER
        select GPIOLIB
        select HAVE_IDE
+       select HAVE_LEGACY_CLK
        select IRQ_DOMAIN
        select NEED_MACH_IO_H if PCCARD
        select NEED_MACH_MEMORY_H
index e65e8d82442a20164f298cb5fd1c183f441cebfe..6444ebfd06a6656563db32286f87c00eaf11e68c 100644 (file)
@@ -11,6 +11,7 @@ config C6X
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select CLKDEV_LOOKUP
+       select HAVE_LEGACY_CLK
        select GENERIC_ATOMIC64
        select GENERIC_IRQ_SHOW
        select HAVE_ARCH_TRACEHOOK
index 60ac1cd8b96fb868effbf9ae03730347729bd200..bd2d29c22a10520a8319b35475917e122275c087 100644 (file)
@@ -28,7 +28,7 @@ config COLDFIRE
        select CPU_HAS_NO_MULDIV64
        select GENERIC_CSUM
        select GPIOLIB
-       select HAVE_CLK
+       select HAVE_LEGACY_CLK
 
 endchoice
 
index 4386bac2c7ac74c5bdede70163ec56e60e565aeb..da7530689a8b82d7e34f3404cce7887aea810122 100644 (file)
@@ -181,7 +181,7 @@ config AR7
        select SYS_SUPPORTS_ZBOOT_UART16550
        select GPIOLIB
        select VLYNQ
-       select HAVE_CLK
+       select HAVE_LEGACY_CLK
        help
          Support for the Texas Instruments AR7 System-on-a-Chip
          family: TNETD7100, 7200 and 7300.
@@ -296,9 +296,9 @@ config BCM63XX
        select SYS_HAS_EARLY_PRINTK
        select SWAP_IO_SPACE
        select GPIOLIB
-       select HAVE_CLK
        select MIPS_L1_CACHE_SHIFT_4
        select CLKDEV_LOOKUP
+       select HAVE_LEGACY_CLK
        help
          Support for BCM63XX based boards
 
@@ -419,6 +419,7 @@ config LANTIQ
        select SWAP_IO_SPACE
        select BOOT_RAW
        select CLKDEV_LOOKUP
+       select HAVE_LEGACY_CLK
        select USE_OF
        select PINCTRL
        select PINCTRL_LANTIQ
index 595dd48e1e4db91aeb1ed53c277cc371401feeba..c9ec43afde73eceaa5b59888716073fd5050386e 100644 (file)
@@ -46,7 +46,7 @@ config LEMOTE_MACH2F
        select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
        select DMA_NONCOHERENT
        select GENERIC_ISA_DMA_SUPPORT_BROKEN
-       select HAVE_CLK
+       select HAVE_LEGACY_CLK
        select FORCE_PCI
        select I8259
        select IRQ_MIPS_CPU
index 35c2ebd8f0945f345a0eae35a7d42295d00a2758..c10d8b233ab15ee6473374a83c7ddf0ede6b1cde 100644 (file)
@@ -27,18 +27,22 @@ choice
        config SOC_RT288X
                bool "RT288x"
                select MIPS_L1_CACHE_SHIFT_4
+               select HAVE_LEGACY_CLK
                select HAVE_PCI
 
        config SOC_RT305X
                bool "RT305x"
+               select HAVE_LEGACY_CLK
 
        config SOC_RT3883
                bool "RT3883"
+               select HAVE_LEGACY_CLK
                select HAVE_PCI
 
        config SOC_MT7620
                bool "MT7620/8"
                select CPU_MIPSR2_IRQ_VI
+               select HAVE_LEGACY_CLK
                select HAVE_PCI
 
        config SOC_MT7621
index cee24c308337c7935bdfefedf19d678363c03041..fb0ca0c1efe11dcef2189d4537f28903d5ec43d8 100644 (file)
@@ -7,6 +7,11 @@ config SOLUTION_ENGINE
 config SH_ALPHA_BOARD
        bool
 
+config SH_CUSTOM_CLK
+       def_bool y
+       depends on !SH_DEVICE_TREE
+       select HAVE_LEGACY_CLK
+
 config SH_DEVICE_TREE
        bool
        select OF
index 41fe944005f818acf563b6496151af48498b71ae..11ba1839d198e346970a915964b95a6702abea18 100644 (file)
@@ -70,7 +70,7 @@ config ARCH_PUV3
        def_bool y
        select CPU_UCV2
        select GENERIC_CLOCKEVENTS
-       select HAVE_CLK
+       select HAVE_LEGACY_CLK
        select GPIOLIB
 
 # CONFIGs for ARCH_PUV3
index bcb257baed06daa03012d3a4f6aca4f5dd9c8b51..890bed62196db0c491f3ba3defa7c5cce9d9d330 100644 (file)
@@ -7,8 +7,18 @@ config CLKDEV_LOOKUP
 config HAVE_CLK_PREPARE
        bool
 
-config COMMON_CLK
+config HAVE_LEGACY_CLK # TODO: Remove once all legacy users are migrated
        bool
+       select HAVE_CLK
+       help
+         Select this option when the clock API in <linux/clk.h> is implemented
+         by platform/architecture code. This method is deprecated. Modern
+         code should select COMMON_CLK instead and not define a custom
+         'struct clk'.
+
+menuconfig COMMON_CLK
+       bool "Common Clock Framework"
+       depends on !HAVE_LEGACY_CLK
        select HAVE_CLK_PREPARE
        select CLKDEV_LOOKUP
        select SRCU
@@ -20,8 +30,7 @@ config COMMON_CLK
          Architectures utilizing the common struct clk should select
          this option.
 
-menu "Common Clock Framework"
-       depends on COMMON_CLK
+if COMMON_CLK
 
 config COMMON_CLK_WM831X
        tristate "Clock driver for WM831x/2x PMICs"
@@ -362,4 +371,4 @@ source "drivers/clk/ti/Kconfig"
 source "drivers/clk/uniphier/Kconfig"
 source "drivers/clk/zynqmp/Kconfig"
 
-endmenu
+endif