From fd54d96fcaed9c77f1d4fe7d3ba14f8ac4dcee3f Mon Sep 17 00:00:00 2001 From: Vishal Bhoj Date: Wed, 18 Apr 2012 21:29:58 -0400 Subject: cpufreq/arm-bl-cpufreq: Expose the frequency table to clients This patch registers the frequency table for each CPU so that the table and transition statistics are visible through sysfs, and to governor code. Since the frequency table is static and never deallocated while the driver is loaded, there is no call to cpufreq_frequency_table_put_ attr(). A .exit method which calls this function would be needed if the frequency table ever becomes dynamic. Signed-off-by: Vishal Bhoj Signed-off-by: Dave Martin --- drivers/cpufreq/arm-bl-cpufreq.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/cpufreq/arm-bl-cpufreq.c b/drivers/cpufreq/arm-bl-cpufreq.c index d65aad7e9fc..0d7d0fcd4e3 100644 --- a/drivers/cpufreq/arm-bl-cpufreq.c +++ b/drivers/cpufreq/arm-bl-cpufreq.c @@ -166,6 +166,11 @@ static int bl_cpufreq_init(struct cpufreq_policy *policy) err = cpufreq_frequency_table_cpuinfo(policy, bl_freqs); if (err) goto error; + /* + * Publish frequency table so that it is available to governors + * and sysfs: + */ + cpufreq_frequency_table_get_attr(bl_freqs, policy->cpu); cluster = get_current_cluster(cpu); per_cpu(cpu_cur_cluster, cpu) = cluster; @@ -211,6 +216,11 @@ static unsigned int bl_cpufreq_get(unsigned int cpu) return get_current_freq(cpu); } +static struct freq_attr *bl_cpufreq_attrs[] = { + &cpufreq_freq_attr_scaling_available_freqs, + NULL +}; + static struct cpufreq_driver __read_mostly bl_cpufreq_driver = { .owner = THIS_MODULE, .name = MODULE_NAME, @@ -219,6 +229,7 @@ static struct cpufreq_driver __read_mostly bl_cpufreq_driver = { .verify = bl_cpufreq_verify, .target = bl_cpufreq_target, .get = bl_cpufreq_get, + .attr = bl_cpufreq_attrs, /* what else? */ }; -- cgit v1.2.3