ARM: tegra: clock: Use rounded ActMon maximum rate
Alex Frid [Sat, 6 Aug 2011 01:56:04 +0000 (18:56 -0700)]
Used round rate API to determine maximum frequency of Tegra3 activity
monitoring shared users, instead of maximum rate directly. The former
takes into account available PLL/dividers and return actually
reachable frequency.

Bug 860618

Original-Change-Id: I48292c65bfbf58906ab59f86959b0e7155117558
Reviewed-on: http://git-master/r/45711
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Chandrakanth Gorantla <cgorantla@nvidia.com>
Tested-by: Chandrakanth Gorantla <cgorantla@nvidia.com>
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

Rebase-Id: R2be5b1549b53d2b203ccfe6ea1d1cd2368359d91

arch/arm/mach-tegra/tegra3_actmon.c

index fa9be8a..05cdc1f 100644 (file)
@@ -441,7 +441,9 @@ static int __init actmon_dev_init(struct actmon_dev *dev)
                       dev->dev_id, dev->con_id);
                return -ENODEV;
        }
-       dev->max_freq = clk_get_max_rate(dev->clk) / 1000;
+       dev->max_freq = clk_round_rate(dev->clk, ULONG_MAX);
+       clk_set_rate(dev->clk, dev->max_freq);
+       dev->max_freq /= 1000;
        freq = clk_get_rate(dev->clk) / 1000;
        actmon_dev_configure(dev, freq);