summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra11_soctherm.c
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2013-06-07 16:22:17 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:37:46 -0700
commit2a4774bad8b826ea51595c505adedbc8f551d356 (patch)
tree387cf1de77a5c17014a51c39317611fc2b967e4d /arch/arm/mach-tegra/tegra11_soctherm.c
parent93f34666d6e78d4120d1240f4b65ebcc900b9439 (diff)
arm: tegra: soctherm: Only error on improper FUSE_BASE
FUSE_CALIB values can be zero and should not trigger init error. Bug 1284859 Change-Id: I0a9b0dcaaf166adb2dba604e0ca5e430cfcecb1e Reviewed-on: http://git-master/r/239457 (cherry picked from commit fc2ba2a5d235b67109eeae32aee9edf445c55dda) Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/253743 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Anand Bhatia <anandb@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra11_soctherm.c')
-rw-r--r--arch/arm/mach-tegra/tegra11_soctherm.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/tegra11_soctherm.c b/arch/arm/mach-tegra/tegra11_soctherm.c
index a74711a19f13..cdaa245d9f04 100644
--- a/arch/arm/mach-tegra/tegra11_soctherm.c
+++ b/arch/arm/mach-tegra/tegra11_soctherm.c
@@ -1728,6 +1728,12 @@ static int soctherm_fuse_read_vsensor(void)
fuse_calib_base_cp = REG_GET(value, FUSE_BASE_CP);
fuse_calib_base_ft = REG_GET(value, FUSE_BASE_FT);
+ /* TSOSC base counts cannot be zero */
+ if (!fuse_calib_base_ft || !fuse_calib_base_cp) {
+ pr_err("soctherm: ERROR: Improper FUSE. SOC_THERM disabled\n");
+ return -EINVAL;
+ }
+
/* Extract bits and convert to signed 2's complement */
calib_cp = REG_GET(value, FUSE_SHIFT_CP);
calib_cp = MAKE_SIGNED32(calib_cp, FUSE_SHIFT_CP_BITS);
@@ -1749,10 +1755,6 @@ static int soctherm_fuse_read_vsensor(void)
actual_temp_cp = 2 * nominal_calib_cp + calib_cp;
actual_temp_ft = 2 * nominal_calib_ft + calib_ft;
- if (!actual_temp_ft || !actual_temp_cp) {
- pr_err("soctherm: ERROR: Improper FUSE. SOC_THERM disabled\n");
- return -EINVAL;
- }
return 0;
}
@@ -1814,11 +1816,6 @@ static int soctherm_fuse_read_tsensor(enum soctherm_sense sensor)
calib = MAKE_SIGNED32(calib, FUSE_TSENSOR_CALIB_BITS);
actual_tsensor_cp = (fuse_calib_base_cp * 64) + calib;
- if (!actual_tsensor_ft || !actual_tsensor_cp) {
- pr_err("soctherm: ERROR: Improper FUSE. SOC_THERM disabled\n");
- return -EINVAL;
- }
-
mult = plat_data.sensor_data[sensor].pdiv *
plat_data.sensor_data[sensor].tsamp_ATE;
div = plat_data.sensor_data[sensor].tsample *