Revert "ARM: tegra: dvfs: Fix locking on external dvfs calls"
authorColin Cross <ccross@android.com>
Wed, 10 Nov 2010 03:44:20 +0000 (19:44 -0800)
committerColin Cross <ccross@android.com>
Thu, 2 Dec 2010 02:14:06 +0000 (18:14 -0800)
This reverts commit f58886c359db3c5056fea2d1a41d297f19e9f585.

Change-Id: Ie88d8f79db9bf958fc3b9f261d74d031785161d0

arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/clock.h
arch/arm/mach-tegra/dvfs.c

index ad5f483af7fc3a72fdd26b2e33bb93e76e91afbb..34c2c29fa7600eea15a7a8917e72ab6dd26c65b9 100644 (file)
@@ -207,22 +207,6 @@ void clk_set_cansleep(struct clk *c)
        mutex_unlock(&clock_list_lock);
 }
 
-int tegra_dvfs_set_rate(struct clk *c, unsigned long rate)
-{
-       unsigned long flags;
-       int ret;
-
-       if (!clk_is_dvfs(c))
-               return -EINVAL;
-
-       clk_lock_save(c, flags);
-       ret = tegra_dvfs_set_rate_locked(c, rate);
-       clk_unlock_restore(c, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(tegra_dvfs_set_rate);
-
 int clk_reparent(struct clk *c, struct clk *parent)
 {
        c->parent = parent;
@@ -260,7 +244,7 @@ int clk_enable(struct clk *c)
        clk_lock_save(c, flags);
 
        if (clk_is_auto_dvfs(c)) {
-               ret = tegra_dvfs_set_rate_locked(c, clk_get_rate_locked(c));
+               ret = tegra_dvfs_set_rate(c, clk_get_rate_locked(c));
                if (ret)
                        goto out;
        }
@@ -313,7 +297,7 @@ void clk_disable(struct clk *c)
        c->refcnt--;
 
        if (clk_is_auto_dvfs(c) && c->refcnt == 0)
-               tegra_dvfs_set_rate_locked(c, 0);
+               tegra_dvfs_set_rate(c, 0);
 
        clk_unlock_restore(c, flags);
 }
@@ -338,7 +322,7 @@ int clk_set_parent(struct clk *c, struct clk *parent)
 
        if (clk_is_auto_dvfs(c) && c->refcnt > 0 &&
                        (!c->parent || new_rate > old_rate)) {
-               ret = tegra_dvfs_set_rate_locked(c, new_rate);
+               ret = tegra_dvfs_set_rate(c, new_rate);
                if (ret)
                        goto out;
        }
@@ -349,7 +333,7 @@ int clk_set_parent(struct clk *c, struct clk *parent)
 
        if (clk_is_auto_dvfs(c) && c->refcnt > 0 &&
                        new_rate < old_rate)
-               ret = tegra_dvfs_set_rate_locked(c, new_rate);
+               ret = tegra_dvfs_set_rate(c, new_rate);
 
 out:
        clk_unlock_restore(c, flags);
@@ -382,7 +366,7 @@ int clk_set_rate(struct clk *c, unsigned long rate)
                rate = c->max_rate;
 
        if (clk_is_auto_dvfs(c) && rate > old_rate && c->refcnt > 0) {
-               ret = tegra_dvfs_set_rate_locked(c, rate);
+               ret = tegra_dvfs_set_rate(c, rate);
                if (ret)
                        goto out;
        }
@@ -392,7 +376,7 @@ int clk_set_rate(struct clk *c, unsigned long rate)
                goto out;
 
        if (clk_is_auto_dvfs(c) && rate < old_rate && c->refcnt > 0)
-               ret = tegra_dvfs_set_rate_locked(c, rate);
+               ret = tegra_dvfs_set_rate(c, rate);
 
 out:
        clk_unlock_restore(c, flags);
@@ -543,12 +527,11 @@ void __init tegra_clk_set_dvfs_rates(void)
                clk_lock_save(c, flags);
                if (clk_is_auto_dvfs(c)) {
                        if (c->refcnt > 0)
-                               tegra_dvfs_set_rate_locked(c,
-                                       clk_get_rate_locked(c));
+                               tegra_dvfs_set_rate(c, clk_get_rate_locked(c));
                        else
-                               tegra_dvfs_set_rate_locked(c, 0);
+                               tegra_dvfs_set_rate(c, 0);
                } else if (clk_is_dvfs(c)) {
-                       tegra_dvfs_set_rate_locked(c, c->dvfs_rate);
+                       tegra_dvfs_set_rate(c, c->dvfs_rate);
                }
                clk_unlock_restore(c, flags);
        }
index edd9b3fd01a992411245dee3979d3435b3818d1d..42d9bd8849e0d959b184b1434c1263ff7349b878 100644 (file)
@@ -164,6 +164,5 @@ void tegra_clk_init_from_table(struct tegra_clk_init_table *table);
 void tegra_clk_set_dvfs_rates(void);
 void clk_set_cansleep(struct clk *c);
 unsigned long clk_get_rate_locked(struct clk *c);
-int tegra_dvfs_set_rate_locked(struct clk *c, unsigned long rate);
 
 #endif
index ef58fae8afbd1cef2ce138046c49987da5c1a72d..d7c5032dcbb3de8e75e6cdb91679f4d43512fc70 100644 (file)
@@ -178,7 +178,7 @@ __tegra_dvfs_set_rate(struct clk *c, struct dvfs *d, unsigned long rate)
        return ret;
 }
 
-int tegra_dvfs_set_rate_locked(struct clk *c, unsigned long rate)
+int tegra_dvfs_set_rate(struct clk *c, unsigned long rate)
 {
        struct dvfs *d;
        int ret = 0;
@@ -204,6 +204,7 @@ int tegra_dvfs_set_rate_locked(struct clk *c, unsigned long rate)
 
        return 0;
 }
+EXPORT_SYMBOL(tegra_dvfs_set_rate);
 
 /* May only be called during clock init, does not take any locks on clock c. */
 int __init tegra_enable_dvfs_on_clk(struct clk *c, struct dvfs *d)