Commit ed2b2fb2a728e7500609870f7afa8a0ce8468746

Authored by Girish S G
Committed by Afzal Mohammed
1 parent 3969406b1b
Exists in master

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.

Signed-off-by: Girish S G <girishsg@ti.com>
[vaibhav.bedia@ti.com: Pull in for AM33xx]
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

arch/arm/mach-omap2/dvfs.c
... ... @@ -844,6 +844,9 @@
844 844  
845 845 rcu_read_lock();
846 846 opp = opp_find_freq_ceil(target_dev, &freq);
  847 + /* If we dont find a max, try a floor at least */
  848 + if (IS_ERR(opp))
  849 + opp = opp_find_freq_floor(target_dev, &freq);
847 850 if (IS_ERR(opp)) {
848 851 rcu_read_unlock();
849 852 dev_err(target_dev, "%s: Unable to find OPP for freq%ld\n",