summaryrefslogtreecommitdiff
path: root/drivers/edp
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2013-05-30 14:22:57 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:16:47 -0700
commitb9d8a18c7467ce6787c4229b4b61706465d4eee9 (patch)
tree7d4a78b20553ee0f44a4c10b2c2f2326a8d4c560 /drivers/edp
parent0da709ee9988435b4104898e94d65708404d4458 (diff)
EDP: tegra: rebase core client states on gain
The core client E-states are scaled down proportional to the gain factor. This will reduce the difference between an available budget and AP+DRAM EDP table entries. Bug 1266730 Change-Id: Ie68d3a71e320433b2096e3a5d40c8bb1185bae4f Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/234947 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r--drivers/edp/tegra_core.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/edp/tegra_core.c b/drivers/edp/tegra_core.c
index 33f8661d82fb..d8e99b0bf07f 100644
--- a/drivers/edp/tegra_core.c
+++ b/drivers/edp/tegra_core.c
@@ -400,6 +400,13 @@ static void register_loan(void)
WARN_ON(r);
}
+/* Power without gain */
+static unsigned int to_base_power(unsigned int power,
+ struct tegra_sysedp_platform_data *pdata)
+{
+ return (power * 100 + pdata->core_gain - 1) / pdata->core_gain;
+}
+
static unsigned int get_num_states(
struct tegra_sysedp_platform_data *pdata)
{
@@ -428,16 +435,19 @@ static void get_states(struct tegra_sysedp_platform_data *pdata,
if (pdata->corecap[i].power == power)
continue;
- power = pdata->corecap[i].power;
+ power = to_base_power(pdata->corecap[i].power, pdata);
states[num - e0i - 1] = power;
e0i++;
}
}
static unsigned int initial_req(struct edp_client *client,
- unsigned int watts)
+ struct tegra_sysedp_platform_data *pdata)
{
int i;
+ unsigned int watts;
+
+ watts = to_base_power(pdata->init_req_watts, pdata);
for (i = 0; i < client->num_states; i++) {
if (client->states[i] == watts)
@@ -478,7 +488,7 @@ static int init_client(struct tegra_sysedp_platform_data *pdata)
if (r)
goto fail;
- ei = initial_req(&core_client, pdata->init_req_watts);
+ ei = initial_req(&core_client, pdata);
r = edp_update_client_request(&core_client, ei, &core_state);
if (r)
return r;