ARM: tegra11: dvfs: Update switch between DFLL and PLL
[linux-3.10.git] / arch / arm / mach-tegra / dvfs.h
index 9ae8b32..1deb20b 100644 (file)
@@ -239,13 +239,21 @@ static inline bool tegra_dvfs_rail_is_dfll_mode(struct dvfs_rail *rail)
 {
        return rail ? rail->dfll_mode : false;
 }
+static inline bool tegra_dvfs_is_dfll_range_entry(struct dvfs *d,
+                                                 unsigned long rate)
+{
+       return  d->dvfs_rail && (!d->dvfs_rail->dfll_mode) &&
+               (d->dfll_data.range == DFLL_RANGE_HIGH_RATES) &&
+               (rate >= d->dfll_data.use_dfll_rate_min) &&
+               (d->cur_rate < d->dfll_data.use_dfll_rate_min);
+}
+
 static inline bool tegra_dvfs_is_dfll_scale(struct dvfs *d, unsigned long rate)
 {
-       return  d->dvfs_rail && (d->dvfs_rail->dfll_mode ||
-               ((d->dfll_data.range == DFLL_RANGE_HIGH_RATES) &&
-                (rate >= d->dfll_data.use_dfll_rate_min) &&
-                (d->cur_rate < d->dfll_data.use_dfll_rate_min)));
+       return tegra_dvfs_rail_is_dfll_mode(d->dvfs_rail) ||
+               tegra_dvfs_is_dfll_range_entry(d, rate);
 }
+
 static inline bool tegra_dvfs_is_dfll_range(struct dvfs *d, unsigned long rate)
 {
        return (d->dfll_data.range == DFLL_RANGE_ALL_RATES) ||