summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/clock.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2013-11-15 23:16:06 -0800
committerYu-Huan Hsu <yhsu@nvidia.com>2013-11-19 19:49:58 -0800
commit4d194fc765cf6dbc96bc261880b7aaadd0e56d98 (patch)
treebcad46e100dc6da90a445b94c46bebc4cff80688 /arch/arm/mach-tegra/clock.c
parent9fa1be6e12d82bcc72c44d03c52ae7c6c8078798 (diff)
ARM: tegra: dvfs: Support persistent alt frequencies
Existing interface to dvfs alternative frequencies combined enable control with alternative ladder installation. Hence, the only way to switch back to primary frequencies was to de-install alternative ones. This commit provided separate install and enable interfaces, so that alternative ladder can be installed once, and then enabled/disabled under client control. Also made sure alternative voltage-frequency mapping results in lower voltage at the same frequency (this was an implicit assumption of alternative frequencies support - now it is enforced explicitly). Bug 1397158 Change-Id: I4663602d1882f72156e02590f41ff04e7e69fbf8 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/333090 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/clock.c')
-rw-r--r--arch/arm/mach-tegra/clock.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 2678315877f5..ca18a8c65e5a 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -1694,6 +1694,20 @@ static const struct file_operations possible_rates_fops = {
.release = single_release,
};
+static int use_alt_freq_get(void *data, u64 *val)
+{
+ struct clk *c = (struct clk *)data;
+ *val = c->dvfs->use_alt_freqs;
+ return 0;
+}
+static int use_alt_freq_set(void *data, u64 val)
+{
+ struct clk *c = (struct clk *)data;
+ return tegra_dvfs_use_alt_freqs_on_clk(c, val);
+}
+DEFINE_SIMPLE_ATTRIBUTE(use_alt_freq_fops,
+ use_alt_freq_get, use_alt_freq_set, "%llu\n");
+
static int clk_debugfs_register_one(struct clk *c)
{
struct dentry *d;
@@ -1762,6 +1776,13 @@ static int clk_debugfs_register_one(struct clk *c)
goto err_out;
}
+ if (c->dvfs) {
+ d = debugfs_create_file("use_alt_freq", S_IRUGO | S_IWUSR,
+ c->dent, c, &use_alt_freq_fops);
+ if (!d)
+ goto err_out;
+ }
+
return 0;
err_out: