]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - arch/arm/mach-tegra/tegra3_actmon.c
ARM: tegra: powermon: Fix copyrights from GPLv3 to GPLv2
[linux-3.10.git] / arch / arm / mach-tegra / tegra3_actmon.c
index d70d0ad6cff97d55f2af613b9b9e9180476492ad..e604f24f8e6cdfb9f6339bac6935e38d82c1c61e 100644 (file)
@@ -481,13 +481,14 @@ static int __init actmon_dev_init(struct actmon_dev *dev)
 
        dev->state = ACTMON_OFF;
        actmon_dev_enable(dev);
-       clk_enable(dev->clk);
+       tegra_clk_prepare_enable(dev->clk);
        return 0;
 }
 
 /* EMC activity monitor: frequency sampling device:
  * activity counter is incremented every 256 memory transactions, and
- * each transaction takes 2 EMC clocks; count_weight = 512.
+ * each transaction takes 2 EMC clocks; count_weight = 512 on Tegra3.
+ * On Tegra11 there is only 1 clock per transaction, hence weight = 256.
  */
 static struct actmon_dev actmon_dev_emc = {
        .reg    = 0x1c0,
@@ -501,13 +502,22 @@ static struct actmon_dev actmon_dev_emc = {
        .boost_freq_step        = 16000,
        .boost_up_coef          = 200,
        .boost_down_coef        = 50,
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
+       .boost_up_threshold     = 70,
+       .boost_down_threshold   = 50,
+#else
        .boost_up_threshold     = 60,
        .boost_down_threshold   = 40,
+#endif
 
        .up_wmark_window        = 1,
        .down_wmark_window      = 3,
        .avg_window_log2        = ACTMON_DEFAULT_AVG_WINDOW_LOG2,
+#if defined(CONFIG_ARCH_TEGRA_3x_SOC) || defined(CONFIG_ARCH_TEGRA_14x_SOC)
        .count_weight           = 0x200,
+#else
+       .count_weight           = 0x100,
+#endif
 
        .type                   = ACTMON_FREQ_SAMPLER,
        .state                  = ACTMON_UNINITIALIZED,
@@ -838,7 +848,7 @@ static int __init tegra_actmon_init(void)
                return 0;
        }
        actmon_clk_freq = clk_get_rate(c) / 1000;
-       ret = clk_enable(c);
+       ret = tegra_clk_prepare_enable(c);
        if (ret) {
                pr_err("%s: Failed to enable actmon clock\n", __func__);
                return 0;