From 5e5ee62aab28a7bd80a9f3da4006b9f325781ad2 Mon Sep 17 00:00:00 2001 From: chenxing Date: Sat, 25 Aug 2012 15:49:17 +0800 Subject: [PATCH] rk30:sdk: dvfs freq limit active right now --- arch/arm/mach-rk30/dvfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rk30/dvfs.c b/arch/arm/mach-rk30/dvfs.c index a2838794d264..7f1aa71b471b 100644 --- a/arch/arm/mach-rk30/dvfs.c +++ b/arch/arm/mach-rk30/dvfs.c @@ -106,12 +106,18 @@ struct regulator* dvfs_get_regulator(char *regulator_name) int dvfs_clk_enable_limit(struct clk *clk, unsigned int min_rate, unsigned max_rate) { struct clk_node* dvfs_clk; + u32 rate = 0; dvfs_clk = clk->dvfs_info; dvfs_clk->freq_limit_en = 1; dvfs_clk->min_rate = min_rate; dvfs_clk->max_rate = max_rate; + rate = clk_get_rate(clk); + if (rate < min_rate) + dvfs_clk_set_rate(clk, min_rate); + else if (rate > max_rate) + dvfs_clk_set_rate(clk, max_rate); return 0; } -- 2.34.1