}
#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);
* 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;
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
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",
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);