From: chenxing Date: Sat, 25 Aug 2012 07:49:17 +0000 (+0800) Subject: rk30:sdk: dvfs freq limit active right now X-Git-Tag: firefly_0821_release~8838 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5e5ee62aab28a7bd80a9f3da4006b9f325781ad2;p=firefly-linux-kernel-4.4.55.git rk30:sdk: dvfs freq limit active right now --- 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; }