summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/clock.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2012-03-17 23:38:07 -0700
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-05-07 08:31:57 -0700
commit9635d5ef5602e9d681ec3695b86f7278a44cfd8e (patch)
tree490114e7acccc40d1cd7949a0ee6003502d6822c /arch/arm/mach-tegra/clock.c
parentf0399f93ea9a67305a1a550142f09c48ef7ea093 (diff)
ARM: tegra: clock: Add locked version of round rate
Add locked version of round rate API to be used by tegra arch specific layer. Signed-off-by: Alex Frid <afrid@nvidia.com> (cherry picked from commit 457627966b91f2141439812869adc4acf9242471) Change-Id: Id68d0bb952d1e7d9e650341872d1b06b0b2d3cea Reviewed-on: http://git-master/r/100474 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/clock.c')
-rw-r--r--arch/arm/mach-tegra/clock.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index f31da0bf1494..d173449e5b62 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -525,13 +525,11 @@ unsigned long clk_get_rate_all_locked(struct clk *c)
return rate;
}
-long clk_round_rate(struct clk *c, unsigned long rate)
+long clk_round_rate_locked(struct clk *c, unsigned long rate)
{
- unsigned long flags, max_rate;
+ unsigned long max_rate;
long ret;
- clk_lock_save(c, &flags);
-
if (!c->ops || !c->ops->round_rate) {
ret = -ENOSYS;
goto out;
@@ -544,6 +542,16 @@ long clk_round_rate(struct clk *c, unsigned long rate)
ret = c->ops->round_rate(c, rate);
out:
+ return ret;
+}
+
+long clk_round_rate(struct clk *c, unsigned long rate)
+{
+ unsigned long flags;
+ long ret;
+
+ clk_lock_save(c, &flags);
+ ret = clk_round_rate_locked(c, rate);
clk_unlock_restore(c, &flags);
return ret;
}