arm: tegra: power: set more accurate temperature guardbands
[linux-2.6.git] / 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);