Skip to content

Commit bbd7ffd

Browse files
committed
clk: Allow the common clk framework to be selectable
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 <[email protected]>. Cc: Mark Brown <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Mark Salter <[email protected]> Cc: Aurelien Jacquiot <[email protected]> Cc: Jiaxun Yang <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Russell King <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Rich Felker <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
1 parent 3fd2fdb commit bbd7ffd

File tree

9 files changed

+31
-9
lines changed

9 files changed

+31
-9
lines changed

arch/arm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ config ARCH_EP93XX
363363
select CPU_ARM920T
364364
select GENERIC_CLOCKEVENTS
365365
select GPIOLIB
366+
select HAVE_LEGACY_CLK
366367
help
367368
This enables support for the Cirrus EP93xx series of CPUs.
368369

@@ -521,6 +522,7 @@ config ARCH_OMAP1
521522
select GENERIC_IRQ_MULTI_HANDLER
522523
select GPIOLIB
523524
select HAVE_IDE
525+
select HAVE_LEGACY_CLK
524526
select IRQ_DOMAIN
525527
select NEED_MACH_IO_H if PCCARD
526528
select NEED_MACH_MEMORY_H

arch/c6x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config C6X
1111
select ARCH_HAS_SYNC_DMA_FOR_CPU
1212
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
1313
select CLKDEV_LOOKUP
14+
select HAVE_LEGACY_CLK
1415
select GENERIC_ATOMIC64
1516
select GENERIC_IRQ_SHOW
1617
select HAVE_ARCH_TRACEHOOK

arch/m68k/Kconfig.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ config COLDFIRE
2828
select CPU_HAS_NO_MULDIV64
2929
select GENERIC_CSUM
3030
select GPIOLIB
31-
select HAVE_CLK
31+
select HAVE_LEGACY_CLK
3232

3333
endchoice
3434

arch/mips/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ config AR7
181181
select SYS_SUPPORTS_ZBOOT_UART16550
182182
select GPIOLIB
183183
select VLYNQ
184-
select HAVE_CLK
184+
select HAVE_LEGACY_CLK
185185
help
186186
Support for the Texas Instruments AR7 System-on-a-Chip
187187
family: TNETD7100, 7200 and 7300.
@@ -296,9 +296,9 @@ config BCM63XX
296296
select SYS_HAS_EARLY_PRINTK
297297
select SWAP_IO_SPACE
298298
select GPIOLIB
299-
select HAVE_CLK
300299
select MIPS_L1_CACHE_SHIFT_4
301300
select CLKDEV_LOOKUP
301+
select HAVE_LEGACY_CLK
302302
help
303303
Support for BCM63XX based boards
304304

@@ -419,6 +419,7 @@ config LANTIQ
419419
select SWAP_IO_SPACE
420420
select BOOT_RAW
421421
select CLKDEV_LOOKUP
422+
select HAVE_LEGACY_CLK
422423
select USE_OF
423424
select PINCTRL
424425
select PINCTRL_LANTIQ

arch/mips/loongson2ef/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ config LEMOTE_MACH2F
4646
select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
4747
select DMA_NONCOHERENT
4848
select GENERIC_ISA_DMA_SUPPORT_BROKEN
49-
select HAVE_CLK
49+
select HAVE_LEGACY_CLK
5050
select FORCE_PCI
5151
select I8259
5252
select IRQ_MIPS_CPU

arch/mips/ralink/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@ choice
2727
config SOC_RT288X
2828
bool "RT288x"
2929
select MIPS_L1_CACHE_SHIFT_4
30+
select HAVE_LEGACY_CLK
3031
select HAVE_PCI
3132

3233
config SOC_RT305X
3334
bool "RT305x"
35+
select HAVE_LEGACY_CLK
3436

3537
config SOC_RT3883
3638
bool "RT3883"
39+
select HAVE_LEGACY_CLK
3740
select HAVE_PCI
3841

3942
config SOC_MT7620
4043
bool "MT7620/8"
4144
select CPU_MIPSR2_IRQ_VI
45+
select HAVE_LEGACY_CLK
4246
select HAVE_PCI
4347

4448
config SOC_MT7621

arch/sh/boards/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ config SOLUTION_ENGINE
77
config SH_ALPHA_BOARD
88
bool
99

10+
config SH_CUSTOM_CLK
11+
def_bool y
12+
depends on !SH_DEVICE_TREE
13+
select HAVE_LEGACY_CLK
14+
1015
config SH_DEVICE_TREE
1116
bool
1217
select OF

arch/unicore32/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ config ARCH_PUV3
7070
def_bool y
7171
select CPU_UCV2
7272
select GENERIC_CLOCKEVENTS
73-
select HAVE_CLK
73+
select HAVE_LEGACY_CLK
7474
select GPIOLIB
7575

7676
# CONFIGs for ARCH_PUV3

drivers/clk/Kconfig

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@ config CLKDEV_LOOKUP
77
config HAVE_CLK_PREPARE
88
bool
99

10-
config COMMON_CLK
10+
config HAVE_LEGACY_CLK # TODO: Remove once all legacy users are migrated
1111
bool
12+
select HAVE_CLK
13+
help
14+
Select this option when the clock API in <linux/clk.h> is implemented
15+
by platform/architecture code. This method is deprecated. Modern
16+
code should select COMMON_CLK instead and not define a custom
17+
'struct clk'.
18+
19+
menuconfig COMMON_CLK
20+
bool "Common Clock Framework"
21+
depends on !HAVE_LEGACY_CLK
1222
select HAVE_CLK_PREPARE
1323
select CLKDEV_LOOKUP
1424
select SRCU
@@ -20,8 +30,7 @@ config COMMON_CLK
2030
Architectures utilizing the common struct clk should select
2131
this option.
2232

23-
menu "Common Clock Framework"
24-
depends on COMMON_CLK
33+
if COMMON_CLK
2534

2635
config COMMON_CLK_WM831X
2736
tristate "Clock driver for WM831x/2x PMICs"
@@ -362,4 +371,4 @@ source "drivers/clk/ti/Kconfig"
362371
source "drivers/clk/uniphier/Kconfig"
363372
source "drivers/clk/zynqmp/Kconfig"
364373

365-
endmenu
374+
endif

0 commit comments

Comments
 (0)