diff options
author | Todd Poynor <toddpoynor@google.com> | 2010-12-20 15:53:54 -0800 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2010-12-20 19:24:27 -0800 |
commit | f940e06d5cf99767f4cec4555c75af051060009f (patch) | |
tree | 003d574a89df7fd5a4afef5663903c5f8b9f6ff7 /arch/arm/mach-tegra/cpu-tegra.c | |
parent | fca172ff3d27904db22a2608910b9632de226ae2 (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/cpu-tegra.c')
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 35 |
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 eddd1b7fabf4..a878545d2740 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -105,49 +105,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) @@ -189,6 +170,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) |