arm: tegra: power: set more accurate temperature guardbands
Diwakar Tundlam [Fri, 26 Aug 2011 00:51:44 +0000 (17:51 -0700)]
use fractional guardband accurately per chip sku
bug 844025

Original-Change-Id: I1137e39b5aa9babae740d2c9e438275183683756
Reviewed-on: http://git-master/r/49317
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

Rebase-Id: Rbcb326cee7961f7d4065ce17b208063cb15f0eba

arch/arm/mach-tegra/board-cardhu-sensors.c

index 3135b21..a3b2823 100644 (file)
@@ -537,11 +537,6 @@ static struct nct1008_platform_data cardhu_nct1008_pdata = {
        .supported_hwrev = true,
        .ext_range = true,
        .conv_rate = 0x08,
-/*
- * 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 = 90,
        .shutdown_local_limit = 90,
@@ -574,6 +569,7 @@ static int cardhu_nct1008_init(void)
 {
        int nct1008_port = -1;
        int ret;
+       struct nct1008_platform_data *pdata;
 #ifdef CONFIG_TEGRA_EDP_LIMITS
        const struct tegra_edp_limits *z;
        int zones_sz;
@@ -607,6 +603,17 @@ static int cardhu_nct1008_init(void)
                        tegra_gpio_enable(nct1008_port);
        }
 
+       /* Temperature guardband: bug 844025 */
+       if (board_info.board_id == BOARD_PM269) {
+               /* T30S DSC */
+               pdata = cardhu_i2c4_nct1008_board_info[0].platform_data;
+               pdata->offset = 41; /* 4 * 10.25C */
+       } else {
+               /* T30 MID */
+               pdata = cardhu_i2c4_nct1008_board_info[0].platform_data;
+               pdata->offset = 43; /* 4 * 10.75C */
+       }
+
 #ifdef CONFIG_TEGRA_EDP_LIMITS
        tegra_get_cpu_edp_limits(&z, &zones_sz);
        zones_sz = min(zones_sz, MAX_ZONES);