summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/exynos-cpufreq.c
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2014-07-18 16:16:04 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:00:07 +0900
commit000c6aff96581d8143232538473e971edc502936 (patch)
treeffcbdb067150f4cae86ef7144cc3fcec554297c4 /drivers/cpufreq/exynos-cpufreq.c
parentc1fa2e22c3439882477d96b699a53da01adcc12e (diff)
downloadlinux-3.10-000c6aff96581d8143232538473e971edc502936.tar.gz
linux-3.10-000c6aff96581d8143232538473e971edc502936.tar.bz2
linux-3.10-000c6aff96581d8143232538473e971edc502936.zip
arm: odroid: cpufreq: Support for frequency up to 1.7 GHz
Values used for supporting Odroid U3 frequencies were taken from Odroid repo: https://github.com/hardkernel/linux.git branch odroid-3.8.y config arch/arm/configs/odroidu_defconfig Three new frequencies have been added: 1.6, 1.704 and 1.8 GHz. It is important to note, that in the device tree cpufreq node one just needs to specify the list of supported frequencies at the freq_table attribute. Change-Id: I416a35b99da9c341f92648541c81238a51dc362f Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/cpufreq/exynos-cpufreq.c')
-rw-r--r--drivers/cpufreq/exynos-cpufreq.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 0bd56da3cdf..feda2e5fcdd 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -332,8 +332,8 @@ struct cpufreq_frequency_table *exynos_of_parse_freq_table(
{
struct device_node *node = info->dev->of_node;
struct cpufreq_frequency_table *ft, *ret = NULL;
+ int len, num, i = 0, k;
struct property *pp;
- int len, num, i = 0;
u32 *of_f_tab;
if (!node)
@@ -366,29 +366,29 @@ struct cpufreq_frequency_table *exynos_of_parse_freq_table(
}
/*
- * Here + 2 is required for CPUFREQ_ENTRY_INVALID and
- * CPUFREQ_TABLE_END
+ * Here + 1 is required for CPUFREQ_TABLE_END
*
* Number of those entries must correspond to the apll_freq_4412 table
*/
- ft = kzalloc(sizeof(struct cpufreq_frequency_table) * (num + 2),
- GFP_KERNEL);
+ ft = kzalloc(sizeof(struct cpufreq_frequency_table) *
+ (info->freq_levels + 1), GFP_KERNEL);
if (!ft) {
pr_err("%s: Allocation failed\n", __func__);
goto err_of_f_tab;
}
- ft[0].index = L0;
- ft[0].frequency = CPUFREQ_ENTRY_INVALID;
+ i = info->freq_levels;
+ ft[i].index = 0;
+ ft[i].frequency = CPUFREQ_TABLE_END;
- for (i = 1; i <= num; i++) {
+ for (i--, k = num - 1; i >= 0; i--, k--) {
ft[i].index = i;
- ft[i].frequency = of_f_tab[i-1];
+ if (k < 0)
+ ft[i].frequency = CPUFREQ_ENTRY_INVALID;
+ else
+ ft[i].frequency = of_f_tab[k];
}
- ft[i].index = 0;
- ft[i].frequency = CPUFREQ_TABLE_END;
-
ret = ft;
err_of_f_tab: