diff options
author | Per Fransson <per.xx.fransson@stericsson.com> | 2011-03-17 13:46:12 +0100 |
---|---|---|
committer | Henrik Aberg <henrik.aberg@stericsson.com> | 2011-05-18 09:39:52 +0200 |
commit | 3e16c0e54562236ee2de2bd7157ead187c7a90c0 (patch) | |
tree | d2e802a16f91b5a1a2cfcda487c67b25a60a24ac /arch/arm/mach-ux500/prcmu-debug.c | |
parent | 79fe8ff0c4e4f904aa8df3041262cd3584dce54a (diff) |
ARM: ux500: Make it possible to force DDR and APE OPP
Forces the OPPs to the values written, regardless of
the QoS requirements.
echo 25 > /debugfs/prcmu/ddr_opp
echo 50 > /debugfs/prcmu/ddr_opp
echo 100 > /debugfs/prcmu/ddr_opp
echo 50 > /debugfs/prcmu/ape_opp
echo 100 > /debugfs/prcmu/ape_opp
ST-Ericsson ID: CR 323730
Change-Id: I5fd18e254f3da5342a17cd207b0ee94da0a8cc28
Signed-off-by: Per Fransson <per.xx.fransson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18702
Reviewed-by: Martin PERSSON <martin.persson@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500/prcmu-debug.c')
-rw-r--r-- | arch/arm/mach-ux500/prcmu-debug.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/prcmu-debug.c b/arch/arm/mach-ux500/prcmu-debug.c index 942740b4a23..42892d59fb1 100644 --- a/arch/arm/mach-ux500/prcmu-debug.c +++ b/arch/arm/mach-ux500/prcmu-debug.c @@ -280,6 +280,44 @@ static int ddr_opp_read(struct seq_file *s, void *p) "unknown", opp); } +static ssize_t opp_write(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos, int prcmu_qos_class) +{ + char buf[32]; + ssize_t buf_size; + long unsigned int i; + + /* Get userspace string and assure termination */ + buf_size = min(count, (sizeof(buf)-1)); + if (copy_from_user(buf, user_buf, buf_size)) + return -EFAULT; + buf[buf_size] = 0; + + if (strict_strtoul(buf, 0, &i) != 0) + return buf_size; + + prcmu_qos_force_opp(prcmu_qos_class, i); + + pr_info("prcmu debug: forced OPP for %d to %d\n", prcmu_qos_class, i); + + return buf_size; +} + +static ssize_t ddr_opp_write(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + return opp_write(file, user_buf, count, ppos, PRCMU_QOS_DDR_OPP); +} + +static ssize_t ape_opp_write(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + return opp_write(file, user_buf, count, ppos, PRCMU_QOS_APE_OPP); +} + static int cpufreq_delay_read(struct seq_file *s, void *p) { return seq_printf(s, "%lu\n", prcmu_qos_get_cpufreq_opp_delay()); @@ -351,6 +389,7 @@ static const struct file_operations arm_opp_fops = { static const struct file_operations ape_opp_fops = { .open = ape_opp_open_file, + .write = ape_opp_write, .read = seq_read, .llseek = seq_lseek, .release = single_release, @@ -359,6 +398,7 @@ static const struct file_operations ape_opp_fops = { static const struct file_operations ddr_opp_fops = { .open = ddr_opp_open_file, + .write = ddr_opp_write, .read = seq_read, .llseek = seq_lseek, .release = single_release, |