summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/include/mach
diff options
context:
space:
mode:
authorJoshua Primero <jprimero@nvidia.com>2012-05-25 15:54:13 -0700
committerSimone Willett <swillett@nvidia.com>2012-07-03 14:55:32 -0700
commit5b1fcd1355485d347b3f15807561500ec06224ca (patch)
tree3d1ee6898d3c1b2b177c52d2e268d76eeac5c81f /arch/arm/mach-tegra/include/mach
parentad8fabee431584601e7184da76604ad3dfdd1109 (diff)
drivers: skin: Skin prediction algorithm
Added skin prediction algorithm. bug 1007726 Change-Id: Ia76f73cb818aa02e608e1fc69ab4d8277a5825eb Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/104814 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/include/mach')
-rw-r--r--arch/arm/mach-tegra/include/mach/thermal.h72
1 files changed, 59 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/include/mach/thermal.h b/arch/arm/mach-tegra/include/mach/thermal.h
index 78599971cd9f..ed71d0340a96 100644
--- a/arch/arm/mach-tegra/include/mach/thermal.h
+++ b/arch/arm/mach-tegra/include/mach/thermal.h
@@ -17,10 +17,35 @@
#ifndef __MACH_THERMAL_H
#define __MACH_THERMAL_H
+#include <linux/therm_est.h>
+
+enum thermal_device_id {
+ THERMAL_DEVICE_ID_NULL = 0x0,
+ THERMAL_DEVICE_ID_NCT_EXT = 0x1,
+ THERMAL_DEVICE_ID_NCT_INT = 0x2,
+ THERMAL_DEVICE_ID_TSENSOR = 0x4,
+ THERMAL_DEVICE_ID_SKIN = 0x8,
+};
+
+#define THERMAL_DEVICE_MAX (4)
+
+enum balanced_throttle_id {
+ BALANCED_THROTTLE_ID_TJ,
+ BALANCED_THROTTLE_ID_SKIN,
+};
+
+struct skin_therm_est_subdevice {
+ enum thermal_device_id id;
+ long coeffs[HIST_LEN];
+};
+
/* All units in millicelsius */
struct tegra_thermal_data {
+ enum thermal_device_id shutdown_device_id;
long temp_shutdown;
- long temp_offset;
+#if defined(CONFIG_TEGRA_EDP_LIMITS) || defined(CONFIG_TEGRA_THERMAL_THROTTLE)
+ enum thermal_device_id throttle_edp_device_id;
+#endif
#ifdef CONFIG_TEGRA_EDP_LIMITS
long edp_offset;
long hysteresis_edp;
@@ -31,10 +56,23 @@ struct tegra_thermal_data {
int tc2;
long passive_delay;
#endif
+#ifdef CONFIG_TEGRA_SKIN_THROTTLE
+ enum thermal_device_id skin_device_id;
+ long temp_throttle_skin;
+ int tc1_skin;
+ int tc2_skin;
+ int passive_delay_skin;
+
+ long skin_temp_offset;
+ long skin_period;
+ int skin_devs_size;
+ struct skin_therm_est_subdevice skin_devs[];
+#endif
};
struct tegra_thermal_device {
char *name;
+ enum thermal_device_id id;
void *data;
long offset;
int (*get_temp) (void *, long *);
@@ -45,40 +83,48 @@ struct tegra_thermal_device {
#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
struct thermal_zone_device *thz;
#endif
+ struct list_head node;
};
-#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
struct throttle_table {
unsigned int cpu_freq;
int core_cap_level;
};
+#define MAX_THROT_TABLE_SIZE (32)
+
struct balanced_throttle {
- int id;
- struct throttle_table *throt_tab;
- int throt_tab_size;
+ enum balanced_throttle_id id;
int is_throttling;
int throttle_index;
struct thermal_cooling_device *cdev;
struct list_head node;
+
+ int throt_tab_size;
+ struct throttle_table throt_tab[MAX_THROT_TABLE_SIZE];
};
-struct balanced_throttle *balanced_throttle_register(
- int id,
- struct throttle_table *table,
- int tab_size);
+#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
+int balanced_throttle_register(struct balanced_throttle *bthrot);
+#else
+static inline int balanced_throttle_register(struct balanced_throttle *bthrot)
+{ return 0; }
#endif
#ifndef CONFIG_ARCH_TEGRA_2x_SOC
-int tegra_thermal_init(struct tegra_thermal_data *data);
-int tegra_thermal_set_device(struct tegra_thermal_device *device);
+int tegra_thermal_init(struct tegra_thermal_data *data,
+ struct balanced_throttle *throttle_list,
+ int throttle_list_size);
+int tegra_thermal_device_register(struct tegra_thermal_device *device);
int tegra_thermal_exit(void);
#else
-static inline int tegra_thermal_init(struct tegra_thermal_data *data)
+static inline int tegra_thermal_init(struct tegra_thermal_data *data,
+ struct balanced_throttle throttle_list,
+ int throttle_list_size);
{ return 0; }
-static inline int tegra_thermal_set_device(struct tegra_thermal_device *dev)
+static int tegra_thermal_device_register(struct tegra_thermal_device *device)
{ return 0; }
static inline int tegra_thermal_exit(void)
{ return 0; }