diff options
author | Per Fransson <per.xx.fransson@stericsson.com> | 2011-03-17 12:29:58 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:15:02 +0200 |
commit | 563bedb8260d4b5acbf1f4b1d1e1cb562a0b650c (patch) | |
tree | 49173e258f6cc5ab73cc2264b42bf567e25b6f05 | |
parent | cd70d92186500aab0aa2596c52d4abc8c9bd9b15 (diff) |
ARM: ux500: Make it possible to turn off the cpufreq->QoS callback
echo 0 > /debugfs/prcmu/opp_cpufreq_delay
ST-Ericsson ID: CR 323730
Change-Id: I9d8509554e69b1ec3efe08dd8de478dd3a3b5c2e
Signed-off-by: Per Fransson <per.xx.fransson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18701
Reviewed-by: Martin PERSSON <martin.persson@stericsson.com>
-rw-r--r-- | arch/arm/mach-ux500/prcmu-qos-power.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/arch/arm/mach-ux500/prcmu-qos-power.c b/arch/arm/mach-ux500/prcmu-qos-power.c index 1aa539a5c34..df20e67cf67 100644 --- a/arch/arm/mach-ux500/prcmu-qos-power.c +++ b/arch/arm/mach-ux500/prcmu-qos-power.c @@ -26,6 +26,9 @@ #define ARM_THRESHOLD_FREQ (400000) +static int qos_delayed_cpufreq_notifier(struct notifier_block *, + unsigned long, void *); + static s32 cpufreq_requirement_queued; static s32 cpufreq_requirement_set; @@ -99,8 +102,25 @@ unsigned long prcmu_qos_get_cpufreq_opp_delay() return cpufreq_opp_delay; } +static struct notifier_block qos_delayed_cpufreq_notifier_block = { + .notifier_call = qos_delayed_cpufreq_notifier, +}; + void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) { + if (n == 0) { + cpufreq_unregister_notifier(&qos_delayed_cpufreq_notifier_block, + CPUFREQ_TRANSITION_NOTIFIER); + prcmu_qos_update_requirement(PRCMU_QOS_DDR_OPP, "cpufreq", + PRCMU_QOS_DEFAULT_VALUE); + prcmu_qos_update_requirement(PRCMU_QOS_APE_OPP, "cpufreq", + PRCMU_QOS_DEFAULT_VALUE); + cpufreq_requirement_set = PRCMU_QOS_DEFAULT_VALUE; + cpufreq_requirement_queued = PRCMU_QOS_DEFAULT_VALUE; + } else if (cpufreq_opp_delay != 0) { + cpufreq_register_notifier(&qos_delayed_cpufreq_notifier_block, + CPUFREQ_TRANSITION_NOTIFIER); + } cpufreq_opp_delay = n; } @@ -498,10 +518,6 @@ static int qos_delayed_cpufreq_notifier(struct notifier_block *nb, return 0; } -static struct notifier_block qos_delayed_cpufreq_notifier_block = { - .notifier_call = qos_delayed_cpufreq_notifier, -}; - static int __init prcmu_qos_power_init(void) { int ret = 0; |