]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
tegra12: clock: For dfll boot set vsel as volatile
authorsreenivasulu velpula <svelpula@nvidia.com>
Tue, 10 Mar 2015 08:10:09 +0000 (13:40 +0530)
committerDan Willemsen <dwillemsen@nvidia.com>
Sun, 5 Apr 2015 01:59:08 +0000 (18:59 -0700)
If kernel is booted with cpu clock source as dfll,
then set regulator vsel access mode as volatile.

Bug 200081010

Change-Id: Ifbd9c157815e4325232ce88eca0206e8e649e6ba
Signed-off-by: sreenivasulu velpula <svelpula@nvidia.com>
Reviewed-on: http://git-master/r/715658
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
drivers/platform/tegra/dvfs.c
drivers/platform/tegra/tegra12_clocks.c
include/linux/platform/tegra/dvfs.h

index e4f85cce61c23fd91c9cb96e542b6c509c68de20..ba3aa7c562bd91244410990b687fe8d1184ba72b 100644 (file)
@@ -2292,6 +2292,13 @@ int __init of_tegra_dvfs_rail_get_cdev_trips(
 }
 #endif
 
+int tegra_dvfs_rail_set_reg_volatile(struct dvfs_rail *rail, bool set)
+{
+       if (rail->reg)
+               return regulator_set_vsel_volatile(rail->reg, set);
+       return 0;
+}
+
 int tegra_dvfs_dfll_mode_set(struct dvfs *d, unsigned long rate)
 {
        mutex_lock(&dvfs_lock);
@@ -2303,18 +2310,9 @@ int tegra_dvfs_dfll_mode_set(struct dvfs *d, unsigned long rate)
                 * Report error, but continue: DFLL is functional, anyway, and
                 * no error with proper regulator driver update
                 */
-#ifndef CONFIG_TEGRA_DVFS_RAIL_CONNECT_ALL
-/*
- * When dvfs connection to regulator is not guaranteed,
- * virtualization environment Guest use case.
- */
-               if (d->dvfs_rail->reg)
-#endif
-                       if (regulator_set_vsel_volatile(d->dvfs_rail->reg,
-                                                       true))
-                               WARN_ONCE(1,
-                                       "%s: failed to set vsel volatile\n",
-                                       __func__);
+               if (tegra_dvfs_rail_set_reg_volatile(d->dvfs_rail, true))
+                       WARN_ONCE(1, "%s: failed to set vsel volatile\n",
+                                        __func__);
        }
        mutex_unlock(&dvfs_lock);
        return 0;
@@ -2337,14 +2335,8 @@ int tegra_dvfs_dfll_mode_clear(struct dvfs *d, unsigned long rate)
        mutex_lock(&dvfs_lock);
        if (d->dvfs_rail->dfll_mode) {
                d->dvfs_rail->dfll_mode = false;
-#ifndef CONFIG_TEGRA_DVFS_RAIL_CONNECT_ALL
-/*
- * When dvfs connection to regulator is not guaranteed,
- * virtualization environment Guest use case.
- */
-               if (d->dvfs_rail->reg)
-#endif
-                       regulator_set_vsel_volatile(d->dvfs_rail->reg, false);
+
+               tegra_dvfs_rail_set_reg_volatile(d->dvfs_rail, false);
 
                /*
                 * avoid false detection of matching target (voltage in
index e41ae2ee65d93f2224125a97b734aa330bb5febd..02ad8a8b46feb6e24a92db295cfa2aebc0f4d98a 100644 (file)
@@ -8987,6 +8987,8 @@ static void __init tegra12_dfll_cpu_late_init(struct clk *c)
                use_dfll = DFLL_RANGE_ALL_RATES;
                c->state = ON;
                tegra_dvfs_set_dfll_range(cpu->dvfs, use_dfll);
+               /* Set regulator acces mode as volatile */
+               tegra_dvfs_rail_set_reg_volatile(tegra_cpu_rail, true);
                if (!ret)
                        tegra_cl_dvfs_debug_init(c);
                pr_info("Tegra CPU DFLL from Boot loader with use_dfll = %d\n",
index 2190d54ad4b7eedc6cd7773739df0d9df9bd84a1..30759b0a59cf1051ea50fddde56a1dba8575147f 100644 (file)
@@ -365,6 +365,7 @@ bool tegra_dvfs_is_dfll_scale(struct dvfs *d, unsigned long rate);
 bool tegra_dvfs_is_dfll_range(struct dvfs *d, unsigned long rate);
 int tegra_dvfs_swap_dfll_range(struct dvfs *d, int range, int *old_range);
 int tegra_dvfs_set_dfll_range(struct dvfs *d, int range);
+int tegra_dvfs_rail_set_reg_volatile(struct dvfs_rail *rail, bool set);
 
 struct tegra_cooling_device *tegra_dvfs_get_cpu_vmax_cdev(void);
 struct tegra_cooling_device *tegra_dvfs_get_cpu_vmin_cdev(void);