From f7608a5f206b42f1b598e6f0b1c9d03594688f98 Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Tue, 25 Oct 2011 23:36:26 -0700 Subject: ARM: tegra: dvfs: Optimize Tegra3 VDD_CPU control in LP mode Optimized Tegra3 VDD_CPU control when VDD_CPU target is set to zero, which could happen only while CPU is in LP mode (and CPU regulator output is turned off by side-band signal, anyway): - Ignore VDD_CPU dependency on VDD_CORE while VDD_CPU target is zero - Allow VDD_CPU one step change to zero (i.e., to minimum voltage set by constraints) after entry to LP mode - Allow VDD_CPU one step change to the predicted G mode target before exit from LP mode (cherry picked from commit 5826f3e28867207b5dad1c50795de8275d1af872) (cherry picked from commit 79c531421dfc65e27af657fd12b64c4187c67827) Change-Id: I3c469132034a431d2e9b8727d11d604c306122f1 Reviewed-on: http://git-master/r/63357 Reviewed-by: Varun Colbert Tested-by: Varun Colbert Rebase-Id: R4c4f6e79decddb778f58cb5eef853a4c9d52ca94 --- arch/arm/mach-tegra/tegra3_dvfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-tegra/tegra3_dvfs.c') 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); } -- cgit v1.2.3