rk3168: dvfs support voltage diff = 0
authorchenxing <chenxing@rock-chips.com>
Fri, 22 Feb 2013 03:46:58 +0000 (11:46 +0800)
committerchenxing <chenxing@rock-chips.com>
Fri, 22 Feb 2013 03:46:58 +0000 (11:46 +0800)
arch/arm/mach-rk30/dvfs.c
arch/arm/plat-rk/dvfs.c

index caa54218c385364c80b5b93dd8877678c19d87cf..deb38384d365a04ba0d9b99476a34db4832117d6 100755 (executable)
@@ -87,14 +87,14 @@ static int g_logic_high_arm = 100 * 1000;
 \r
 #ifdef CONFIG_SOC_RK3168\r
 static struct cpufreq_frequency_table arm_high_logic_table[] = {\r
-        {.frequency = 1416 * DVFS_KHZ, .index = 25 * DVFS_MV},\r
-        {.frequency = 1608 * DVFS_KHZ, .index = 25 * DVFS_MV},\r
+        {.frequency = 1416 * DVFS_KHZ, .index = 0 * DVFS_MV},\r
+        {.frequency = 1608 * DVFS_KHZ, .index = 0 * DVFS_MV},\r
         {.frequency = CPUFREQ_TABLE_END},\r
 };\r
 \r
 static struct cpufreq_frequency_table logic_high_arm_table[] = {\r
-        {.frequency = 1008 * DVFS_KHZ, .index = 150 * DVFS_MV},\r
-        {.frequency = 1608 * DVFS_KHZ, .index = 75 * DVFS_MV},\r
+        {.frequency = 1008 * DVFS_KHZ, .index = 50 * DVFS_MV},\r
+        {.frequency = 1608 * DVFS_KHZ, .index = 50 * DVFS_MV},\r
         {.frequency = CPUFREQ_TABLE_END},\r
 };\r
 #else\r
index f645f6a09b944dc8e2e01d4955f08d745916a0a6..d93b69d45be5fb9a40875ac0ee56f2a9ccb05ac6 100755 (executable)
@@ -777,12 +777,17 @@ int dvfs_scale_volt(struct vd_node *vd_clk, struct vd_node *vd_dep,
                                } else {\r
                                        volt_dep = volt + dep_biger_than_clk;\r
                                }\r
-                       } else {\r
+                       } else if (volt < volt_dep){\r
                                if (volt == volt_new) {\r
                                        volt_dep = volt + dep_biger_than_clk;\r
                                } else {\r
                                        volt = volt_dep + clk_biger_than_dep;\r
                                }\r
+                       } else {\r
+                               if (volt != volt_new)\r
+                                       volt = volt_dep + clk_biger_than_dep;\r
+                               if (volt_dep != volt_dep_new)\r
+                                       volt_dep = volt + dep_biger_than_clk;\r
                        }\r
                        volt = volt > volt_new ? volt_new : volt;\r
                        volt_dep = volt_dep > volt_dep_new ? volt_dep_new : volt_dep;\r
@@ -796,12 +801,17 @@ int dvfs_scale_volt(struct vd_node *vd_clk, struct vd_node *vd_dep,
                                } else {\r
                                        volt = volt_dep - dep_biger_than_clk;\r
                                }\r
-                       } else {\r
+                       } else if (volt < volt_dep){\r
                                if (volt_dep == volt_dep_new) {\r
                                        volt = volt_dep - dep_biger_than_clk;\r
                                } else {\r
                                        volt_dep = volt - clk_biger_than_dep;\r
                                }\r
+                       } else {\r
+                               if (volt != volt_new)\r
+                                       volt = volt_dep - dep_biger_than_clk;\r
+                               if (volt_dep != volt_dep_new)\r
+                                       volt_dep = volt - clk_biger_than_dep;\r
                        }\r
                        volt = volt < volt_new ? volt_new : volt;\r
                        volt_dep = volt_dep < volt_dep_new ? volt_dep_new : volt_dep;\r