ARM: tegra11: power: Use process id to select core edp table
Alex Frid [Wed, 5 Jun 2013 06:09:53 +0000 (23:09 -0700)]
Bug 1200217

Change-Id: Icb6ab1ac7d2fa5bd8fb63bafa337d1493488e6c0
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/236553
(cherry picked from commit a80843eca98c524ccc4d7a363389e7feafa2a009)
Reviewed-on: http://git-master/r/240855
(cherry picked from commit 2c35ae96df457922227df18da7baa0cbc9e414aa)
Reviewed-on: http://git-master/r/260231
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/tegra11_edp.c

index 76b804f..d3940a3 100644 (file)
@@ -37,6 +37,7 @@
 
 struct core_edp_entry {
        int sku;
+       int process_id;
        unsigned int cap_mA;
        int mult;
        unsigned long cap_scpu_on[CORE_EDP_PROFILES_NUM][
@@ -56,7 +57,8 @@ static struct clk *cap_clks[CAP_CLKS_NUM];
 
 static struct core_edp_entry core_edp_table[] = {
        {
-               .sku            = 0x3,          /* SKU = 4 - T40X */
+               .sku            = 0x3,          /* SKU = 3 - T40X */
+               .process_id     = -1,           /* any process id */
                .cap_mA         = 6000,         /* 6A cap */
                .mult           = 1000000,      /* MHZ */
                .cap_scpu_on    = {
@@ -244,10 +246,12 @@ struct tegra_edp_cpu_leakage_params *tegra11x_get_leakage_params(int index,
 static struct core_edp_entry *find_edp_entry(int sku, unsigned int regulator_mA)
 {
        int i;
+       int pid = tegra_core_process_id();
 
        for (i = 0; i < ARRAY_SIZE(core_edp_table); i++) {
                struct core_edp_entry *entry = &core_edp_table[i];
-               if ((entry->sku == sku) && (entry->cap_mA == regulator_mA))
+               if ((entry->sku == sku) && (entry->cap_mA == regulator_mA) &&
+                   ((entry->process_id == -1) || (entry->process_id == pid)))
                        return entry;
        }
        return NULL;