nvhost: Set gr2d clocks to minimum and set timeout=0
Mandar Potdar [Thu, 7 Jul 2011 09:38:32 +0000 (14:38 +0530)]
Set gr2d and related clocks (epp, emc) to minimum.
Set Timeout for 2D only to 0.

bug: 845598
bug: 843716

Original-Change-Id: I1367274469ef290a08c3fb1f348664b3a38fecd7
Reviewed-on: http://git-master/r/39992
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R5436a0af9c1ef813d06e4201e18d853488fb85ef

drivers/video/tegra/host/nvhost_acm.c

index 1df7dbc..6bc5f71 100644 (file)
@@ -145,17 +145,18 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name,
                mod->clk[i] = clk_get(dev, get_module_clk_id(name, i));
                if (IS_ERR_OR_NULL(mod->clk[i]))
                        break;
-               rate = clk_round_rate(mod->clk[i], UINT_MAX);
+               if (strcmp(name, "gr2d") == 0)
+                       rate = clk_round_rate(mod->clk[i], 0);
+               else
+                       rate = clk_round_rate(mod->clk[i], UINT_MAX);
                if (rate < 0) {
                        pr_err("%s: can't get maximum rate for %s\n",
                                __func__, name);
                        break;
                }
-               if (rate != clk_get_rate(mod->clk[i])) {
-                       clk_enable(mod->clk[i]);
-                       clk_set_rate(mod->clk[i], rate);
-                       clk_disable(mod->clk[i]);
-               }
+               clk_enable(mod->clk[i]);
+               clk_set_rate(mod->clk[i], rate);
+               clk_disable(mod->clk[i]);
                i++;
        }
 
@@ -165,7 +166,10 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name,
        mod->powered = false;
        mod->powergate_id = -1;
        mod->powergate_id2 = -1;
-       mod->powerdown_delay = ACM_POWERDOWN_HANDLER_DELAY_MSEC;
+       if (strcmp(name, "gr2d") == 0)
+               mod->powerdown_delay = 0;
+       else
+               mod->powerdown_delay = ACM_POWERDOWN_HANDLER_DELAY_MSEC;
 
        if (strcmp(name, "gr3d") == 0) {
                mod->powergate_id = TEGRA_POWERGATE_3D;