summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2012-05-26 21:54:36 -0700
committerSimone Willett <swillett@nvidia.com>2012-06-07 13:01:33 -0700
commitd47cd91dfd01671681caa2ad1b8afc761e78d927 (patch)
tree64f35f439c012aa74406d40e4ea88ce790d8b1a1 /arch/arm/mach-tegra
parentcc87e66730f603e339476619818d7b30906a172a (diff)
ARM: tegra: dvfs: Alter CPU dvfs on EDP events
Extended EDP processing of cpu up/down events with calls to alter CPU dvfs table. This is in addition to already supported changing of CPU dvfs on EDP thermal event. For now, added calls do not actually alter the table. Change-Id: I1cbf2c54eeca8dea1e7b6f4c65d8dbaf563a980e Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/104883 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c8
-rw-r--r--arch/arm/mach-tegra/dvfs.h7
-rw-r--r--arch/arm/mach-tegra/tegra3_dvfs.c3
3 files changed, 12 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 595f07d33538..5c680b849435 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -242,12 +242,12 @@ int tegra_edp_update_thermal_zone(int temperature)
/* Update cpu rate if cpufreq (at least on cpu0) is already started;
alter cpu dvfs table for this thermal zone if necessary */
- tegra_cpu_dvfs_alter(edp_thermal_index, true);
+ tegra_cpu_dvfs_alter(edp_thermal_index, &edp_cpumask, true);
if (target_cpu_speed[0]) {
edp_update_limit();
tegra_cpu_set_speed_cap(NULL);
}
- tegra_cpu_dvfs_alter(edp_thermal_index, false);
+ tegra_cpu_dvfs_alter(edp_thermal_index, &edp_cpumask, false);
mutex_unlock(&tegra_cpu_lock);
return ret;
@@ -321,6 +321,7 @@ static int tegra_cpu_edp_notify(
case CPU_UP_PREPARE:
mutex_lock(&tegra_cpu_lock);
cpu_set(cpu, edp_cpumask);
+ tegra_cpu_dvfs_alter(edp_thermal_index, &edp_cpumask, true);
edp_update_limit();
cpu_speed = tegra_getspeed(0);
@@ -335,13 +336,16 @@ static int tegra_cpu_edp_notify(
printk(KERN_DEBUG "tegra CPU:%sforce EDP limit %u kHz"
"\n", ret ? " failed to " : " ", new_speed);
}
+ tegra_cpu_dvfs_alter(edp_thermal_index, &edp_cpumask, false);
mutex_unlock(&tegra_cpu_lock);
break;
case CPU_DEAD:
mutex_lock(&tegra_cpu_lock);
cpu_clear(cpu, edp_cpumask);
+ tegra_cpu_dvfs_alter(edp_thermal_index, &edp_cpumask, true);
edp_update_limit();
tegra_cpu_set_speed_cap(NULL);
+ tegra_cpu_dvfs_alter(edp_thermal_index, &edp_cpumask, false);
mutex_unlock(&tegra_cpu_lock);
break;
}
diff --git a/arch/arm/mach-tegra/dvfs.h b/arch/arm/mach-tegra/dvfs.h
index f0de99146972..3bdb13690278 100644
--- a/arch/arm/mach-tegra/dvfs.h
+++ b/arch/arm/mach-tegra/dvfs.h
@@ -118,7 +118,8 @@ int tegra_dvfs_predict_millivolts(struct clk *c, unsigned long rate);
void tegra_dvfs_core_cap_enable(bool enable);
void tegra_dvfs_core_cap_level_set(int level);
int tegra_dvfs_alt_freqs_set(struct dvfs *d, unsigned long *alt_freqs);
-void tegra_cpu_dvfs_alter(int edp_thermal_index, bool before_clk_update);
+void tegra_cpu_dvfs_alter(
+ int edp_thermal_index, const cpumask_t *cpus, bool before_clk_update);
#else
static inline void tegra_soc_init_dvfs(void)
{}
@@ -156,8 +157,8 @@ static inline void tegra_dvfs_core_cap_level_set(int level)
static inline int tegra_dvfs_alt_freqs_set(struct dvfs *d,
unsigned long *alt_freqs)
{ return 0; }
-static inline void tegra_cpu_dvfs_alter(int edp_thermal_index,
- bool before_clk_update)
+static inline void tegra_cpu_dvfs_alter(
+ int edp_thermal_index, const cpumask_t *cpus, bool before_clk_update)
{}
#endif
diff --git a/arch/arm/mach-tegra/tegra3_dvfs.c b/arch/arm/mach-tegra/tegra3_dvfs.c
index 9b7b8a54b75a..e71e52dea1f7 100644
--- a/arch/arm/mach-tegra/tegra3_dvfs.c
+++ b/arch/arm/mach-tegra/tegra3_dvfs.c
@@ -663,7 +663,8 @@ void __init tegra_soc_init_dvfs(void)
tegra_dvfs_core_disabled ? "disabled" : "enabled");
}
-void tegra_cpu_dvfs_alter(int edp_thermal_index, bool before_clk_update)
+void tegra_cpu_dvfs_alter(int edp_thermal_index, const cpumask_t *cpus,
+ bool before_clk_update)
{
bool cpu_warm = !!edp_thermal_index;
unsigned long *alt_freqs = cpu_warm ? NULL : cpu_cold_freqs;