aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2012-12-01 16:18:07 +0530
committerJon Medhurst <tixy@linaro.org>2013-04-29 09:43:15 +0100
commit23f4428dbdcac2fb064a1c4fdbb084fbaa584d0e (patch)
treef64c5d8a6de3937390706d47f3124b551e1cb20f /drivers
parentb16af23be497bb00d4233677e3affe76caed6a7c (diff)
misc: vexpress/spc: add support to get frequency table from spc
SPC controller driver has already populated frequency table from firmware and not its time to share it with other frameworks like: cpufreq. This patch provides interface to get freq table from spc driver. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/vexpress/arm-spc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/misc/vexpress/arm-spc.c b/drivers/misc/vexpress/arm-spc.c
index 5708bb35a10..913dd087282 100644
--- a/drivers/misc/vexpress/arm-spc.c
+++ b/drivers/misc/vexpress/arm-spc.c
@@ -117,6 +117,7 @@ struct vexpress_spc_drvdata {
struct semaphore lock;
struct completion done;
uint32_t freqs[MAX_CLUSTERS][MAX_OPPS];
+ int freqs_cnt[MAX_CLUSTERS];
};
static struct vexpress_spc_drvdata *info;
@@ -278,7 +279,7 @@ static int vexpress_spc_find_perf_index(int cluster, u32 freq)
{
int idx;
/* Hash function would be ideal, based on hashtable in v3.8?? */
- for (idx = 0; idx < MAX_OPPS; idx++)
+ for (idx = 0; idx < info->freqs_cnt[cluster]; idx++)
if (info->freqs[cluster][idx] == freq)
break;
return idx;
@@ -613,9 +614,18 @@ static int vexpress_spc_populate_opps(uint32_t cluster)
break;
}
+ info->freqs_cnt[cluster] = j;
return ret;
}
+unsigned int *vexpress_spc_get_freq_table(uint32_t cluster, int *count)
+{
+
+ *count = info->freqs_cnt[cluster];
+ return info->freqs[cluster];
+}
+EXPORT_SYMBOL_GPL(vexpress_spc_get_freq_table);
+
static int vexpress_spc_init(void)
{
struct device_node *node = of_find_compatible_node(NULL, NULL,