summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-loki-sensors.c
diff options
context:
space:
mode:
authorYunfan Zhang <yunfanz@nvidia.com>2013-09-16 13:12:49 +0800
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-26 19:46:01 -0700
commit5fadee4a198e55072940f04780158944a8a7312d (patch)
tree26a6bede118622fc08e6e36c2ff4c5a0fc1935d4 /arch/arm/mach-tegra/board-loki-sensors.c
parent494711fd733335fefbf52bd0d6efc17cdd9d9271 (diff)
ARM: tegra: use soctherm on Loki
Check soctherm CP and FT fuse revision and if valid, switch from NCT72 to soctherm zones. Remove cooling device from NCT platform data and raise NCT's shutdown point by 20C to effectively deactivate it. With this change, thermal actions will use soctherm on properly fused chips and use NCT on improperly fused chips. Bug 1353528 Change-Id: Icd22eb9de59264efb1896dfe9d9ad5c13b062037 Signed-off-by: Yunfan Zhang <yunfanz@nvidia.com> Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/274941 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-loki-sensors.c')
-rw-r--r--arch/arm/mach-tegra/board-loki-sensors.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/board-loki-sensors.c b/arch/arm/mach-tegra/board-loki-sensors.c
index b8f467e4cf80..41c85b185b6c 100644
--- a/arch/arm/mach-tegra/board-loki-sensors.c
+++ b/arch/arm/mach-tegra/board-loki-sensors.c
@@ -28,6 +28,7 @@
#include <media/as364x.h>
#include <mach/gpio-tegra.h>
#include <mach/edp.h>
+#include <mach/tegra_fuse.h>
#include <linux/gpio.h>
#include <linux/therm_est.h>
#include <linux/iio/light/jsa1127.h>
@@ -509,7 +510,7 @@ static struct nct1008_platform_data loki_nct72_pdata = {
.passive_delay = 2000,
- .num_trips = 2,
+ .num_trips = 3,
.trips = {
/* Thermal Throttling */
[0] = {
@@ -551,14 +552,30 @@ static int loki_nct72_init(void)
{
int nct72_port = TEGRA_GPIO_PI6;
int ret = 0;
+ int i;
+ struct thermal_trip_info *trip_state;
+
+ /* Raise NCT's thresholds if soctherm CP,FT fuses are ok */
+ if (!tegra_fuse_calib_base_get_cp(NULL, NULL) &&
+ !tegra_fuse_calib_base_get_ft(NULL, NULL)) {
+ /* Raise NCT's shutdown point by 20C */
+ loki_nct72_pdata.shutdown_ext_limit += 20;
+ /* Remove tegra-balanced cooling device from NCT pdata */
+ for (i = 0; i < loki_nct72_pdata.num_trips; i++) {
+ trip_state = &loki_nct72_pdata.trips[i];
+ if (!strncmp(trip_state->cdev_type, "tegra-balanced",
+ THERMAL_NAME_LENGTH)) {
+ trip_state->cdev_type = "_none_";
+ break;
+ }
+ }
+ } else {
+ tegra_platform_edp_init(loki_nct72_pdata.trips,
+ &loki_nct72_pdata.num_trips,
+ 12000); /* edp temperature margin */
+ }
+
-/*
- tegra_add_cdev_trips(loki_nct72_pdata.trips,
- &loki_nct72_pdata.num_trips);
-*/
- tegra_platform_edp_init(loki_nct72_pdata.trips,
- &loki_nct72_pdata.num_trips,
- 12000); /* edp temperature margin */
tegra_add_cdev_trips(loki_nct72_pdata.trips,
&loki_nct72_pdata.num_trips);
tegra_add_tj_trips(loki_nct72_pdata.trips,