summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-cardhu-sensors.c
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2011-07-12 00:51:11 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:34 -0800
commit1d143a601d8bafdf749b6fc34ea0b746de44e438 (patch)
treead6cf8953a7c1e3789ac51ce1c5be46a240fe40a /arch/arm/mach-tegra/board-cardhu-sensors.c
parent860a1ce24675bed1e9b3d588003c94f974493a76 (diff)
Arm: Tegra: Tsensor: Added guardbanding to temperatures
Bug 844025 - Guardband to account for hotspot offset and sensor accuracy. - Throttling point specified independent of EDP, but constrained to be one of the specified EDP points. Original-Change-Id: Ic9231ad6887ca282bb520ea23229526ac7a243be Reviewed-on: http://git-master/r/40566 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Rebase-Id: Rb582312d40da8f1cc753666bdef6068138358cd0
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-sensors.c')
-rw-r--r--arch/arm/mach-tegra/board-cardhu-sensors.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-sensors.c b/arch/arm/mach-tegra/board-cardhu-sensors.c
index 117064556570..ab673a86b97e 100644
--- a/arch/arm/mach-tegra/board-cardhu-sensors.c
+++ b/arch/arm/mach-tegra/board-cardhu-sensors.c
@@ -516,10 +516,14 @@ static struct nct1008_platform_data cardhu_nct1008_pdata = {
.supported_hwrev = true,
.ext_range = false,
.conv_rate = 0x08,
- .offset = 0,
+/*
+ * BugID 844025 requires 11C guardband (9.7C for hotspot offset + 1.5C
+ * for sensor accuracy). FIXME: Move sensor accuracy to sensor driver.
+ */
+ .offset = 11,
.hysteresis = 5,
- .shutdown_ext_limit = 75,
- .shutdown_local_limit = 75,
+ .shutdown_ext_limit = 90,
+ .shutdown_local_limit = 90,
.throttling_ext_limit = 90,
.alarm_fn = tegra_throttling_enable,
};
@@ -556,6 +560,7 @@ static int cardhu_nct1008_init(void)
struct tegra_edp_limits *z;
int zones_sz;
int i;
+ bool throttle_ok = false;
#endif
if ((board_info.board_id == BOARD_E1198) ||
@@ -585,8 +590,21 @@ static int cardhu_nct1008_init(void)
#ifdef CONFIG_TEGRA_EDP_LIMITS
cardhu_thermal_zones_info(&z, &zones_sz);
zones_sz = min(zones_sz, MAX_ZONES);
- for (i = 0; i < zones_sz; i++)
+ for (i = 0; i < zones_sz; i++) {
cardhu_nct1008_pdata.thermal_zones[i] = z[i].temperature;
+ if (cardhu_nct1008_pdata.thermal_zones[i] ==
+ cardhu_nct1008_pdata.throttling_ext_limit) {
+ throttle_ok = true;
+ }
+ }
+
+ if (throttle_ok != true)
+ pr_warn("%s: WARNING! Throttling limit %dC would be inaccurate"
+ " as it is NOT one of the EDP points\n",
+ __func__, cardhu_nct1008_pdata.throttling_ext_limit);
+ else
+ pr_info("%s: Throttling limit %dC OK\n",
+ __func__, cardhu_nct1008_pdata.throttling_ext_limit);
cardhu_nct1008_pdata.thermal_zones_sz = zones_sz;
#endif