ARM: tegra: apply volt-temp constraints only if non-zero
Diwakar Tundlam [Tue, 23 Apr 2013 20:57:10 +0000 (13:57 -0700)]
volt-temp constraints are defined clearly for T114. Until defined for
T148, etc. they're not specified. Don't apply constraint if the field
values are not specified (and left uninitialized).

Bug 1270003
Bug 1270570

Change-Id: I1d273d9d9ec9985a3a94e489859714a708e4e5e8
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/222159
Reviewed-by: Automatic_Commit_Validation_User

arch/arm/mach-tegra/edp.c

index 2558e52..0dc8ae1 100644 (file)
@@ -380,6 +380,7 @@ static struct tegra_edp_cpu_leakage_params leakage_params[] = {
                          {   0,   -2416618,   11593,     62, },
                        },
                 },
+               /* .volt_temp_cap = { 70, 1240 }, - TODO for T148 */
        },
 };
 #else
@@ -527,8 +528,10 @@ static unsigned int edp_calculate_maxf(
                freq_KHz = freq_voltage_lut[f].freq / 1000;
                voltage_mV = freq_voltage_lut[f].voltage_mV;
 
-               /* Constrain Volt-Temp. Eg. at Tj >= 70C, no VDD_CPU > 1.24V */
-               if (temp_C >= params->volt_temp_cap.temperature &&
+               /* Constrain Volt-Temp */
+               if (params->volt_temp_cap.temperature &&
+                   temp_C > params->volt_temp_cap.temperature &&
+                   params->volt_temp_cap.voltage_limit_mV &&
                    voltage_mV > params->volt_temp_cap.voltage_limit_mV)
                        continue;