msm: add handling for clocks tagged as CLK_MINMAX
authorDaniel Walker <dwalker@codeaurora.org>
Mon, 13 Dec 2010 22:35:10 +0000 (14:35 -0800)
committerDavid Brown <davidb@codeaurora.org>
Wed, 15 Dec 2010 22:13:17 +0000 (14:13 -0800)
CLK_MINMAX is used to denote clocks that have a wide variation
in possible frequencies. This handling just sets the min and
max values to the same value.

Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
arch/arm/mach-msm/clock.c

index c57210f4f06a309971af53df94a8d38060fee14a..2069bfaa3a2619d078cb90edd93f3578b9f2230e 100644 (file)
@@ -120,6 +120,21 @@ EXPORT_SYMBOL(clk_get_rate);
 
 int clk_set_rate(struct clk *clk, unsigned long rate)
 {
+       int ret;
+       if (clk->flags & CLKFLAG_MAX) {
+               ret = clk->ops->set_max_rate(clk->id, rate);
+               if (ret)
+                       return ret;
+       }
+       if (clk->flags & CLKFLAG_MIN) {
+               ret = clk->ops->set_min_rate(clk->id, rate);
+               if (ret)
+                       return ret;
+       }
+
+       if (clk->flags & CLKFLAG_MAX || clk->flags & CLKFLAG_MIN)
+               return ret;
+
        return clk->ops->set_rate(clk->id, rate);
 }
 EXPORT_SYMBOL(clk_set_rate);