diff options
author | Alex Frid <afrid@nvidia.com> | 2013-11-08 19:20:17 -0800 |
---|---|---|
committer | Harry Hong <hhong@nvidia.com> | 2014-02-16 17:15:38 -0800 |
commit | d55b44e2e87b2db3a2ffcd200ce54591d43f74b7 (patch) | |
tree | 895bb72210b96862d8838f4e3dbf3421af4ff8a2 /arch | |
parent | cdf501907bfdb241d4010d5ba01eccf7ed3f65df (diff) |
ARM: tegra11: clock: Fix cbus fine granularity rounding
Made sure that rounding rate equal to cbus fine granularity region
threshold returns threshold rate regardless of rounding direction:
up/down (was only up).
Change-Id: I61d33cf400b52e8d51a711a995666a5edb9b0cf3
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/328576
(cherry picked from commit 651660986248a50e9440475ea630026b1458daa1)
Reviewed-on: http://git-master/r/365875
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/tegra11_clocks.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/tegra11_clocks.c b/arch/arm/mach-tegra/tegra11_clocks.c index ef584a4b656f..27aab964aae2 100644 --- a/arch/arm/mach-tegra/tegra11_clocks.c +++ b/arch/arm/mach-tegra/tegra11_clocks.c @@ -4888,7 +4888,10 @@ static long tegra11_clk_cbus_round_updown(struct clk *c, unsigned long rate, c->dvfs->freqs[n-2] + CBUS_FINE_GRANULARITY_RANGE); threshold -= CBUS_FINE_GRANULARITY_RANGE; - if (rate <= threshold) + if (rate == threshold) + return threshold; + + if (rate < threshold) return up ? threshold : c->dvfs->freqs[n-2]; rate = (up ? DIV_ROUND_UP(rate, CBUS_FINE_GRANULARITY) : |