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: R184cddb8dbb46433e2f8ae7f36bd58f0da6f8ec9

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

index a7013ec..c3ef960 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);
index 0d942d5..2874971 100644 (file)
@@ -50,11 +50,6 @@ static struct nct1008_platform_data enterprise_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,
@@ -73,6 +68,7 @@ static struct i2c_board_info enterprise_i2c4_nct1008_board_info[] = {
 static void enterprise_nct1008_init(void)
 {
        int ret;
+       struct nct1008_platform_data *pdata;
 #ifdef CONFIG_TEGRA_EDP_LIMITS
        const struct tegra_edp_limits *z;
        int zones_sz;
@@ -94,6 +90,10 @@ static void enterprise_nct1008_init(void)
                return;
        }
 
+       /* Temperature guardband AP30S DSC: bug 844025 */
+       pdata = enterprise_i2c4_nct1008_board_info[0].platform_data;
+       pdata->offset = 33; /* 4 * 8.25C */
+
        i2c_register_board_info(4, enterprise_i2c4_nct1008_board_info,
                                ARRAY_SIZE(enterprise_i2c4_nct1008_board_info));
 #ifdef CONFIG_TEGRA_EDP_LIMITS