summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2010-12-20 15:53:54 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:36:50 -0800
commit92b44ecc89f5ee138afa332729c6e0c0b8c4cf5b (patch)
tree9dbd54a96cdfec7c131c151702bb3ab5786f4308 /arch/arm/mach-tegra
parent81dd0074b7d32a441e31c04d0517b095114f9875 (diff)
ARM: tegra: cpufreq: Change function signature for CPU speed throttling
The NCT1008 driver is now passed a function pointer from the board file's platform data to be called when alarms are asserted or deasserted. Switch to a single function for throttling enable/disable suitable for calling via the temperature alarm callback. Change-Id: Ic0eb1566a68e151216e26dfb6ed6f4bc7a273ddb Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 8e86009b4ac1..c2f9ca4bffea 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -103,49 +103,30 @@ static void tegra_throttle_work_func(struct work_struct *work)
mutex_unlock(&tegra_cpu_lock);
}
-/**
+/*
* tegra_throttling_enable
* This function may sleep
*/
-void tegra_throttling_enable(void)
+void tegra_throttling_enable(bool enable)
{
mutex_lock(&throttling_lock);
- if (!is_throttling) {
+ if (enable && !is_throttling) {
is_throttling = true;
queue_delayed_work(workqueue, &throttle_work, NO_DELAY);
- }
-
- mutex_unlock(&throttling_lock);
-}
-EXPORT_SYMBOL_GPL(tegra_throttling_enable);
-
-/**
- * tegra_throttling_disable
- * This function may sleep
- */
-void tegra_throttling_disable(void)
-{
- mutex_lock(&throttling_lock);
-
- if (is_throttling) {
+ } else if (!enable && is_throttling) {
cancel_delayed_work_sync(&throttle_work);
is_throttling = false;
}
mutex_unlock(&throttling_lock);
}
-EXPORT_SYMBOL_GPL(tegra_throttling_disable);
+EXPORT_SYMBOL_GPL(tegra_throttling_enable);
#ifdef CONFIG_DEBUG_FS
static int throttle_debug_set(void *data, u64 val)
{
- if (val) {
- tegra_throttling_enable();
- } else {
- tegra_throttling_disable();
- }
-
+ tegra_throttling_enable(val);
return 0;
}
static int throttle_debug_get(void *data, u64 *val)
@@ -187,6 +168,10 @@ module_exit(tegra_cpu_debug_exit);
#else /* CONFIG_TEGRA_THERMAL_THROTTLE */
#define tegra_cpu_is_throttling() (0)
+
+void tegra_throttling_enable(bool enable)
+{
+}
#endif /* CONFIG_TEGRA_THERMAL_THROTTLE */
int tegra_verify_speed(struct cpufreq_policy *policy)