cpufreq: fix EXYNOS drivers selection
Subsystems (2)
PATCH 1/1 cpufreq: fix EXYNOS drivers selection
* remove superfluous pr_debug() call from exynos_cpufreq_init() (init errors are always logged anyway)
* add dummy per-SoC type init functions to exynos-cpufreq.h
* make per-SoC type cpufreq config options selectable
* make CONFIG_ARM_EXYNOS_CPUFREQ config option invisible to user and automatically enable it when needed
This patch fixes following issues:
* EXYNOS per-SoC type cpufreq support (i.e. exynos4210-cpufreq.c) being always built if given SoC support was enabled (i.e. CPU_EXYNOS4210), even if common EXYNOS cpufreq support was disabled
* inability to select cpufreq for each SoC type separately (it could be only enabled/disabled for all SoCs for which support was enabled)
* EXYNOS5440 cpufreq support was always enabled when EXYNOS5440 support was enabled and couldn't be disabled
--- drivers/cpufreq/Kconfig.arm | 36 ++++++++++++++++++++++++------------ drivers/cpufreq/exynos-cpufreq.c | 1 - drivers/cpufreq/exynos-cpufreq.h | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+), 13 deletions(-)
drivers/cpufreq/Kconfig.arm +24 -12
@@ -17,37 +17,47 @@ config ARM_DT_BL_CPUFREQ big.LITTLE platform. This gets frequency tables from DT. config ARM_EXYNOS_CPUFREQ - bool "SAMSUNG EXYNOS SoCs" - depends on ARCH_EXYNOS + bool select CPU_FREQ_TABLE - default y - help - This adds the CPUFreq driver common part for Samsung - EXYNOS SoCs. - - If in doubt, say N. config ARM_EXYNOS4210_CPUFREQ - def_bool CPU_EXYNOS4210 + bool "SAMSUNG EXYNOS4210" + depends on CPU_EXYNOS4210 + default y + select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS4210 SoC (S5PV310 or S5PC210). + If in doubt, say N. + config ARM_EXYNOS4X12_CPUFREQ - def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412) + bool "SAMSUNG EXYNOS4x12" + depends on (SOC_EXYNOS4212 || SOC_EXYNOS4412) + default y + select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS4X12 SoC (EXYNOS4212 or EXYNOS4412). + If in doubt, say N. + config ARM_EXYNOS5250_CPUFREQ - def_bool SOC_EXYNOS5250 + bool "SAMSUNG EXYNOS5250" + depends on SOC_EXYNOS5250 + default y + select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS5250 SoC. + If in doubt, say N. + config ARM_EXYNOS5440_CPUFREQ - def_bool SOC_EXYNOS5440 + bool "SAMSUNG EXYNOS5440" + depends on SOC_EXYNOS5440 depends on HAVE_CLK && PM_OPP && OF + default y select CPU_FREQ_TABLE help This adds the CPUFreq driver for Samsung EXYNOS5440
@@ -55,6 +65,8 @@ config ARM_EXYNOS5440_CPUFREQ different than previous exynos controllers so not using the common exynos framework. + If in doubt, say N. + config ARM_HIGHBANK_CPUFREQ tristate "Calxeda Highbank-based" depends on ARCH_HIGHBANK
drivers/cpufreq/exynos-cpufreq.c +0 -1
@@ -332,7 +332,6 @@ err_cpufreq:regulator_put (arm_regulator); err_vdd_arm:kfree (exynos_info); -pr_debug ("%s: failed initialization\n" , __func__);return -EINVAL ; }late_initcall (exynos_cpufreq_init);
drivers/cpufreq/exynos-cpufreq.h +21 -0
@@ -43,6 +43,27 @@ struct exynos_dvfs_info {bool (*need_apll_change)(unsigned int ,unsigned int ); }; +#ifdef CONFIG_ARM_EXYNOS4210_CPUFREQ extern int exynos4210_cpufreq_init (struct exynos_dvfs_info *); +#else +static inline int exynos4210_cpufreq_init (struct exynos_dvfs_info *info) +{ +return -EOPNOTSUPP ; +} +#endif +#ifdef CONFIG_ARM_EXYNOS4X12_CPUFREQ extern int exynos4x12_cpufreq_init (struct exynos_dvfs_info *); +#else +static inline int exynos4x12_cpufreq_init (struct exynos_dvfs_info *info) +{ +return -EOPNOTSUPP ; +} +#endif +#ifdef CONFIG_ARM_EXYNOS5250_CPUFREQ extern int exynos5250_cpufreq_init (struct exynos_dvfs_info *); +#else +static inline int exynos5250_cpufreq_init (struct exynos_dvfs_info *info) +{ +return -EOPNOTSUPP ; +} +#endif
Hi Bart,
Quoted 133 lines · On Friday 09 of August 2013 14:04:55 Bartlomiej Zolnierkiewicz wrote:
* remove superfluous
pr_debug()call fromexynos_cpufreq_init()(init errors are always logged anyway)
* add dummy per-SoC type init functions toexynos-cpufreq.h
* make per-SoC type cpufreq config options selectable
* makeCONFIG_ARM_EXYNOS_CPUFREQconfig option invisible to user and automatically enable it when neededThis patch fixes following issues:
* EXYNOS per-SoC type cpufreq support (i.e.exynos4210-cpufreq.c) being always built if given SoC support was enabled (i.e.CPU_EXYNOS4210), even if common EXYNOS cpufreq support was disabled
* inability to select cpufreq for each SoC type separately (it could be only enabled/disabled for all SoCs for which support was enabled)
* EXYNOS5440 cpufreq support was always enabled when EXYNOS5440 support was enabled and couldn't be disabledSigned-off-by Bartlomiej Zolnierkiewicz <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/cpufreq/Kconfig.arm | 36 ++++++++++++++++++++++++------------ drivers/cpufreq/exynos-cpufreq.c | 1 - drivers/cpufreq/exynos-cpufreq.h | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+), 13 deletions(-)Index: b/drivers/cpufreq/Kconfig.arm
===================================================================drivers/cpufreq/Kconfig.arm +24
-12@@ -17,37 +17,47 @@ config ARM_DT_BL_CPUFREQ big.LITTLE platform. This gets frequency tables from DT. config ARM_EXYNOS_CPUFREQ - bool "SAMSUNG EXYNOS SoCs" - depends on ARCH_EXYNOS + bool select CPU_FREQ_TABLE - default y - help - This adds the CPUFreq driver common part for Samsung - EXYNOS SoCs. - - If in doubt, say N. config ARM_EXYNOS4210_CPUFREQ - def_bool CPU_EXYNOS4210 + bool "SAMSUNG EXYNOS4210" + depends on CPU_EXYNOS4210 + default y + select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS4210 SoC (S5PV310 or S5PC210). + If in doubt, say N. + config ARM_EXYNOS4X12_CPUFREQ - def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412) + bool "SAMSUNG EXYNOS4x12" + depends on (SOC_EXYNOS4212 || SOC_EXYNOS4412) + default y + select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS4X12 SoC (EXYNOS4212 or EXYNOS4412). + If in doubt, say N. + config ARM_EXYNOS5250_CPUFREQ - def_bool SOC_EXYNOS5250 + bool "SAMSUNG EXYNOS5250" + depends on SOC_EXYNOS5250 + default y + select ARM_EXYNOS_CPUFREQ help This adds the CPUFreq driver for Samsung EXYNOS5250 SoC. + If in doubt, say N. + config ARM_EXYNOS5440_CPUFREQ - def_bool SOC_EXYNOS5440 + bool "SAMSUNG EXYNOS5440" + depends on SOC_EXYNOS5440 depends on HAVE_CLK && PM_OPP && OF + default y select CPU_FREQ_TABLE help This adds the CPUFreq driver for Samsung EXYNOS5440@@ -55,6 +65,8 @@ config ARM_EXYNOS5440_CPUFREQ different than previous exynos controllers so not using the common exynos framework. + If in doubt, say N. + config ARM_HIGHBANK_CPUFREQ tristate "Calxeda Highbank-based" depends on ARCH_HIGHBANKIndex:
b/drivers/cpufreq/exynos-cpufreq.c
===================================================================
---a/drivers/cpufreq/exynos-cpufreq.c2013-08-08 14:36:09.000000000
+0200 +++b/drivers/cpufreq/exynos-cpufreq.c2013-08-08
15:47:39.619423270 +0200 @@ -332,7 +332,6 @@err_cpufreq:drivers/cpufreq/Kconfig.arm +0
-1regulator_put(arm_regulator); err_vdd_arm: kfree(exynos_info); - pr_debug("%s: failed initialization\n", __func__); return -EINVAL; } late_initcall(exynos_cpufreq_init);Index:
b/drivers/cpufreq/exynos-cpufreq.h
===================================================================
---a/drivers/cpufreq/exynos-cpufreq.h2013-08-08 14:28:57.000000000
+0200 +++b/drivers/cpufreq/exynos-cpufreq.h2013-08-08
15:47:39.619423270 +0200 @@ -43,6 +43,27 @@ structexynos_dvfs_info{drivers/cpufreq/Kconfig.arm +12
-0bool (*need_apll_change)(unsigned int, unsigned int); }; +#ifdef CONFIG_ARM_EXYNOS4210_CPUFREQ extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *); +#else +static inline int exynos4210_cpufreq_init(struct exynos_dvfs_info *info) +{ + return -EOPNOTSUPP; +} +#endif +#ifdef CONFIG_ARM_EXYNOS4X12_CPUFREQ extern int exynos4x12_cpufreq_init(struct exynos_dvfs_info *); +#else +static inline int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) +{ + return -EOPNOTSUPP;
drivers/cpufreq/Kconfig.arm
Quoted 10 lines
drivers/cpufreq/Kconfig.arm +9
-0+} +#endif +#ifdef CONFIG_ARM_EXYNOS5250_CPUFREQ extern int exynos5250_cpufreq_init(struct exynos_dvfs_info *); +#else +static inline int exynos5250_cpufreq_init(struct exynos_dvfs_info *info) +{ + return -EOPNOTSUPP; +} +#endif
Finally someone cleaned this up. Thanks.
Best regards,
Tomasz
Quoted 26 lines · Tomasz Figa
Quoted 16 lines · On Friday 09 of August 2013 14:04:55 Bartlomiej Zolnierkiewicz wrote:
* remove superfluous
pr_debug()call fromexynos_cpufreq_init()(init errors are always logged anyway)
* add dummy per-SoC type init functions toexynos-cpufreq.h
* make per-SoC type cpufreq config options selectable
* makeCONFIG_ARM_EXYNOS_CPUFREQconfig option invisible to user and automatically enable it when neededThis patch fixes following issues:
* EXYNOS per-SoC type cpufreq support (i.e.exynos4210-cpufreq.c) being always built if given SoC support was enabled (i.e.CPU_EXYNOS4210), even if common EXYNOS cpufreq support was disabled
* inability to select cpufreq for each SoC type separately (it could be only enabled/disabled for all SoCs for which support was enabled)
* EXYNOS5440 cpufreq support was always enabled when EXYNOS5440 support was enabled and couldn't be disabledQuoted 8 lines
Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/cpufreq/Kconfig.arm | 36 ++++++++++++++++++++++++------------ drivers/cpufreq/exynos-cpufreq.c | 1 - drivers/cpufreq/exynos-cpufreq.h | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+), 13 deletions(-)
Quoted 1 line
Reviewed-by Tomasz Figa <[email protected]>
Applied. Thanks!!