ARM: tegra: nvrm: enable/disable avp.sclk on remote clock requests
authorDima Zavin <dima@android.com>
Thu, 28 Oct 2010 21:24:02 +0000 (14:24 -0700)
committerColin Cross <ccross@android.com>
Fri, 5 Nov 2010 01:29:24 +0000 (18:29 -0700)
Change-Id: Ib87fa7dd57b3742926f6d631de01ea99f57d0ce0
Signed-off-by: Dima Zavin <dima@android.com>
arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_power.c

index fd93eb66ea37331ae6d6a9078ada9020ee43d65e..b085ccf130e287b00d91ef1e27cff9d38a85ec89 100644 (file)
@@ -78,6 +78,10 @@ NvError NvRmPowerModuleClockControl(
     const char *bsea_names[] = { "bsea", NULL };
     const char *vde_names[] = { "vde", NULL };
     const char **names = NULL;
+    static struct clk *sclk = NULL;
+
+    if (!sclk)
+        sclk = clk_get_sys("tegra-avp", "sclk");
 
     if (is_vcp(ModuleId))
         names = vcp_names;
@@ -101,10 +105,15 @@ NvError NvRmPowerModuleClockControl(
             continue;
         }
 
-        if (Enable)
+        if (Enable) {
+            if (sclk)
+                clk_enable(sclk);
             clk_enable(clk);
-        else
+        } else {
+            if (sclk)
+                clk_disable(sclk);
             clk_disable(clk);
+        }
     }
 
     return NvSuccess;