diff mbox

[3/6] sh: clkfwk: Select sh-/common- clkfwk alternatively

Message ID 20130924131206.d57d07f5faa5cb0773fc328c@ops.dti.ne.jp (mailing list archive)
State Changes Requested
Headers show

Commit Message

takasi-y@ops.dti.ne.jp Sept. 24, 2013, 4:12 a.m. UTC
Make sh clock framework core depend on HAVE_MACH_CLKDEV, and
set it
- y on sh for backward compatibility
- !CONFIG_COMMON_CLK on sh-mobile
This is a preparation for migration to common clock framework
from sh clock framework on sh-mobile.

Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
---
 arch/arm/Kconfig        | 2 +-
 arch/sh/Kconfig         | 1 +
 drivers/sh/clk/Makefile | 3 +--
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Laurent Pinchart Sept. 30, 2013, 6:40 p.m. UTC | #1
Hi Yoshii-san,

Thank you for the patch.

On Tuesday 24 September 2013 13:12:06 takasi-y@ops.dti.ne.jp wrote:
> Make sh clock framework core depend on HAVE_MACH_CLKDEV, and
> set it
> - y on sh for backward compatibility
> - !CONFIG_COMMON_CLK on sh-mobile
> This is a preparation for migration to common clock framework
> from sh clock framework on sh-mobile.

While I agree with this patch, I believe the use of the HAVE_MACH_CLKDEV 
configuration option to select whether to compile core.o in is a bit of an 
abuse. I would have created a new configuration option (SH_CLK_CORE in 
drivers/sh/Kconfig for instance) as 'def_bool y' that depends on SH || (ARM && 
!COMMON_CLK).

However, as all ARCH_SHMOBILE platforms should be converted to the common 
clock framework, this is only temporary and could be revisited later, so I'm 
fine with keeping the patch as-is.

> Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
> ---
>  arch/arm/Kconfig        | 2 +-
>  arch/sh/Kconfig         | 1 +
>  drivers/sh/clk/Makefile | 3 +--
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 3f7714d..53044ca 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -650,7 +650,7 @@ config ARCH_SHMOBILE
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select HAVE_CLK
> -	select HAVE_MACH_CLKDEV
> +	select HAVE_MACH_CLKDEV if !COMMON_CLK
>  	select HAVE_SMP
>  	select MIGHT_HAVE_CACHE_L2X0
>  	select MULTI_IRQ_HANDLER
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 224f4bc..f57e47f 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -41,6 +41,7 @@ config SUPERH
>  	select MODULES_USE_ELF_RELA
>  	select OLD_SIGSUSPEND
>  	select OLD_SIGACTION
> +	select HAVE_MACH_CLKDEV
>  	help
>  	  The SuperH is a RISC processor targeted for use in embedded systems
>  	  and consumer electronics; it was also used in the Sega Dreamcast
> diff --git a/drivers/sh/clk/Makefile b/drivers/sh/clk/Makefile
> index 5d15ebf..e73b031 100644
> --- a/drivers/sh/clk/Makefile
> +++ b/drivers/sh/clk/Makefile
> @@ -1,3 +1,2 @@
> -obj-y	:= core.o
> -
> +obj-$(CONFIG_HAVE_MACH_CLKDEV)	+= core.o
>  obj-$(CONFIG_SH_CLK_CPG)	+= cpg.o
Magnus Damm Oct. 1, 2013, 9:30 a.m. UTC | #2
On Tue, Sep 24, 2013 at 1:12 PM,  <takasi-y@ops.dti.ne.jp> wrote:
> Make sh clock framework core depend on HAVE_MACH_CLKDEV, and
> set it
> - y on sh for backward compatibility
> - !CONFIG_COMMON_CLK on sh-mobile
> This is a preparation for migration to common clock framework
> from sh clock framework on sh-mobile.
>
> Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
> ---
>  arch/arm/Kconfig        | 2 +-
>  arch/sh/Kconfig         | 1 +
>  drivers/sh/clk/Makefile | 3 +--
>  3 files changed, 3 insertions(+), 3 deletions(-)

Hi Yoshii-san,

Thanks for your patch. I'm sure there is a reason behind this, but I'm
trying to understand why you need this modification. It looks to me
like you're trying to enable COMMON_CLK on ARCH_SHMOBILE but in my
mind it is enough to only enable COMMON_CLK in the case of
ARCH_SHMOBILE_MULTI.

During my test using ARCH_SHMOBILE_MULTI on KZM9D I omitted this patch
and only used patch 1, 2, 4, 5, and a modified 6 from your series.
This worked just fine, but I may be missing something.

Let me know if you really want to keep this patch or not. If it's not
needed for MULTIPLATFORM then I suggest that we just drop it.

Cheers,

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
takasi-y@ops.dti.ne.jp Oct. 4, 2013, 5:25 a.m. UTC | #3
Hi Laurent,

> While I agree with this patch, I believe the use of the HAVE_MACH_CLKDEV 
> configuration option to select whether to compile core.o in is a bit of an 
> abuse. <snip>
Well, yes, indeed. It does not mean having include/mach/clkdev.h,
but means somewhat such like !COMMON_CLK.
# I think there is similar usage in arch/mips, though they define but not use.
# ... is an execution.

> However, as all ARCH_SHMOBILE platforms should be converted to the common 
> clock framework, this is only temporary and could be revisited later, so I'm 
> fine with keeping the patch as-is.
Sure.

Thank you for your review.
/yoshii
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3f7714d..53044ca 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -650,7 +650,7 @@  config ARCH_SHMOBILE
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select HAVE_CLK
-	select HAVE_MACH_CLKDEV
+	select HAVE_MACH_CLKDEV if !COMMON_CLK
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
 	select MULTI_IRQ_HANDLER
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 224f4bc..f57e47f 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -41,6 +41,7 @@  config SUPERH
 	select MODULES_USE_ELF_RELA
 	select OLD_SIGSUSPEND
 	select OLD_SIGACTION
+	select HAVE_MACH_CLKDEV
 	help
 	  The SuperH is a RISC processor targeted for use in embedded systems
 	  and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/drivers/sh/clk/Makefile b/drivers/sh/clk/Makefile
index 5d15ebf..e73b031 100644
--- a/drivers/sh/clk/Makefile
+++ b/drivers/sh/clk/Makefile
@@ -1,3 +1,2 @@ 
-obj-y	:= core.o
-
+obj-$(CONFIG_HAVE_MACH_CLKDEV)	+= core.o
 obj-$(CONFIG_SH_CLK_CPG)	+= cpg.o