From 3a790bbe790e79a9744adf105ed135624a590f5b Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Mon, 13 Dec 2010 14:35:10 -0800 Subject: msm: add handling for clocks tagged as CLK_MINMAX 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 Signed-off-by: David Brown --- arch/arm/mach-msm/clock.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/arm/mach-msm') diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c index c57210f4f06..2069bfaa3a2 100644 --- a/arch/arm/mach-msm/clock.c +++ b/arch/arm/mach-msm/clock.c @@ -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); -- cgit v1.2.3-70-g09d2