Message ID | 20150128172209.GF29600@developer.hsd1.ca.comcast.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wednesday 28 January 2015 13:22:11 Eduardo Valentin wrote: > > > > config ARM_EXYNOS5440_CPUFREQ > > - bool "SAMSUNG EXYNOS5440" > > + tristate "SAMSUNG EXYNOS5440" > > depends on SOC_EXYNOS5440 > > depends on HAVE_CLK && OF > > + depends on THERMAL > > select PM_OPP > > default y > > help > > Reading the code briefly, looks like the intention is to separate soc > specific code into different files, but they all compose one single > driver. Translating into module, I believe it makes sense to build them > into a single module, instead of having all of them as separate module. > > Meaning, only ARM_EXYNOS_CPUFREQ becomes tristate, all the remaining > continues bool. And we add the following Makefile change to your patch That was my initial thought as well, but the devil is in the details: > diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm > index 0f9a2c3..c3c3cf5 100644 > --- a/drivers/cpufreq/Kconfig.arm > +++ b/drivers/cpufreq/Kconfig.arm > @@ -26,13 +26,19 @@ config ARM_VEXPRESS_SPC_CPUFREQ > > > config ARM_EXYNOS_CPUFREQ > - bool > + tristate "SAMSUNG EXYNOS CPUfreq Driver" > + depends on THERMAL > + default y > + help > + This adds the CPUFreq driver for Samsung EXYNOS platforms > + > + If in doubt, say N. Now the option shows up on all systems that include Kconfig.arm, in particular non-exynos machines that might not even be able to build this. It's also enabled by default, but if you change the default to 'n', the entire drivers will be disabled for users with an existing configuration file. We could work around these issues by adding extra (silent) Kconfig symbols that automatically do the right thing, but that would not be any less ugly than my first patch. Another possible might be to change the drivers to use the normal probe ordering and move the module_platform_driver() statement into the individual drivers, so that e.g. exynos4210_cpufreq_init() gets turned into exynos4210_cpufreq_probe() and calls the generic exynos_cpufreq_probe() function. This would let us express the dependencies more naturally and just export one symbol from the main module. Arnd
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 0f9a2c3..c3c3cf5 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -26,13 +26,19 @@ config ARM_VEXPRESS_SPC_CPUFREQ config ARM_EXYNOS_CPUFREQ - bool + tristate "SAMSUNG EXYNOS CPUfreq Driver" + depends on THERMAL + default y + help + This adds the CPUFreq driver for Samsung EXYNOS platforms + + If in doubt, say N. config ARM_EXYNOS4210_CPUFREQ bool "SAMSUNG EXYNOS4210" depends on CPU_EXYNOS4210 + depends on ARM_EXYNOS_CPUFREQ default y - select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS4210 SoC (S5PV310 or S5PC210). @@ -42,8 +48,8 @@ config ARM_EXYNOS4210_CPUFREQ config ARM_EXYNOS4X12_CPUFREQ bool "SAMSUNG EXYNOS4x12" depends on SOC_EXYNOS4212 || SOC_EXYNOS4412 + depends on ARM_EXYNOS_CPUFREQ default y - select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS4X12 SoC (EXYNOS4212 or EXYNOS4412). @@ -54,7 +60,7 @@ config ARM_EXYNOS5250_CPUFREQ bool "SAMSUNG EXYNOS5250" depends on SOC_EXYNOS5250 default y - select ARM_EXYNOS_CPUFREQ + depends on ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS5250 SoC. diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index b3ca7b0..b26e2bf 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -51,10 +51,11 @@ obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o -obj-$(CONFIG_ARM_EXYNOS_CPUFREQ) += exynos-cpufreq.o -obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o -obj-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ) += exynos4x12-cpufreq.o -obj-$(CONFIG_ARM_EXYNOS5250_CPUFREQ) += exynos5250-cpufreq.o +obj-$(CONFIG_ARM_EXYNOS_CPUFREQ) += arm-exynos-cpufreq.o +arm-exynos-cpufreq-y := exynos-cpufreq.o +arm-exynos-cpufreq-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o +arm-exynos-cpufreq-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ) += exynos4x12-cpufreq.o +arm-exynos-cpufreq-$(CONFIG_ARM_EXYNOS5250_CPUFREQ) += exynos5250-cpufreq.o obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o