summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/include/mach/edp.h
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-10-05 21:20:21 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2012-03-22 23:49:25 -0700
commit44f04419f67ad370e68ade0ae7c4203a508261ff (patch)
treeaded1f56e243ce60e538ca8233935ede37b9903f /arch/arm/mach-tegra/include/mach/edp.h
parent8d5de40ff0994b6d965ea1726bde48dea7f53265 (diff)
ARM: tegra: power: Limit CPU rate on system EDP alarm
System electrical design point (EDP) alarm is generated when system power source (battery) over-current is detected. Part of the system EDP management is CPU frequency capping added by this commit. Maximum CPU clock frequency is pre-determined depending on number of CPU cores on-line. It is combined with CPU regulator EDP limit and applied to final CPU rate; CPU voltage is scaled down by DVFS, respectively. The system EDP limit of CPU rate is removed after alarm is canceled. EDP event can be emulated via debugfs entry /d/cpu-tegra/edp_alarm. (cherry picked from commit fa673d27766ff9513139e94a498e4c24827d7c57) arm: tegra: power: Removed erroneous ';' (cherry picked from commit b4b404381b2d1823b7c127858950f853428fe3b5) Change-Id: I60ec0e87f9442b698a8824895aac0a1f955565b4 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/67823 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com> Rebase-Id: R6a004bea8dfc99cd965f94035481907007bd1e32
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/edp.h')
-rw-r--r--arch/arm/mach-tegra/include/mach/edp.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/edp.h b/arch/arm/mach-tegra/include/mach/edp.h
index 92d2e4f3f196..48321cae4959 100644
--- a/arch/arm/mach-tegra/include/mach/edp.h
+++ b/arch/arm/mach-tegra/include/mach/edp.h
@@ -35,18 +35,28 @@ struct tegra_edp_limits {
unsigned int freq_limits[4];
};
+struct system_edp_entry {
+ char speedo_id;
+ char power_limit_100mW;
+ char freq_limits[4];
+};
#ifdef CONFIG_TEGRA_EDP_LIMITS
int tegra_edp_update_thermal_zone(int temperature);
void tegra_init_cpu_edp_limits(unsigned int regulator_mA);
+void tegra_init_system_edp_limits(unsigned int power_limit_mW);
void tegra_get_cpu_edp_limits(const struct tegra_edp_limits **limits, int *size);
unsigned int tegra_get_edp_limit(void);
+void tegra_get_system_edp_limits(const unsigned int **limits);
+int tegra_system_edp_alarm(bool alarm);
#else
static inline void tegra_init_cpu_edp_limits(int regulator_mA)
{}
+static inline void tegra_init_system_edp_limits(int power_limit_mW)
+{}
static inline int tegra_edp_update_thermal_zone(int temperature)
{ return -1; }
static inline void tegra_get_cpu_edp_limits(struct tegra_edp_limits **limits,
@@ -54,6 +64,10 @@ static inline void tegra_get_cpu_edp_limits(struct tegra_edp_limits **limits,
{}
static inline unsigned int tegra_get_edp_limit(void)
{ return -1; }
+static inline void tegra_get_system_edp_limits(unsigned int **limits)
+{}
+static inline int tegra_system_edp_alarm(bool alarm)
+{ return -1; }
#endif
#ifdef CONFIG_ARCH_TEGRA_2x_SOC