linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: Make the generic clock API available by default
@ 2012-10-22 13:02 Mark Brown
  2012-10-22 13:05 ` Russell King - ARM Linux
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Mark Brown @ 2012-10-22 13:02 UTC (permalink / raw)
  To: Russell King, Mike Turquette, Guan Xuetao, Ralf Baechle
  Cc: linux-arm-kernel, linux-mips, linux-kernel, 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 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.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Mike, the patch to provide a defualt clkdev.h went in during the merge
window so it should now be safe to merge this.

 arch/arm/Kconfig            |   13 +++++++++++++
 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, 33 insertions(+), 3 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fe90e60..2248940 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -314,6 +314,7 @@ config ARCH_VERSATILE
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_MACH_CLKDEV
+	select HAVE_CUSTOM_CLK
 	select ICST
 	select PLAT_VERSATILE
 	select PLAT_VERSATILE_CLCD
@@ -327,6 +328,7 @@ config ARCH_AT91
 	select ARCH_REQUIRE_GPIOLIB
 	select CLKDEV_LOOKUP
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select IRQ_DOMAIN
 	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H if PCCARD
@@ -632,6 +634,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 SPARSE_IRQ
@@ -666,6 +669,7 @@ config ARCH_MSM
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	help
 	  Support for Qualcomm MSM/QSD based systems.  This runs on the
 	  apps processor of the MSM/QSD and depends on a shared memory
@@ -678,6 +682,7 @@ config ARCH_SHMOBILE
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_MACH_CLKDEV
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
@@ -728,10 +733,12 @@ config ARCH_SA1100
 config ARCH_S3C24XX
 	bool "Samsung S3C24XX SoCs"
 	select ARCH_HAS_CPUFREQ
+	select CLKDEV_LOOKUP
 	select ARCH_USES_GETTIMEOFFSET
 	select CLKDEV_LOOKUP
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -752,6 +759,7 @@ config ARCH_S3C64XX
 	select CLKDEV_LOOKUP
 	select CPU_V6
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_TCM
@@ -775,6 +783,7 @@ config ARCH_S5P64X0
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -790,6 +799,7 @@ config ARCH_S5PC100
 	select CPU_V7
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -808,6 +818,7 @@ config ARCH_S5PV210
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -826,6 +837,7 @@ config ARCH_EXYNOS
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -928,6 +940,7 @@ config ARCH_OMAP
 	select CLKSRC_MMIO
 	select GENERIC_CLOCKEVENTS
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select NEED_MACH_GPIO_H
 	help
 	  Support for TI's OMAP platform (OMAP1/2/3/4).
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 06e73bf..bfeb9cc 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -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
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ce6c9a6..e0be02f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -85,6 +85,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.
@@ -97,6 +98,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
@@ -134,6 +136,7 @@ config BCM63XX
 	select SWAP_IO_SPACE
 	select ARCH_REQUIRE_GPIOLIB
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	help
 	 Support for BCM63XX based boards
 
@@ -229,6 +232,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
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig
index 263beb9..ed42be1 100644
--- a/arch/mips/loongson/Kconfig
+++ b/arch/mips/loongson/Kconfig
@@ -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
diff --git a/arch/mips/loongson1/Kconfig b/arch/mips/loongson1/Kconfig
index a9a14d6..ddaa7d0 100644
--- a/arch/mips/loongson1/Kconfig
+++ b/arch/mips/loongson1/Kconfig
@@ -16,6 +16,7 @@ config LOONGSON1_LS1B
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_HAS_EARLY_PRINTK
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 
 endchoice
 
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
index 6d40bc7..04e3cdb 100644
--- a/arch/mips/txx9/Kconfig
+++ b/arch/mips/txx9/Kconfig
@@ -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"
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 5af5aa7..da4ea6c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1028,6 +1028,7 @@ config PPC_CLOCK
 	bool
 	default n
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 
 config PPC_LIB_RHEAP
 	bool
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index fda37c9..8247d69 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -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
 
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index bace9e9..8dc8391 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-22 13:02 [PATCH] clk: Make the generic clock API available by default Mark Brown
@ 2012-10-22 13:05 ` Russell King - ARM Linux
  2012-10-22 13:27   ` Mark Brown
  2012-10-22 15:56 ` Stephen Warren
       [not found] ` <CAJhJPsV0rnE+K-9bWFy85T36H+PfbibrsGQ_mN_miqttyQJNhw@mail.gmail.com>
  2 siblings, 1 reply; 16+ messages in thread
From: Russell King - ARM Linux @ 2012-10-22 13:05 UTC (permalink / raw)
  To: Mark Brown
  Cc: Mike Turquette, Guan Xuetao, Ralf Baechle, linux-arm-kernel,
	linux-mips, linux-kernel

On Mon, Oct 22, 2012 at 02:02:50PM +0100, Mark Brown wrote:
> @@ -327,6 +328,7 @@ config ARCH_AT91
>  	select ARCH_REQUIRE_GPIOLIB
>  	select CLKDEV_LOOKUP
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK

This is silly.  If you select "HAVE_CUSTOM_CLK" then isn't it true that
"HAVE_CLK" should also be selected?  If so, why not have "HAVE_CUSTOM_CLK"
do that selection and remove it from all these entries?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-22 13:05 ` Russell King - ARM Linux
@ 2012-10-22 13:27   ` Mark Brown
  2012-10-22 13:50     ` Russell King - ARM Linux
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2012-10-22 13:27 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Mike Turquette, Guan Xuetao, Ralf Baechle, linux-arm-kernel,
	linux-mips, linux-kernel

On Mon, Oct 22, 2012 at 02:05:57PM +0100, Russell King - ARM Linux wrote:
> On Mon, Oct 22, 2012 at 02:02:50PM +0100, Mark Brown wrote:
> > @@ -327,6 +328,7 @@ config ARCH_AT91
> >  	select ARCH_REQUIRE_GPIOLIB
> >  	select CLKDEV_LOOKUP
> >  	select HAVE_CLK
> > +	select HAVE_CUSTOM_CLK

> This is silly.  If you select "HAVE_CUSTOM_CLK" then isn't it true that
> "HAVE_CLK" should also be selected?  If so, why not have "HAVE_CUSTOM_CLK"
> do that selection and remove it from all these entries?

If we're worrying about that there's the larger point that the effect of
this patch is to make HAVE_CLK meaningless as there will be no platform
for which it's not true.  I was just leaving HAVE_CLK alone for now
ready to circle around on it if we ever manage to get the enabling bit
sorted.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-22 13:27   ` Mark Brown
@ 2012-10-22 13:50     ` Russell King - ARM Linux
  2012-10-22 13:54       ` Mark Brown
  0 siblings, 1 reply; 16+ messages in thread
From: Russell King - ARM Linux @ 2012-10-22 13:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: Mike Turquette, Guan Xuetao, Ralf Baechle, linux-arm-kernel,
	linux-mips, linux-kernel

On Mon, Oct 22, 2012 at 02:27:11PM +0100, Mark Brown wrote:
> On Mon, Oct 22, 2012 at 02:05:57PM +0100, Russell King - ARM Linux wrote:
> > On Mon, Oct 22, 2012 at 02:02:50PM +0100, Mark Brown wrote:
> > > @@ -327,6 +328,7 @@ config ARCH_AT91
> > >  	select ARCH_REQUIRE_GPIOLIB
> > >  	select CLKDEV_LOOKUP
> > >  	select HAVE_CLK
> > > +	select HAVE_CUSTOM_CLK
> 
> > This is silly.  If you select "HAVE_CUSTOM_CLK" then isn't it true that
> > "HAVE_CLK" should also be selected?  If so, why not have "HAVE_CUSTOM_CLK"
> > do that selection and remove it from all these entries?
> 
> If we're worrying about that there's the larger point that the effect of
> this patch is to make HAVE_CLK meaningless as there will be no platform
> for which it's not true.  I was just leaving HAVE_CLK alone for now
> ready to circle around on it if we ever manage to get the enabling bit
> sorted.

Are you sure that all architectures are fine with having that permanently
enabled?  What about nommu architectures?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-22 13:50     ` Russell King - ARM Linux
@ 2012-10-22 13:54       ` Mark Brown
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2012-10-22 13:54 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Mike Turquette, Guan Xuetao, Ralf Baechle, linux-arm-kernel,
	linux-mips, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

On Mon, Oct 22, 2012 at 02:50:24PM +0100, Russell King - ARM Linux wrote:
> On Mon, Oct 22, 2012 at 02:27:11PM +0100, Mark Brown wrote:

> > If we're worrying about that there's the larger point that the effect of
> > this patch is to make HAVE_CLK meaningless as there will be no platform
> > for which it's not true.  I was just leaving HAVE_CLK alone for now
> > ready to circle around on it if we ever manage to get the enabling bit
> > sorted.

> Are you sure that all architectures are fine with having that permanently
> enabled?  What about nommu architectures?

There's already stubs present so the main use case for depending on it
(checking if code can build) is already covered without requiring that
the API actually be built on all platforms.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-22 13:02 [PATCH] clk: Make the generic clock API available by default Mark Brown
  2012-10-22 13:05 ` Russell King - ARM Linux
@ 2012-10-22 15:56 ` Stephen Warren
  2012-10-23  9:47   ` Mark Brown
       [not found] ` <CAJhJPsV0rnE+K-9bWFy85T36H+PfbibrsGQ_mN_miqttyQJNhw@mail.gmail.com>
  2 siblings, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2012-10-22 15:56 UTC (permalink / raw)
  To: Mark Brown
  Cc: Russell King, Mike Turquette, Guan Xuetao, Ralf Baechle,
	linux-arm-kernel, linux-mips, linux-kernel

On 10/22/2012 07:02 AM, Mark Brown wrote:
> 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.

> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig

> @@ -632,6 +634,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 SPARSE_IRQ

Since v3.7-rc1, Tegra uses common clock, so I don't think the change
above is right is it?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
       [not found] ` <CAJhJPsV0rnE+K-9bWFy85T36H+PfbibrsGQ_mN_miqttyQJNhw@mail.gmail.com>
@ 2012-10-23  9:22   ` Mark Brown
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2012-10-23  9:22 UTC (permalink / raw)
  To: Kelvin Cheung
  Cc: Russell King, Mike Turquette, Guan Xuetao, Ralf Baechle,
	linux-arm-kernel, linux-mips, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

On Tue, Oct 23, 2012 at 10:10:09AM +0800, Kelvin Cheung wrote:
> Hi Mark,

Don't top post!

> But the common clock infrastructure of Loongson1 has been implemented and
> enabled in previous patches.
> http://patchwork.linux-mips.org/patch/4268/
> Please remove this arch from your patch.

Done.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-22 15:56 ` Stephen Warren
@ 2012-10-23  9:47   ` Mark Brown
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2012-10-23  9:47 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, Mike Turquette, Guan Xuetao, Ralf Baechle,
	linux-arm-kernel, linux-mips, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

On Mon, Oct 22, 2012 at 09:56:54AM -0600, Stephen Warren wrote:

> Since v3.7-rc1, Tegra uses common clock, so I don't think the change
> above is right is it?

No, updated.  It really shouldn't take multiple kernel releases to get
something like this done...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-10-23  9:54 Mark Brown
@ 2012-11-26 21:39 ` Grant Likely
  0 siblings, 0 replies; 16+ messages in thread
From: Grant Likely @ 2012-11-26 21:39 UTC (permalink / raw)
  To: Mark Brown, Mike Turquette, Russell King, Guan Xuetao, Ralf Baechle
  Cc: linux-arm-kernel, linux-kernel, linux-mips, Mark Brown

On Tue, 23 Oct 2012 10:54:08 +0100, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> 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.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Looks reasonable to me.

Acked-by: Grant Likely <grant.likely@secretlab.ca>

g.

> ---
>  arch/arm/Kconfig           |   12 ++++++++++++
>  arch/avr32/Kconfig         |    1 +
>  arch/mips/Kconfig          |    4 ++++
>  arch/mips/loongson/Kconfig |    1 +
>  arch/mips/txx9/Kconfig     |    1 +
>  arch/powerpc/Kconfig       |    1 +
>  arch/unicore32/Kconfig     |    1 +
>  drivers/clk/Kconfig        |   13 ++++++++++---
>  8 files changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index fe90e60..ec7baca 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -314,6 +314,7 @@ config ARCH_VERSATILE
>  	select CLKDEV_LOOKUP
>  	select GENERIC_CLOCKEVENTS
>  	select HAVE_MACH_CLKDEV
> +	select HAVE_CUSTOM_CLK
>  	select ICST
>  	select PLAT_VERSATILE
>  	select PLAT_VERSATILE_CLCD
> @@ -327,6 +328,7 @@ config ARCH_AT91
>  	select ARCH_REQUIRE_GPIOLIB
>  	select CLKDEV_LOOKUP
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select IRQ_DOMAIN
>  	select NEED_MACH_GPIO_H
>  	select NEED_MACH_IO_H if PCCARD
> @@ -666,6 +668,7 @@ config ARCH_MSM
>  	select CLKDEV_LOOKUP
>  	select GENERIC_CLOCKEVENTS
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	help
>  	  Support for Qualcomm MSM/QSD based systems.  This runs on the
>  	  apps processor of the MSM/QSD and depends on a shared memory
> @@ -678,6 +681,7 @@ config ARCH_SHMOBILE
>  	select CLKDEV_LOOKUP
>  	select GENERIC_CLOCKEVENTS
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_MACH_CLKDEV
>  	select HAVE_SMP
>  	select MIGHT_HAVE_CACHE_L2X0
> @@ -728,10 +732,12 @@ config ARCH_SA1100
>  config ARCH_S3C24XX
>  	bool "Samsung S3C24XX SoCs"
>  	select ARCH_HAS_CPUFREQ
> +	select CLKDEV_LOOKUP
>  	select ARCH_USES_GETTIMEOFFSET
>  	select CLKDEV_LOOKUP
>  	select GENERIC_GPIO
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_S3C2410_I2C if I2C
>  	select HAVE_S3C2410_WATCHDOG if WATCHDOG
>  	select HAVE_S3C_RTC if RTC_CLASS
> @@ -752,6 +758,7 @@ config ARCH_S3C64XX
>  	select CLKDEV_LOOKUP
>  	select CPU_V6
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_S3C2410_I2C if I2C
>  	select HAVE_S3C2410_WATCHDOG if WATCHDOG
>  	select HAVE_TCM
> @@ -775,6 +782,7 @@ config ARCH_S5P64X0
>  	select GENERIC_CLOCKEVENTS
>  	select GENERIC_GPIO
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_S3C2410_I2C if I2C
>  	select HAVE_S3C2410_WATCHDOG if WATCHDOG
>  	select HAVE_S3C_RTC if RTC_CLASS
> @@ -790,6 +798,7 @@ config ARCH_S5PC100
>  	select CPU_V7
>  	select GENERIC_GPIO
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_S3C2410_I2C if I2C
>  	select HAVE_S3C2410_WATCHDOG if WATCHDOG
>  	select HAVE_S3C_RTC if RTC_CLASS
> @@ -808,6 +817,7 @@ config ARCH_S5PV210
>  	select GENERIC_CLOCKEVENTS
>  	select GENERIC_GPIO
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_S3C2410_I2C if I2C
>  	select HAVE_S3C2410_WATCHDOG if WATCHDOG
>  	select HAVE_S3C_RTC if RTC_CLASS
> @@ -826,6 +836,7 @@ config ARCH_EXYNOS
>  	select GENERIC_CLOCKEVENTS
>  	select GENERIC_GPIO
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select HAVE_S3C2410_I2C if I2C
>  	select HAVE_S3C2410_WATCHDOG if WATCHDOG
>  	select HAVE_S3C_RTC if RTC_CLASS
> @@ -928,6 +939,7 @@ config ARCH_OMAP
>  	select CLKSRC_MMIO
>  	select GENERIC_CLOCKEVENTS
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	select NEED_MACH_GPIO_H
>  	help
>  	  Support for TI's OMAP platform (OMAP1/2/3/4).
> diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
> index 06e73bf..bfeb9cc 100644
> --- a/arch/avr32/Kconfig
> +++ b/arch/avr32/Kconfig
> @@ -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
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index ce6c9a6..e0be02f 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -85,6 +85,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.
> @@ -97,6 +98,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
> @@ -134,6 +136,7 @@ config BCM63XX
>  	select SWAP_IO_SPACE
>  	select ARCH_REQUIRE_GPIOLIB
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  	help
>  	 Support for BCM63XX based boards
>  
> @@ -229,6 +232,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
> diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig
> index 263beb9..ed42be1 100644
> --- a/arch/mips/loongson/Kconfig
> +++ b/arch/mips/loongson/Kconfig
> @@ -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
> diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
> index 6d40bc7..04e3cdb 100644
> --- a/arch/mips/txx9/Kconfig
> +++ b/arch/mips/txx9/Kconfig
> @@ -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"
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 5af5aa7..da4ea6c 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -1028,6 +1028,7 @@ config PPC_CLOCK
>  	bool
>  	default n
>  	select HAVE_CLK
> +	select HAVE_CUSTOM_CLK
>  
>  config PPC_LIB_RHEAP
>  	bool
> diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
> index fda37c9..8247d69 100644
> --- a/arch/unicore32/Kconfig
> +++ b/arch/unicore32/Kconfig
> @@ -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
>  
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index bace9e9..8dc8391 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -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
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] clk: Make the generic clock API available by default
@ 2012-10-23  9:54 Mark Brown
  2012-11-26 21:39 ` Grant Likely
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2012-10-23  9:54 UTC (permalink / raw)
  To: Mike Turquette, Russell King, Guan Xuetao, Ralf Baechle
  Cc: linux-arm-kernel, linux-kernel, linux-mips, 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 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.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/Kconfig           |   12 ++++++++++++
 arch/avr32/Kconfig         |    1 +
 arch/mips/Kconfig          |    4 ++++
 arch/mips/loongson/Kconfig |    1 +
 arch/mips/txx9/Kconfig     |    1 +
 arch/powerpc/Kconfig       |    1 +
 arch/unicore32/Kconfig     |    1 +
 drivers/clk/Kconfig        |   13 ++++++++++---
 8 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fe90e60..ec7baca 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -314,6 +314,7 @@ config ARCH_VERSATILE
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_MACH_CLKDEV
+	select HAVE_CUSTOM_CLK
 	select ICST
 	select PLAT_VERSATILE
 	select PLAT_VERSATILE_CLCD
@@ -327,6 +328,7 @@ config ARCH_AT91
 	select ARCH_REQUIRE_GPIOLIB
 	select CLKDEV_LOOKUP
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select IRQ_DOMAIN
 	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H if PCCARD
@@ -666,6 +668,7 @@ config ARCH_MSM
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	help
 	  Support for Qualcomm MSM/QSD based systems.  This runs on the
 	  apps processor of the MSM/QSD and depends on a shared memory
@@ -678,6 +681,7 @@ config ARCH_SHMOBILE
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_MACH_CLKDEV
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
@@ -728,10 +732,12 @@ config ARCH_SA1100
 config ARCH_S3C24XX
 	bool "Samsung S3C24XX SoCs"
 	select ARCH_HAS_CPUFREQ
+	select CLKDEV_LOOKUP
 	select ARCH_USES_GETTIMEOFFSET
 	select CLKDEV_LOOKUP
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -752,6 +758,7 @@ config ARCH_S3C64XX
 	select CLKDEV_LOOKUP
 	select CPU_V6
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_TCM
@@ -775,6 +782,7 @@ config ARCH_S5P64X0
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -790,6 +798,7 @@ config ARCH_S5PC100
 	select CPU_V7
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -808,6 +817,7 @@ config ARCH_S5PV210
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -826,6 +836,7 @@ config ARCH_EXYNOS
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_S3C_RTC if RTC_CLASS
@@ -928,6 +939,7 @@ config ARCH_OMAP
 	select CLKSRC_MMIO
 	select GENERIC_CLOCKEVENTS
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	select NEED_MACH_GPIO_H
 	help
 	  Support for TI's OMAP platform (OMAP1/2/3/4).
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 06e73bf..bfeb9cc 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -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
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ce6c9a6..e0be02f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -85,6 +85,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.
@@ -97,6 +98,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
@@ -134,6 +136,7 @@ config BCM63XX
 	select SWAP_IO_SPACE
 	select ARCH_REQUIRE_GPIOLIB
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 	help
 	 Support for BCM63XX based boards
 
@@ -229,6 +232,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
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig
index 263beb9..ed42be1 100644
--- a/arch/mips/loongson/Kconfig
+++ b/arch/mips/loongson/Kconfig
@@ -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
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
index 6d40bc7..04e3cdb 100644
--- a/arch/mips/txx9/Kconfig
+++ b/arch/mips/txx9/Kconfig
@@ -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"
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 5af5aa7..da4ea6c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1028,6 +1028,7 @@ config PPC_CLOCK
 	bool
 	default n
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 
 config PPC_LIB_RHEAP
 	bool
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index fda37c9..8247d69 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -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
 
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index bace9e9..8dc8391 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-08-28 20:35 Mark Brown
  2012-08-29  5:56 ` Hans-Christian Egtvedt
  2012-08-29 21:49 ` Stephen Warren
@ 2012-09-05  2:03 ` Benjamin Herrenschmidt
  2 siblings, 0 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2012-09-05  2:03 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Russell King, Haavard Skinnemoen,
	Hans-Christian Egtvedt, Ralf Baechle, Paul Mackerras,
	Guan Xuetao, linux-kernel, linux-arm-kernel, linux-mips,
	linuxppc-dev

On Tue, 2012-08-28 at 13:35 -0700, Mark Brown wrote:
> 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.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---

For powerpc:

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Cheers,
Ben.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-08-30 17:19   ` Mark Brown
@ 2012-08-30 23:40     ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-08-30 23:40 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Russell King, Haavard Skinnemoen,
	Hans-Christian Egtvedt, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Guan Xuetao, linux-kernel, linux-arm-kernel,
	linux-mips, linuxppc-dev

On 08/30/12 10:19, Mark Brown wrote:
> On Wed, Aug 29, 2012 at 02:49:34PM -0700, Stephen Warren wrote:
>> On 08/28/12 13:35, Mark Brown wrote:
>
>>> @@ -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?
>
> 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.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-08-29 21:49 ` Stephen Warren
@ 2012-08-30 17:19   ` Mark Brown
  2012-08-30 23:40     ` Stephen Warren
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2012-08-30 17:19 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Arnd Bergmann, Russell King, Haavard Skinnemoen,
	Hans-Christian Egtvedt, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Guan Xuetao, linux-kernel, linux-arm-kernel,
	linux-mips, linuxppc-dev

On Wed, Aug 29, 2012 at 02:49:34PM -0700, Stephen Warren wrote:
> On 08/28/12 13:35, Mark Brown wrote:

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

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?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-08-28 20:35 Mark Brown
  2012-08-29  5:56 ` Hans-Christian Egtvedt
@ 2012-08-29 21:49 ` Stephen Warren
  2012-08-30 17:19   ` Mark Brown
  2012-09-05  2:03 ` Benjamin Herrenschmidt
  2 siblings, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2012-08-29 21:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Russell King, Haavard Skinnemoen,
	Hans-Christian Egtvedt, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Guan Xuetao, linux-kernel, linux-arm-kernel,
	linux-mips, linuxppc-dev

On 08/28/12 13:35, Mark Brown wrote:
> 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.

> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] clk: Make the generic clock API available by default
  2012-08-28 20:35 Mark Brown
@ 2012-08-29  5:56 ` Hans-Christian Egtvedt
  2012-08-29 21:49 ` Stephen Warren
  2012-09-05  2:03 ` Benjamin Herrenschmidt
  2 siblings, 0 replies; 16+ messages in thread
From: Hans-Christian Egtvedt @ 2012-08-29  5:56 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Russell King, Haavard Skinnemoen, Ralf Baechle,
	Benjamin Herrenschmidt, Paul Mackerras, Guan Xuetao,
	linux-kernel, linux-arm-kernel, linux-mips, linuxppc-dev

Around Tue 28 Aug 2012 13:35:04 -0700 or thereabout, Mark Brown wrote:
> 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.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> 
> 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 +

For the AVR32 related changes

Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>

<snipp>

-- 
mvh
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] clk: Make the generic clock API available by default
@ 2012-08-28 20:35 Mark Brown
  2012-08-29  5:56 ` Hans-Christian Egtvedt
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Mark Brown @ 2012-08-28 20:35 UTC (permalink / raw)
  To: Arnd Bergmann, Russell King, Haavard Skinnemoen,
	Hans-Christian Egtvedt, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Guan Xuetao
  Cc: linux-kernel, linux-arm-kernel, linux-mips, linuxppc-dev, 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 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.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---

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(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d4471d4..2a5633b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 06e73bf..bfeb9cc 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -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
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 641d067..27dfc99 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -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
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig
index 263beb9..ed42be1 100644
--- a/arch/mips/loongson/Kconfig
+++ b/arch/mips/loongson/Kconfig
@@ -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
diff --git a/arch/mips/loongson1/Kconfig b/arch/mips/loongson1/Kconfig
index a9a14d6..ddaa7d0 100644
--- a/arch/mips/loongson1/Kconfig
+++ b/arch/mips/loongson1/Kconfig
@@ -16,6 +16,7 @@ config LOONGSON1_LS1B
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_HAS_EARLY_PRINTK
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 
 endchoice
 
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
index 6d40bc7..04e3cdb 100644
--- a/arch/mips/txx9/Kconfig
+++ b/arch/mips/txx9/Kconfig
@@ -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"
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 58088dd..b7a611b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1013,6 +1013,7 @@ config PPC_CLOCK
 	bool
 	default n
 	select HAVE_CLK
+	select HAVE_CUSTOM_CLK
 
 config PPC_LIB_RHEAP
 	bool
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 5d53ffd..fe30bb1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -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
 
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 7f0b5ca..e94fd06 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-11-26 21:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 13:02 [PATCH] clk: Make the generic clock API available by default Mark Brown
2012-10-22 13:05 ` Russell King - ARM Linux
2012-10-22 13:27   ` Mark Brown
2012-10-22 13:50     ` Russell King - ARM Linux
2012-10-22 13:54       ` Mark Brown
2012-10-22 15:56 ` Stephen Warren
2012-10-23  9:47   ` Mark Brown
     [not found] ` <CAJhJPsV0rnE+K-9bWFy85T36H+PfbibrsGQ_mN_miqttyQJNhw@mail.gmail.com>
2012-10-23  9:22   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2012-10-23  9:54 Mark Brown
2012-11-26 21:39 ` Grant Likely
2012-08-28 20:35 Mark Brown
2012-08-29  5:56 ` Hans-Christian Egtvedt
2012-08-29 21:49 ` Stephen Warren
2012-08-30 17:19   ` Mark Brown
2012-08-30 23:40     ` Stephen Warren
2012-09-05  2:03 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).