summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2011-07-25 15:50:18 -0700
committerRyan Wong <ryanw@nvidia.com>2011-07-28 17:42:26 -0700
commita8fe6e4b9dfa086ba29fba85494ae56c8a8e3af9 (patch)
tree7096cf86f314697cdc19164dfa48d96035b91411 /arch
parent22b42d293d271638292c2cbc3da2b5ce5aef1d37 (diff)
arm: tegra: enterprise: EDP support DO NOT MERGE
Added EDP support for Enterprise board via ext temp sensor nct1008 Bug 824621 Change-Id: Ia3158e9300ac9cd528f25bcfc2dafd15ee90b6da Reviewed-on: http://git-master/r/43749 Tested-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Ryan Wong <ryanw@nvidia.com>
Diffstat (limited to 'arch')
-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 7e00dbbf0031..5d42788df2af 100644
--- a/arch/arm/mach-tegra/board-enterprise-power.c
+++ b/arch/arm/mach-tegra/board-enterprise-power.c
@@ -27,6 +27,7 @@
#include <linux/regulator/tps80031-regulator.h>
#include <linux/gpio.h>
#include <mach/suspend.h>
+#include <mach/edp.h>
#include <linux/io.h>
#include <mach/iomap.h>
@@ -441,3 +442,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 1203322cebd9..c5fdc06010c4 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -851,6 +851,9 @@ static void __init tegra_enterprise_init(void)
enterprise_sdhci_init();
touch_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 c2154252b09e..f1ed5143b2a0 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 */
#define TOUCH_GPIO_IRQ_ATMEL_T9 TEGRA_GPIO_PH6
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, 0x32, 0x5a, 0x8c, 0x82,
+ 0x82, 0x6e, 0x02, 0x28, 0x2d, 0x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