summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInderpal Singh <inderpal.singh@linaro.org>2012-02-07 11:29:30 +0530
committerTushar Behera <tushar.behera@linaro.org>2012-05-17 10:31:08 +0530
commit6befa1fba60528e346c0310caab4b5a012e3a8b4 (patch)
treed6827bfee66d5a604edf7d35864e2dca9d4e6d4d
parente24b75d7de62491feee4ac0e73769738f1363610 (diff)
downloadlinux-topics-6befa1fba60528e346c0310caab4b5a012e3a8b4.tar.gz
exynos: Show list of available frequencies
This patch enables 'scaling_available_frequencies' attribute showing list of available frequencies. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com> Signed-off-by: Dave Jones <davej@redhat.com> [inderpal.singh@linaro.org: Updated as per common cpufreq driver] Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
-rw-r--r--drivers/cpufreq/exynos-cpufreq.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 7ebd6b7bdd1..749be588c41 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -233,6 +233,8 @@ static struct notifier_block exynos_cpufreq_reboot_nb = {
static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
+ int ret;
+
policy->cur = policy->min = policy->max = exynos_getspeed(policy->cpu);
cpufreq_frequency_table_get_attr(exynos_info->freq_table, policy->cpu);
@@ -255,16 +257,35 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
cpumask_setall(policy->cpus);
}
- return cpufreq_frequency_table_cpuinfo(policy, exynos_info->freq_table);
+ ret = cpufreq_frequency_table_cpuinfo(policy, exynos_info->freq_table);
+ if (ret)
+ return ret;
+
+ cpufreq_frequency_table_get_attr(exynos_info->freq_table, policy->cpu);
+ return 0;
+
}
+static int exynos4_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+ cpufreq_frequency_table_put_attr(policy->cpu);
+ return 0;
+}
+
+static struct freq_attr *exynos4_cpufreq_attr[] = {
+ &cpufreq_freq_attr_scaling_available_freqs,
+ NULL,
+};
+
static struct cpufreq_driver exynos_driver = {
.flags = CPUFREQ_STICKY,
.verify = exynos_verify_speed,
.target = exynos_target,
.get = exynos_getspeed,
.init = exynos_cpufreq_cpu_init,
+ .exit = exynos4_cpufreq_cpu_exit,
.name = "exynos_cpufreq",
+ .attr = exynos4_cpufreq_attr,
#ifdef CONFIG_PM
.suspend = exynos_cpufreq_suspend,
.resume = exynos_cpufreq_resume,