summaryrefslogtreecommitdiff
path: root/drivers/edp
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2013-03-05 01:57:52 +0200
committerMandar Padmawar <mpadmawar@nvidia.com>2013-03-06 03:02:23 -0800
commitbb36790494c382ec26250f351c8cea76613f0f02 (patch)
tree742b5c6320775beb675ad3342472ae72be5f4f57 /drivers/edp
parentcf9a8fe7eaa00708939e7299b1a33236f43d783d (diff)
edp: tegra: adding gain factor debug knob
Added a gain factor debugfs node to scale the EDP budget that is allocated to the core client. Change-Id: Ic8cf6c50b66d8876b23845fcc76bdde3e4305518 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/206097 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r--drivers/edp/tegra_edp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/edp/tegra_edp.c b/drivers/edp/tegra_edp.c
index 5fe9083fef23..332eb74155d1 100644
--- a/drivers/edp/tegra_edp.c
+++ b/drivers/edp/tegra_edp.c
@@ -34,6 +34,7 @@ struct freqcap {
static unsigned int gpu_high_threshold = 500;
static unsigned int gpu_window = 2000;
+static unsigned int gain_factor = 100;
static unsigned int online_cpu_count;
static bool gpu_busy;
static unsigned int core_state;
@@ -175,7 +176,7 @@ static void update_cur_corecap(void)
if (!core_platdata)
return;
- power = core_edp_states[core_state];
+ power = core_edp_states[core_state] * gain_factor / 100;
i = core_platdata->corecap_size - 1;
cap = core_platdata->corecap + i;
@@ -279,8 +280,13 @@ static int core_set(void *data, u64 val)
old = *pdata;
*pdata = val;
- if (old != *pdata)
+
+ if (old != *pdata) {
+ if (pdata == &gain_factor)
+ update_cur_corecap();
do_cap_control();
+ }
+
return 0;
}
@@ -317,6 +323,7 @@ static __devinit void init_debug(void)
create_attr("force_gpu", core_client.dentry, &forced_caps.gpu);
create_attr("force_emc", core_client.dentry, &forced_caps.emc);
create_attr("gpu_window", core_client.dentry, &gpu_window);
+ create_attr("gain", core_client.dentry, &gain_factor);
}
#else
static inline void init_debug(void) {}