summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/tegra/soctherm.h
diff options
context:
space:
mode:
authorWei Ni <wni@nvidia.com>2016-03-29 18:29:19 +0800
committerEduardo Valentin <edubezval@gmail.com>2016-05-17 07:28:29 -0700
commit2a895871f27fdc82ac7b365d3f94e2c7b3467898 (patch)
tree14bad42ae6ed4ff90cd5b3cbcbba3b8e4ea78adb /drivers/thermal/tegra/soctherm.h
parent4d44cd4ae96ed3744d26d9615ea103df5afc3ed7 (diff)
downloadlinux-stable-2a895871f27fdc82ac7b365d3f94e2c7b3467898.tar.gz
linux-stable-2a895871f27fdc82ac7b365d3f94e2c7b3467898.tar.bz2
linux-stable-2a895871f27fdc82ac7b365d3f94e2c7b3467898.zip
thermal: tegra: add thermtrip function
Add support for hardware critical thermal limits to the SOC_THERM driver. It use the Linux thermal framework to create critical trip temp, and set it to SOC_THERM hardware. If these limits are breached, the chip will reset, and if appropriately configured, will turn off the PMIC. This support is critical for safe usage of the chip. Signed-off-by: Wei Ni <wni@nvidia.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/tegra/soctherm.h')
-rw-r--r--drivers/thermal/tegra/soctherm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/thermal/tegra/soctherm.h b/drivers/thermal/tegra/soctherm.h
index ec4b87616d01..f6dbbba80367 100644
--- a/drivers/thermal/tegra/soctherm.h
+++ b/drivers/thermal/tegra/soctherm.h
@@ -21,6 +21,9 @@
#define SENSOR_CONFIG2_THERMB_MASK 0xffff
#define SENSOR_CONFIG2_THERMB_SHIFT 0
+#define THERMCTL_THERMTRIP_CTL 0x80
+/* BITs are defined in device file */
+
#define SENSOR_PDIV 0x1c0
#define SENSOR_PDIV_CPU_MASK (0xf << 12)
#define SENSOR_PDIV_GPU_MASK (0xf << 8)
@@ -59,6 +62,9 @@ struct tegra_tsensor_group {
u32 sensor_temp_mask;
u32 pdiv, pdiv_ate, pdiv_mask;
u32 pllx_hotspot_diff, pllx_hotspot_mask;
+ u32 thermtrip_enable_mask;
+ u32 thermtrip_any_en_mask;
+ u32 thermtrip_threshold_mask;
};
struct tegra_tsensor_configuration {
@@ -96,6 +102,7 @@ struct tegra_soctherm_soc {
const struct tegra_tsensor_group **ttgs;
const unsigned int num_ttgs;
const struct tegra_soctherm_fuse *tfuse;
+ const int thresh_grain;
};
int tegra_calc_shared_calib(const struct tegra_soctherm_fuse *tfuse,