aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2012-04-18 21:29:58 -0400
committerAndrey Konovalov <andrey.konovalov@linaro.org>2013-05-25 13:02:53 +0400
commitfd54d96fcaed9c77f1d4fe7d3ba14f8ac4dcee3f (patch)
tree030915574acfd1fd25431a9094c8bd301ba0d68d
parent123c922883b67f189d7893ff08c905fd5bc22ef9 (diff)
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 <vishal.bhoj@linaro.org> Signed-off-by: Dave Martin <dave.martin@linaro.org>
-rw-r--r--drivers/cpufreq/arm-bl-cpufreq.c11
1 files changed, 11 insertions, 0 deletions
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? */
};