clk: Make the generic clock API available by default
Subsystems (4)
PATCH 1/1 clk: Make the generic clock API available by default
Rather than requiring platforms to select the generic clock API to make it available make the API available as a user selectable option unless the user either selects HAVE_CUSTOM_CLK (if they have their own implementation) or selects COMMON_CLK (if they depend on the generic implementation).
All current architectures that HAVE_CLK but don't use the common clock framework have selects of HAVE_CUSTOM_CLK added.
This allows drivers to use the generic API on platforms which have no need for the clock API at platform level.
---
This depends on having one of the patches I've sent adding a generic clkdev.h added merged - Arnd was expecting to merge one of those, there was just the lack of clarity about the most practical Kbuild hookup.
arch/arm/Kconfig | 12 ++++++++++++ arch/avr32/Kconfig | 1 + arch/mips/Kconfig | 4 ++++ arch/mips/loongson/Kconfig | 1 + arch/mips/loongson1/Kconfig | 1 + arch/mips/txx9/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/unicore32/Kconfig | 1 + drivers/clk/Kconfig | 13 ++++++++++--- 9 files changed, 32 insertions(+), 3 deletions(-)
arch/arm/Kconfig +12 -0
@@ -330,6 +330,7 @@ config ARCH_VEXPRESS select COMMON_CLK select GENERIC_CLOCKEVENTS select HAVE_CLK + select HAVE_CUSTOM_CLK select HAVE_PATA_PLATFORM select ICST select NO_IOPORT
@@ -343,6 +344,7 @@ config ARCH_AT91 bool "Atmel AT91" select ARCH_REQUIRE_GPIOLIB select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select IRQ_DOMAIN select NEED_MACH_IO_H if PCCARD
@@ -674,6 +676,7 @@ config ARCH_TEGRA select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLK select HAVE_SMP select MIGHT_HAVE_CACHE_L2X0 select ARCH_HAS_CPUFREQ
@@ -732,6 +735,7 @@ config ARCH_PXA config ARCH_MSM bool "Qualcomm MSM" select HAVE_CLK + select HAVE_CUSTOM_CLK select GENERIC_CLOCKEVENTS select ARCH_REQUIRE_GPIOLIB select CLKDEV_LOOKUP
@@ -745,6 +749,7 @@ config ARCH_MSM config ARCH_SHMOBILE bool "Renesas SH-Mobile / R-Mobile" select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select HAVE_MACH_CLKDEV select HAVE_SMP
@@ -798,6 +803,7 @@ config ARCH_S3C24XX select GENERIC_GPIO select ARCH_HAS_CPUFREQ select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select ARCH_USES_GETTIMEOFFSET select HAVE_S3C2410_I2C if I2C
@@ -816,6 +822,7 @@ config ARCH_S3C64XX select CPU_V6 select ARM_VIC select HAVE_CLK + select HAVE_CUSTOM_CLK select HAVE_TCM select CLKDEV_LOOKUP select NO_IOPORT
@@ -838,6 +845,7 @@ config ARCH_S5P64X0 select CPU_V6 select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select CLKSRC_MMIO select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -852,6 +860,7 @@ config ARCH_S5PC100 bool "Samsung S5PC100" select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select CPU_V7 select ARCH_USES_GETTIMEOFFSET
@@ -868,6 +877,7 @@ config ARCH_S5PV210 select ARCH_HAS_HOLES_MEMORYMODEL select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select CLKSRC_MMIO select ARCH_HAS_CPUFREQ
@@ -886,6 +896,7 @@ config ARCH_EXYNOS select ARCH_HAS_HOLES_MEMORYMODEL select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLK select CLKDEV_LOOKUP select ARCH_HAS_CPUFREQ select GENERIC_CLOCKEVENTS
@@ -972,6 +983,7 @@ config ARCH_OMAP bool "TI OMAP" depends on MMU select HAVE_CLK + select HAVE_CUSTOM_CLK select ARCH_REQUIRE_GPIOLIB select ARCH_HAS_CPUFREQ select CLKSRC_MMIO
arch/avr32/Kconfig +1 -0
@@ -4,6 +4,7 @@ config AVR32 # that we usually don't need on AVR32. select EXPERT select HAVE_CLK + select HAVE_CUSTOM_CLK select HAVE_OPROFILE select HAVE_KPROBES select HAVE_GENERIC_HARDIRQS
arch/mips/Kconfig +4 -0
@@ -84,6 +84,7 @@ config AR7 select ARCH_REQUIRE_GPIOLIB select VLYNQ select HAVE_CLK + select HAVE_CUSTOM_CLK help Support for the Texas Instruments AR7 System-on-a-Chip family: TNETD7100, 7200 and 7300.
@@ -96,6 +97,7 @@ config ATH79 select CSRC_R4K select DMA_NONCOHERENT select HAVE_CLK + select HAVE_CUSTOM_CLK select IRQ_CPU select MIPS_MACHINE select SYS_HAS_CPU_MIPS32_R2
@@ -133,6 +135,7 @@ config BCM63XX select SWAP_IO_SPACE select ARCH_REQUIRE_GPIOLIB select HAVE_CLK + select HAVE_CUSTOM_CLK help Support for BCM63XX based boards
@@ -228,6 +231,7 @@ config MACH_JZ4740 select SYS_HAS_EARLY_PRINTK select HAVE_PWM select HAVE_CLK + select HAVE_CUSTOM_CLK select GENERIC_IRQ_CHIP config LANTIQ
arch/mips/loongson/Kconfig +1 -0
@@ -42,6 +42,7 @@ config LEMOTE_MACH2F select DMA_NONCOHERENT select GENERIC_ISA_DMA_SUPPORT_BROKEN select HAVE_CLK + select HAVE_CUSTOM_CLK select HW_HAS_PCI select I8259 select IRQ_CPU
arch/mips/loongson1/Kconfig +1 -0
@@ -16,6 +16,7 @@ config LOONGSON1_LS1B select SYS_SUPPORTS_HIGHMEM select SYS_HAS_EARLY_PRINTK select HAVE_CLK + select HAVE_CUSTOM_CLK endchoice
arch/mips/txx9/Kconfig +1 -0
@@ -21,6 +21,7 @@ config MACH_TXX9 select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN select HAVE_CLK + select HAVE_CUSTOM_CLK config TOSHIBA_JMR3927 bool "Toshiba JMR-TX3927 board"
arch/powerpc/Kconfig +1 -0
@@ -1013,6 +1013,7 @@ config PPC_CLOCK bool default n select HAVE_CLK + select HAVE_CUSTOM_CLK config PPC_LIB_RHEAP bool
arch/unicore32/Kconfig +1 -0
@@ -89,6 +89,7 @@ config ARCH_PUV3 select CPU_UCV2 select GENERIC_CLOCKEVENTS select HAVE_CLK + select HAVE_CUSTOM_CLK select ARCH_REQUIRE_GPIOLIB select ARCH_HAS_CPUFREQ
drivers/clk/Kconfig +10 -3
@@ -9,16 +9,23 @@ config HAVE_CLK_PREPARE config HAVE_MACH_CLKDEV bool -config COMMON_CLK +config HAVE_CUSTOM_CLK bool + ---help--- + Architectures which provide a custom clk API should select + this to disable the common clock API. + +config COMMON_CLK + bool "Common clock framework" + depends on !HAVE_CUSTOM_CLK select HAVE_CLK_PREPARE select CLKDEV_LOOKUP ---help--- The common clock framework is a single definition of struct clk, useful across many platforms, as well as an implementation of the clock API in include/linux/clk.h. - Architectures utilizing the common struct clk should select - this option. + This provides a generic way for drivers to provide and use + clocks without hard coded relationships in the drivers. menu "Common Clock Framework" depends on COMMON_CLK
Signature · 1 line
1.7.10.4
Quoted 12 lines · Mark Brown
Rather than requiring platforms to select the generic clock API to make it available make the API available as a user selectable option unless the user either selects
HAVE_CUSTOM_CLK(if they have their own implementation) or selectsCOMMON_CLK(if they depend on the generic implementation).All current architectures that
HAVE_CLKbut don't use the common clock framework have selects ofHAVE_CUSTOM_CLKadded.This allows drivers to use the generic API on platforms which have no need for the clock API at platform level.
Signed-off-by Mark Brown <[email protected]>
Quoted 8 lines
---
This depends on having one of the patches I've sent adding a generic
clkdev.hadded merged - Arnd was expecting to merge one of those, there was just the lack of clarity about the most practicalKbuildhookup.arch/arm/Kconfig | 12 ++++++++++++ arch/avr32/Kconfig | 1 +
For the AVR32 related changes
<snipp>
Signature · 2 lines
mvh Hans-Christian Egtvedt
Quoted 14 lines · Mark Brown
Rather than requiring platforms to select the generic clock API to make it available make the API available as a user selectable option unless the user either selects
HAVE_CUSTOM_CLK(if they have their own implementation) or selectsCOMMON_CLK(if they depend on the generic implementation).All current architectures that
HAVE_CLKbut don't use the common clock framework have selects ofHAVE_CUSTOM_CLKadded.This allows drivers to use the generic API on platforms which have no need for the clock API at platform level.
arch/arm/Kconfig config ARCH_TEGRA · line 679
Quoted 4 lines
arch/arm/Kconfig +1
-0@@ -674,6 +676,7 @@ config ARCH_TEGRA select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLK
For 3.7, Tegra will switch to the common clock framework. I think this patch would then disable that. How should we resolve this - rebase the Tegra common-clk tree on top of any branch containing this patch in order to remove that select statement?
Quoted 12 lines · Stephen Warren
arch/arm/Kconfig config ARCH_TEGRA · line 679
Quoted 5 lines · Mark Brown
arch/arm/Kconfig +1
-0@@ -674,6 +676,7 @@ config ARCH_TEGRA select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLKFor 3.7, Tegra will switch to the common clock framework. I think this patch would then disable that. How should we resolve this - rebase the Tegra common-clk tree on top of any branch containing this patch in order to remove that select statement?
I'd expect this to be applied on a separate branch so you should be able to rebase your conversion on top of it or merge it into your branch which should deal with things well enough I think?
Quoted 14 lines · Mark Brown
Quoted 12 lines · Stephen Warren
arch/arm/Kconfig config ARCH_TEGRA · line 679
Quoted 5 lines · Mark Brown
arch/arm/Kconfig +1
-0@@ -674,6 +676,7 @@ config ARCH_TEGRA select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK + select HAVE_CUSTOM_CLKFor 3.7, Tegra will switch to the common clock framework. I think this patch would then disable that. How should we resolve this - rebase the Tegra common-clk tree on top of any branch containing this patch in order to remove that select statement?
Quoted 3 lines
I'd expect this to be applied on a separate branch so you should be able to rebase your conversion on top of it or merge it into your branch which should deal with things well enough I think?
That should work.
Quoted 5 lines · Mark Brown
Rather than requiring platforms to select the generic clock API to make it available make the API available as a user selectable option unless the user either selects
HAVE_CUSTOM_CLK(if they have their own implementation) or selectsCOMMON_CLK(if they depend on the generic implementation).
Quoted 8 lines
All current architectures that
HAVE_CLKbut don't use the common clock framework have selects ofHAVE_CUSTOM_CLKadded.This allows drivers to use the generic API on platforms which have no need for the clock API at platform level.
Signed-off-by Mark Brown <[email protected]>---
For powerpc:
Cheers,
Ben.