summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2011-07-25 15:50:18 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:57 -0800
commitb62ccc375310a2f69aa8096930d28c24da5d7854 (patch)
treeaad0c40fda65e7b518d71b27caa3e63ae7e5687f /arch/arm/mach-tegra
parent61e83735bf1601a414daa38b67d4a4135c0203b2 (diff)
arm: tegra: enterprise: EDP support
Added EDP support for Enterprise board via ext temp sensor nct1008 Bug 824621 Original-Change-Id: I476b9ad2cb46620d4775e6ee6e102b45f2b4dc27 Reviewed-on: http://git-master/r/43144 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rd0a03e8e8786fc76dd57149d9df315d084072cae
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-enterprise-power.c10
-rw-r--r--arch/arm/mach-tegra/board-enterprise-sensors.c40
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c3
-rw-r--r--arch/arm/mach-tegra/board-enterprise.h1
-rw-r--r--arch/arm/mach-tegra/edp.c66
5 files changed, 84 insertions, 36 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-power.c b/arch/arm/mach-tegra/board-enterprise-power.c
index 4ab94ac48d11..52ef8fc822e6 100644
--- a/arch/arm/mach-tegra/board-enterprise-power.c
+++ b/arch/arm/mach-tegra/board-enterprise-power.c
@@ -28,6 +28,7 @@
#include <linux/gpio.h>
#include <linux/io.h>
+#include <mach/edp.h>
#include <mach/iomap.h>
#include <mach/irqs.h>
#include <mach/pinmux.h>
@@ -445,3 +446,12 @@ int __init enterprise_suspend_init(void)
tegra_init_suspend(&enterprise_suspend_data);
return 0;
}
+
+#ifdef CONFIG_TEGRA_EDP_LIMITS
+
+int __init enterprise_edp_init(void)
+{
+ tegra_init_cpu_edp_limits(2500); /* 2.5A regulator */
+ return 0;
+}
+#endif
diff --git a/arch/arm/mach-tegra/board-enterprise-sensors.c b/arch/arm/mach-tegra/board-enterprise-sensors.c
index 1c3950fd736e..78fce61d1cd1 100644
--- a/arch/arm/mach-tegra/board-enterprise-sensors.c
+++ b/arch/arm/mach-tegra/board-enterprise-sensors.c
@@ -28,6 +28,7 @@
#include <media/ar0832_main.h>
#include <media/tps61050.h>
#include <media/ov9726.h>
+#include <mach/edp.h>
#include "cpu-tegra.h"
#include "gpio-names.h"
#include "board-enterprise.h"
@@ -36,11 +37,15 @@ static struct nct1008_platform_data enterprise_nct1008_pdata = {
.supported_hwrev = true,
.ext_range = true,
.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,
- .throttling_ext_limit = 90,
+ .shutdown_ext_limit = 90,
+ .shutdown_local_limit = 90,
+ .throttling_ext_limit = 75,
.alarm_fn = tegra_throttling_enable,
};
@@ -55,6 +60,12 @@ static struct i2c_board_info enterprise_i2c4_nct1008_board_info[] = {
static void enterprise_nct1008_init(void)
{
int ret;
+#ifdef CONFIG_TEGRA_EDP_LIMITS
+ const struct tegra_edp_limits *z;
+ int zones_sz;
+ int i;
+ bool throttle_ok = false;
+#endif
tegra_gpio_enable(TEGRA_GPIO_PH7);
ret = gpio_request(TEGRA_GPIO_PH7, "temp_alert");
@@ -72,6 +83,27 @@ static void enterprise_nct1008_init(void)
i2c_register_board_info(4, enterprise_i2c4_nct1008_board_info,
ARRAY_SIZE(enterprise_i2c4_nct1008_board_info));
+#ifdef CONFIG_TEGRA_EDP_LIMITS
+ tegra_get_cpu_edp_limits(&z, &zones_sz);
+ zones_sz = min(zones_sz, MAX_ZONES);
+ for (i = 0; i < zones_sz; i++) {
+ enterprise_nct1008_pdata.thermal_zones[i] = z[i].temperature;
+ if (enterprise_nct1008_pdata.thermal_zones[i] ==
+ enterprise_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__, enterprise_nct1008_pdata.throttling_ext_limit);
+ else
+ pr_info("%s: Throttling limit %dC OK\n",
+ __func__, enterprise_nct1008_pdata.throttling_ext_limit);
+
+ enterprise_nct1008_pdata.thermal_zones_sz = zones_sz;
+#endif
}
#define SENSOR_MPU_NAME "mpu3050"
diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c
index 1b6171eeae1a..90677aef934a 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -481,6 +481,9 @@ static void __init tegra_enterprise_init(void)
enterprise_regulator_init();
enterprise_sdhci_init();
enterprise_usb_init();
+#ifdef CONFIG_TEGRA_EDP_LIMITS
+ enterprise_edp_init();
+#endif
/* enterprise_kbc_init(); */
enterprise_gps_init();
enterprise_baseband_init();
diff --git a/arch/arm/mach-tegra/board-enterprise.h b/arch/arm/mach-tegra/board-enterprise.h
index 334d0c98de01..6d82274b8f41 100644
--- a/arch/arm/mach-tegra/board-enterprise.h
+++ b/arch/arm/mach-tegra/board-enterprise.h
@@ -36,6 +36,7 @@ int enterprise_emc_init(void);
int enterprise_regulator_init(void);
int enterprise_modem_init(void);
int enterprise_suspend_init(void);
+int enterprise_edp_init(void);
/* Touchscreen GPIO addresses */
#ifdef CONFIG_TOUCHSCREEN_ATMEL_MT_T9
diff --git a/arch/arm/mach-tegra/edp.c b/arch/arm/mach-tegra/edp.c
index 9d935292841d..b86308ded50a 100644
--- a/arch/arm/mach-tegra/edp.c
+++ b/arch/arm/mach-tegra/edp.c
@@ -67,38 +67,40 @@ static char __initdata tegra_edp_map[] = {
0x78, 0x78, 0x69, 0x01, 0x1e, 0x3c, 0x8c, 0x78,
0x78, 0x64, 0x01, 0x1e, 0x4b, 0x8c, 0x78, 0x6e,
0x5a, 0x01, 0x1e, 0x5a, 0x8c, 0x78, 0x64, 0x5a,
- 0x01, 0x19, 0x2d, 0x8c, 0x78, 0x6e, 0x5a, 0x01,
- 0x19, 0x3c, 0x8c, 0x78, 0x69, 0x55, 0x01, 0x19,
- 0x4b, 0x8c, 0x78, 0x5f, 0x4b, 0x01, 0x19, 0x5a,
- 0x8c, 0x73, 0x5a, 0x3c, 0x02, 0x3d, 0x2d, 0x8c,
- 0x82, 0x82, 0x82, 0x02, 0x3d, 0x3c, 0x8c, 0x82,
- 0x82, 0x82, 0x02, 0x3d, 0x4b, 0x8c, 0x82, 0x82,
- 0x82, 0x02, 0x3d, 0x5a, 0x8c, 0x82, 0x82, 0x82,
- 0x02, 0x32, 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x02,
- 0x32, 0x3c, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32,
- 0x4b, 0x8c, 0x82, 0x82, 0x78, 0x02, 0x32, 0x5a,
- 0x8c, 0x82, 0x82, 0x6e, 0x02, 0x28, 0x2d, 0x8c,
- 0x82, 0x82, 0x78, 0x02, 0x28, 0x3c, 0x8c, 0x82,
- 0x82, 0x73, 0x02, 0x28, 0x4b, 0x8c, 0x82, 0x78,
- 0x6e, 0x02, 0x28, 0x5a, 0x8c, 0x82, 0x73, 0x5f,
- 0x02, 0x23, 0x2d, 0x8c, 0x82, 0x82, 0x6e, 0x02,
- 0x23, 0x3c, 0x8c, 0x82, 0x78, 0x69, 0x02, 0x23,
- 0x4b, 0x8c, 0x82, 0x73, 0x5f, 0x02, 0x23, 0x5a,
- 0x8c, 0x82, 0x69, 0x55, 0x03, 0x3d, 0x2d, 0x8c,
- 0x82, 0x82, 0x82, 0x03, 0x3d, 0x3c, 0x8c, 0x82,
- 0x82, 0x82, 0x03, 0x3d, 0x4b, 0x8c, 0x82, 0x82,
- 0x82, 0x03, 0x3d, 0x5a, 0x8c, 0x82, 0x82, 0x82,
- 0x03, 0x32, 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x03,
- 0x32, 0x3c, 0x8c, 0x82, 0x82, 0x82, 0x03, 0x32,
- 0x4b, 0x8c, 0x82, 0x82, 0x73, 0x03, 0x32, 0x5a,
- 0x8c, 0x82, 0x82, 0x6e, 0x03, 0x28, 0x2d, 0x8c,
- 0x82, 0x82, 0x78, 0x03, 0x28, 0x3c, 0x8c, 0x82,
- 0x82, 0x73, 0x03, 0x28, 0x4b, 0x8c, 0x82, 0x7d,
- 0x6e, 0x03, 0x28, 0x5a, 0x8c, 0x82, 0x73, 0x5f,
- 0x03, 0x23, 0x2d, 0x8c, 0x82, 0x82, 0x6e, 0x03,
- 0x23, 0x3c, 0x8c, 0x82, 0x78, 0x6e, 0x03, 0x23,
- 0x4b, 0x8c, 0x82, 0x78, 0x5f, 0x03, 0x23, 0x5a,
- 0x8c, 0x82, 0x6e, 0x5a,
+ 0x01, 0x19, 0x23, 0x82, 0x78, 0x70, 0x5c, 0x01,
+ 0x19, 0x32, 0x82, 0x78, 0x6c, 0x56, 0x01, 0x19,
+ 0x3c, 0x82, 0x78, 0x66, 0x52, 0x01, 0x19, 0x46,
+ 0x82, 0x78, 0x60, 0x4e, 0x01, 0x19, 0x50, 0x82,
+ 0x78, 0x5c, 0x4a, 0x01, 0x19, 0x5a, 0x82, 0x72,
+ 0x58, 0x40, 0x02, 0x3d, 0x2d, 0x8c, 0x82, 0x82,
+ 0x82, 0x02, 0x3d, 0x3c, 0x8c, 0x82, 0x82, 0x82,
+ 0x02, 0x3d, 0x4b, 0x8c, 0x82, 0x82, 0x82, 0x02,
+ 0x3d, 0x5a, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32,
+ 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32, 0x3c,
+ 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32, 0x4b, 0x8c,
+ 0x82, 0x82, 0x78, 0x02, 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