summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2014-07-17 16:50:55 +0200
committerSylwester Nawrocki <s.nawrocki@samsung.com>2014-07-22 02:18:01 -0700
commit23b75aca50083eb8f1c3b932f732a82a071285be (patch)
tree417c76161c5f32620fb8ff72a3fdb84dbbb2d322
parentc89a3a67fe6306233af800cc87640c61545a987e (diff)
downloadlinux-3.10-23b75aca50083eb8f1c3b932f732a82a071285be.tar.gz
linux-3.10-23b75aca50083eb8f1c3b932f732a82a071285be.tar.bz2
linux-3.10-23b75aca50083eb8f1c3b932f732a82a071285be.zip
cpufreq: BOOST: Adjust setting of BOOST frequency just before first valid freq
Before this change the BOOST frequency was always hardcoded to be the highest one. This worked for M0 and Proxima, but failed when support for odroid U3 has been added. Since odroid U3 supports three more freqs, higher than the boost for M0, it is necessary to adjust setting of boost frequency. Without that on M0 cpufreq sets frequencies reserved for odroid, which is dangerous. Change-Id: I70b19453d5853b6c0139f2c59c98dd5ad65da01e Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
-rw-r--r--drivers/cpufreq/exynos-cpufreq.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 0ecb7c918ce..0bd56da3cdf 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -293,7 +293,7 @@ int exynos_of_parse_boost(struct exynos_dvfs_info *info,
{
struct cpufreq_frequency_table *ft = info->freq_table;
struct device_node *node = info->dev->of_node;
- unsigned int boost_freq;
+ unsigned int boost_freq, i;
if (of_property_read_u32(node, property_name, &boost_freq)) {
pr_err("%s: Property: %s not found\n", __func__,
@@ -310,10 +310,19 @@ int exynos_of_parse_boost(struct exynos_dvfs_info *info,
* frequency table is required.
*/
- ft[0].index = CPUFREQ_BOOST_FREQ;
- ft[0].frequency = boost_freq;
+ for (i = 0; ft[i].frequency != CPUFREQ_TABLE_END; i++)
+ if (ft[i].frequency != CPUFREQ_ENTRY_INVALID)
+ break;
+
+ if (--i >= 0) {
+ ft[i].index = CPUFREQ_BOOST_FREQ;
+ ft[i].frequency = boost_freq;
+ } else {
+ pr_err("%s: BOOST index: %d out of range\n", __func__, i);
+ return -EINVAL;
+ }
- pr_debug("%s: BOOST frequency: %d\n", __func__, ft[0].frequency);
+ pr_debug("%s: BOOST frequency: %d\n", __func__, ft[i].frequency);
return 0;
}