Commit 45e12086263a53f16b489fc7f4f8f6348a688661

Authored by Bartlomiej Zolnierkiewicz
Committed by Viresh Kumar
1 parent c721d15a5c

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

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Showing 3 changed files with 45 additions and 13 deletions Side-by-side Diff

drivers/cpufreq/Kconfig.arm
... ... @@ -17,43 +17,55 @@
17 17 big.LITTLE platform. This gets frequency tables from DT.
18 18  
19 19 config ARM_EXYNOS_CPUFREQ
20   - bool "SAMSUNG EXYNOS SoCs"
21   - depends on ARCH_EXYNOS
  20 + bool
22 21 select CPU_FREQ_TABLE
23   - default y
24   - help
25   - This adds the CPUFreq driver common part for Samsung
26   - EXYNOS SoCs.
27 22  
28   - If in doubt, say N.
29   -
30 23 config ARM_EXYNOS4210_CPUFREQ
31   - def_bool CPU_EXYNOS4210
  24 + bool "SAMSUNG EXYNOS4210"
  25 + depends on CPU_EXYNOS4210
  26 + default y
  27 + select ARM_EXYNOS_CPUFREQ
32 28 help
33 29 This adds the CPUFreq driver for Samsung EXYNOS4210
34 30 SoC (S5PV310 or S5PC210).
35 31  
  32 + If in doubt, say N.
  33 +
36 34 config ARM_EXYNOS4X12_CPUFREQ
37   - def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412)
  35 + bool "SAMSUNG EXYNOS4x12"
  36 + depends on (SOC_EXYNOS4212 || SOC_EXYNOS4412)
  37 + default y
  38 + select ARM_EXYNOS_CPUFREQ
38 39 help
39 40 This adds the CPUFreq driver for Samsung EXYNOS4X12
40 41 SoC (EXYNOS4212 or EXYNOS4412).
41 42  
  43 + If in doubt, say N.
  44 +
42 45 config ARM_EXYNOS5250_CPUFREQ
43   - def_bool SOC_EXYNOS5250
  46 + bool "SAMSUNG EXYNOS5250"
  47 + depends on SOC_EXYNOS5250
  48 + default y
  49 + select ARM_EXYNOS_CPUFREQ
44 50 help
45 51 This adds the CPUFreq driver for Samsung EXYNOS5250
46 52 SoC.
47 53  
  54 + If in doubt, say N.
  55 +
48 56 config ARM_EXYNOS5440_CPUFREQ
49   - def_bool SOC_EXYNOS5440
  57 + bool "SAMSUNG EXYNOS5440"
  58 + depends on SOC_EXYNOS5440
50 59 depends on HAVE_CLK && PM_OPP && OF
  60 + default y
51 61 select CPU_FREQ_TABLE
52 62 help
53 63 This adds the CPUFreq driver for Samsung EXYNOS5440
54 64 SoC. The nature of exynos5440 clock controller is
55 65 different than previous exynos controllers so not using
56 66 the common exynos framework.
  67 +
  68 + If in doubt, say N.
57 69  
58 70 config ARM_HIGHBANK_CPUFREQ
59 71 tristate "Calxeda Highbank-based"
drivers/cpufreq/exynos-cpufreq.c
... ... @@ -332,7 +332,6 @@
332 332 regulator_put(arm_regulator);
333 333 err_vdd_arm:
334 334 kfree(exynos_info);
335   - pr_debug("%s: failed initialization\n", __func__);
336 335 return -EINVAL;
337 336 }
338 337 late_initcall(exynos_cpufreq_init);
drivers/cpufreq/exynos-cpufreq.h
... ... @@ -43,7 +43,28 @@
43 43 bool (*need_apll_change)(unsigned int, unsigned int);
44 44 };
45 45  
  46 +#ifdef CONFIG_ARM_EXYNOS4210_CPUFREQ
46 47 extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *);
  48 +#else
  49 +static inline int exynos4210_cpufreq_init(struct exynos_dvfs_info *info)
  50 +{
  51 + return -EOPNOTSUPP;
  52 +}
  53 +#endif
  54 +#ifdef CONFIG_ARM_EXYNOS4X12_CPUFREQ
47 55 extern int exynos4x12_cpufreq_init(struct exynos_dvfs_info *);
  56 +#else
  57 +static inline int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
  58 +{
  59 + return -EOPNOTSUPP;
  60 +}
  61 +#endif
  62 +#ifdef CONFIG_ARM_EXYNOS5250_CPUFREQ
48 63 extern int exynos5250_cpufreq_init(struct exynos_dvfs_info *);
  64 +#else
  65 +static inline int exynos5250_cpufreq_init(struct exynos_dvfs_info *info)
  66 +{
  67 + return -EOPNOTSUPP;
  68 +}
  69 +#endif