aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGirish S Ghongdemath <girishsg@ti.com>2011-07-15 16:28:13 -0500
committerIliyan Malchev <malchev@google.com>2011-07-15 16:21:06 -0700
commit843f129ce8ab1eac6a5052c2e99a1102e485d3bd (patch)
tree3ea689e36b7743b6f69207b3eed032878fb1fcc7
parentc1888c6edf253ebea5e5f528fddfba7312ddb786 (diff)
downloadkernel_samsung_tuna-843f129ce8ab1eac6a5052c2e99a1102e485d3bd.zip
kernel_samsung_tuna-843f129ce8ab1eac6a5052c2e99a1102e485d3bd.tar.gz
kernel_samsung_tuna-843f129ce8ab1eac6a5052c2e99a1102e485d3bd.tar.bz2
OMAP4: DVFS: attempt floor before giving up scale
Make DVFS to try the next available frequency if the higher match is not available. This will probably be the max available for the device. If we cannot match any thing at all, fail. This modifies the behavior of device scale to guarenteeing _atleast_ the frequency requested into _if possible_, the frequency requested. Change-Id: Id85382990d9717648a2466047bb966a089b72089 Signed-off-by: Girish S G <girishsg@ti.com>
-rw-r--r--arch/arm/mach-omap2/dvfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/dvfs.c b/arch/arm/mach-omap2/dvfs.c
index c17495a..754466c 100644
--- a/arch/arm/mach-omap2/dvfs.c
+++ b/arch/arm/mach-omap2/dvfs.c
@@ -853,6 +853,9 @@ int omap_device_scale(struct device *req_dev, struct device *target_dev,
rcu_read_lock();
opp = opp_find_freq_ceil(target_dev, &freq);
+ /* If we dont find a max, try a floor at least */
+ if (IS_ERR(opp))
+ opp = opp_find_freq_floor(target_dev, &freq);
if (IS_ERR(opp)) {
rcu_read_unlock();
dev_err(target_dev, "%s: Unable to find OPP for freq%ld\n",