summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/dvfs.c9
-rw-r--r--arch/arm/mach-tegra/dvfs.h1
-rw-r--r--arch/arm/mach-tegra/tegra3_dvfs.c8
3 files changed, 15 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/dvfs.c b/arch/arm/mach-tegra/dvfs.c
index dc0d779870a6..2276c8befbe5 100644
--- a/arch/arm/mach-tegra/dvfs.c
+++ b/arch/arm/mach-tegra/dvfs.c
@@ -98,6 +98,7 @@ static int dvfs_rail_set_voltage(struct dvfs_rail *rail, int millivolts)
int step = (millivolts > rail->millivolts) ? rail->step : -rail->step;
int i;
int steps;
+ bool jmp_to_zero;
if (!rail->reg) {
if (millivolts == rail->millivolts)
@@ -110,10 +111,14 @@ static int dvfs_rail_set_voltage(struct dvfs_rail *rail, int millivolts)
return 0;
rail->resolving_to = true;
- steps = DIV_ROUND_UP(abs(millivolts - rail->millivolts), rail->step);
+ jmp_to_zero = rail->jmp_to_zero &&
+ ((millivolts == 0) || (rail->millivolts == 0));
+ steps = jmp_to_zero ? 1 :
+ DIV_ROUND_UP(abs(millivolts - rail->millivolts), rail->step);
for (i = 0; i < steps; i++) {
- if (abs(millivolts - rail->millivolts) > rail->step)
+ if (!jmp_to_zero &&
+ (abs(millivolts - rail->millivolts) > rail->step))
rail->new_millivolts = rail->millivolts + step;
else
rail->new_millivolts = millivolts;
diff --git a/arch/arm/mach-tegra/dvfs.h b/arch/arm/mach-tegra/dvfs.h
index d867ac4299cf..60f8d51c6f1a 100644
--- a/arch/arm/mach-tegra/dvfs.h
+++ b/arch/arm/mach-tegra/dvfs.h
@@ -49,6 +49,7 @@ struct dvfs_rail {
int max_millivolts;
int nominal_millivolts;
int step;
+ bool jmp_to_zero;
bool disabled;
bool updating;
bool resolving_to;
diff --git a/arch/arm/mach-tegra/tegra3_dvfs.c b/arch/arm/mach-tegra/tegra3_dvfs.c
index 1acc76a3eda3..2f1e28815dcb 100644
--- a/arch/arm/mach-tegra/tegra3_dvfs.c
+++ b/arch/arm/mach-tegra/tegra3_dvfs.c
@@ -60,6 +60,7 @@ static struct dvfs_rail tegra3_dvfs_rail_vdd_cpu = {
.max_millivolts = 1250,
.min_millivolts = 850,
.step = VDD_SAFE_STEP,
+ .jmp_to_zero = true,
};
static struct dvfs_rail tegra3_dvfs_rail_vdd_core = {
@@ -102,7 +103,12 @@ static int tegra3_dvfs_rel_vdd_cpu_vdd_core(struct dvfs_rail *vdd_cpu,
static int tegra3_dvfs_rel_vdd_core_vdd_cpu(struct dvfs_rail *vdd_core,
struct dvfs_rail *vdd_cpu)
{
- int cpu_floor = max(vdd_core->new_millivolts, vdd_core->millivolts) -
+ int cpu_floor;
+
+ if (vdd_cpu->new_millivolts == 0)
+ return 0; /* If G CPU is off, core relations can be ignored */
+
+ cpu_floor = max(vdd_core->new_millivolts, vdd_core->millivolts) -
cpu_below_core;
return max(vdd_cpu->new_millivolts, cpu_floor);
}