diff options
author | Diwakar Tundlam <dtundlam@nvidia.com> | 2013-06-17 17:38:42 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:37:47 -0700 |
commit | e3890b22c94746ecd21632b664c1b9753d1b9354 (patch) | |
tree | 27e27685dea692068282f1e8435f2e3dee63555d /drivers/edp | |
parent | 9bce85eda44cbadc58684c4001f44a6d341c7f4f (diff) |
edp: tegra: table show support for T40DC
Bug 1300607
Change-Id: Iafaab450fd88a41b6384256ad2c6aaf2ebb9f360
Reviewed-on: http://git-master/r/239500
(cherry picked from commit fb715d4a3cb28547c274c648ecd43c87b33a1ec2)
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/253745
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/edp')
-rw-r--r-- | drivers/edp/tegra_core.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/edp/tegra_core.c b/drivers/edp/tegra_core.c index 7c82328f24b9..cbde63f58837 100644 --- a/drivers/edp/tegra_core.c +++ b/drivers/edp/tegra_core.c @@ -367,15 +367,26 @@ static void create_attr(const char *name, unsigned int *data) WARN_ON(IS_ERR_OR_NULL(d)); } -static int cpucaps_show(struct seq_file *file, void *data) +static inline void edp_show_2core_cpucaps(struct seq_file *file) { - unsigned int i; - struct tegra_system_edp_entry *p; + int i; + struct tegra_system_edp_entry *p = core_platdata->cpufreq_lim; - if (core_platdata ? !core_platdata->cpufreq_lim : true) - return -ENODEV; + seq_printf(file, "%5s %10s %10s\n", + "Power", "1-core", "2-cores"); + + for (i = 0; i < core_platdata->cpufreq_lim_size; i++, p++) { + seq_printf(file, "%5d %10u %10u\n", + p->power_limit_100mW * 100, + p->freq_limits[0], + p->freq_limits[1]); + } +} - p = core_platdata->cpufreq_lim; +static inline void edp_show_4core_cpucaps(struct seq_file *file) +{ + int i; + struct tegra_system_edp_entry *p = core_platdata->cpufreq_lim; seq_printf(file, "%5s %10s %10s %10s %10s\n", "Power", "1-core", "2-cores", "3-cores", "4-cores"); @@ -388,6 +399,19 @@ static int cpucaps_show(struct seq_file *file, void *data) p->freq_limits[2], p->freq_limits[3]); } +} + +static int cpucaps_show(struct seq_file *file, void *data) +{ + unsigned int max_nr_cpus = num_possible_cpus(); + + if (core_platdata ? !core_platdata->cpufreq_lim : true) + return -ENODEV; + + if (max_nr_cpus == 2) + edp_show_2core_cpucaps(file); + else if (max_nr_cpus == 4) + edp_show_4core_cpucaps(file); return 0; } |