diff options
author | huisung.kang <hs1218.kang@samsung.com> | 2011-05-13 01:47:10 +0200 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-16 21:48:34 -0800 |
commit | 91c550bc5ef51203f5f05e449c346f670e567391 (patch) | |
tree | b9f1c1afb212a044629f9f70729f48d9044c166a /arch/arm | |
parent | 3cf58b0b55c4489401477efa874715e1dd6afca8 (diff) | |
download | kernel_samsung_crespo-91c550bc5ef51203f5f05e449c346f670e567391.zip kernel_samsung_crespo-91c550bc5ef51203f5f05e449c346f670e567391.tar.gz kernel_samsung_crespo-91c550bc5ef51203f5f05e449c346f670e567391.tar.bz2 |
ARM: S5PV210: CPUFREQ: Add additional symantics for "relation" in cpufreq with pm.
relation has an additional symantics other than the standard.
s5pv210_target function have below additional relations
- DISABLE_FURTHER_CPUFREQ : disable futher access to target until being re-enabled.
- ENABLE_FURTHER_CPUFREQ : re-enable access to target
Change-Id: Iadab2eecf91f4dd8cecf35f2ab144c7bc8f00867
Signed-off-by: huisung.kang <hs1218.kang@samsung.com>
Signed-off-by: Kisoo Yu <ksoo.yu@samsung.com>
Diffstat (limited to 'arch/arm')
-rwxr-xr-x[-rw-r--r--] | arch/arm/mach-s5pv210/cpufreq.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-s5pv210/cpufreq.c index 153af8b..3c7fa60 100644..100755 --- a/arch/arm/mach-s5pv210/cpufreq.c +++ b/arch/arm/mach-s5pv210/cpufreq.c @@ -30,6 +30,19 @@ static struct cpufreq_freqs freqs; #define APLL_VAL_1000 ((1 << 31) | (125 << 16) | (3 << 8) | 1) #define APLL_VAL_800 ((1 << 31) | (100 << 16) | (3 << 8) | 1) +#define SLEEP_FREQ (800 * 1000) /* Use 800MHz when entering sleep */ + +/* + * relation has an additional symantics other than the standard of cpufreq + * DISALBE_FURTHER_CPUFREQ: disable further access to target until being re-enabled. + * ENABLE_FURTUER_CPUFREQ: re-enable access to target +*/ +enum cpufreq_access { + DISABLE_FURTHER_CPUFREQ = 0x10, + ENABLE_FURTHER_CPUFREQ = 0x20, +}; +static bool no_cpufreq_access; + /* * DRAM configurations to calculate refresh counter for changing * frequency of memory. @@ -146,6 +159,21 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index, priv_index; unsigned int pll_changing = 0; unsigned int bus_speed_changing = 0; + int ret = 0; + + if (relation & ENABLE_FURTHER_CPUFREQ) + no_cpufreq_access = false; + if (no_cpufreq_access) { +#ifdef CONFIG_PM_VERBOSE + pr_err("%s:%d denied access to %s as it is disabled" + "temporarily\n", __FILE__, __LINE__, __func__); +#endif + ret = -EINVAL; + goto out; + } + if (relation & DISABLE_FURTHER_CPUFREQ) + no_cpufreq_access = true; + relation &= ~(ENABLE_FURTHER_CPUFREQ | DISABLE_FURTHER_CPUFREQ); freqs.old = s5pv210_getspeed(0); @@ -388,7 +416,8 @@ static int s5pv210_target(struct cpufreq_policy *policy, printk(KERN_DEBUG "Perf changed[L%d]\n", index); - return 0; +out: + return ret; } #ifdef CONFIG_PM |