}\r
return ret;\r
}\r
+// for clk enable case to get vd regulator info\r
+void clk_enable_dvfs_regulator_check(struct vd_node *vd)\r
+{\r
+ vd->cur_volt = dvfs_regulator_get_voltage(vd->regulator);\r
+ if(vd->cur_volt<=0)\r
+ {\r
+ vd->volt_set_flag = DVFS_SET_VOLT_FAILURE;\r
+ }\r
+ vd->volt_set_flag = DVFS_SET_VOLT_SUCCESS;\r
+}\r
\r
struct regulator *dvfs_get_regulator(char *regulator_name) \r
{\r
return 0;\r
}\r
\r
+\r
+\r
+\r
int clk_enable_dvfs(struct clk *clk)\r
{\r
struct clk_node *dvfs_clk;\r
dvfs_clk->vd->regulator = dvfs_regulator_get(NULL, dvfs_clk->vd->regulator_name);\r
if (!IS_ERR_OR_NULL(dvfs_clk->vd->regulator)) {\r
// DVFS_DBG("dvfs_regulator_get(%s)\n",dvfs_clk->vd->regulator_name);\r
- dvfs_clk->vd->cur_volt = dvfs_regulator_get_voltage(dvfs_clk->vd->regulator);\r
+ clk_enable_dvfs_regulator_check(dvfs_clk->vd);\r
} else {\r
//dvfs_clk->vd->regulator = NULL;\r
dvfs_clk->enable_dvfs = 0;\r
return -1;\r
}\r
} else {\r
- dvfs_clk->vd->cur_volt = dvfs_regulator_get_voltage(dvfs_clk->vd->regulator);\r
+ clk_enable_dvfs_regulator_check(dvfs_clk->vd);\r
// DVFS_DBG("%s(%s) vd volt=%u\n",__func__,dvfs_clk->name,dvfs_clk->vd->cur_volt);\r
}\r
\r
dvfs_clk->enable_dvfs = 0;\r
return -1;\r
} else {\r
- DVFS_ERR("WARNING: %s table all value are smaller than default, use default, just enable dvfs\n", __func__);\r
+ DVFS_WARNING("%s table all value are smaller than default, use default, just enable dvfs\n", __func__);\r
dvfs_clk->enable_dvfs++;\r
return 0;\r
}\r
}\r
\r
dvfs_clk->set_volt = clk_fv.index;\r
+ dvfs_vd_get_newvolt_byclk(dvfs_clk);\r
// DVFS_DBG("%s,%s,freq%u(ref vol %u)\n",__func__,dvfs_clk->name,\r
// dvfs_clk->set_freq,dvfs_clk->set_volt);\r
#if 0\r
clk_notifier_register(clk, dvfs_clk->dvfs_nb);\r
}\r
#endif\r
- dvfs_vd_get_newvolt_byclk(dvfs_clk);\r
+\r
#if 0\r
if(dvfs_clk->vd->cur_volt < dvfs_clk->set_volt) {\r
int ret;\r
return -1;\r
}\r
if (flag_set_volt_correct <= 0) {\r
- DVFS_ERR("%s (clk:%s), try to reload arm_volt error %d!!! stop scaling\n",\r
+ DVFS_ERR("%s (vd:%s), try to reload volt ,by it is error again(%d)!!! stop scaling\n",\r
__func__, dvfs_vd->name, flag_set_volt_correct);\r
return -1;\r
}\r
dvfs_vd->volt_set_flag = DVFS_SET_VOLT_SUCCESS;\r
- DVFS_ERR("%s (clk:%s), try to reload arm_volt! arm_volt_correct = %d\n",\r
+ DVFS_WARNING("%s (vd:%s), try to reload volt = %d\n",\r
__func__, dvfs_vd->name, flag_set_volt_correct);\r
\r
/* Reset vd's voltage */\r