static struct mutex set_cpufreq_lock;
#endif
-static int soc_regulator_set;
static int cpu_freq_khz_min;
static int cpu_freq_khz_max;
/* Check if the bus freq needs to be increased first */
bus_freq_update(cpu_clk, true);
- if (freq == cpu_op_tbl[0].cpu_rate) {
- if (!IS_ERR(soc_regulator)) {
- ret = regulator_set_voltage(soc_regulator, soc_volt,
- soc_volt);
- if (ret < 0) {
- printk(KERN_DEBUG "COULD NOT SET SOC VOLTAGE!!!!\n");
- return ret;
- }
+ if (!IS_ERR(soc_regulator)) {
+ ret = regulator_set_voltage(soc_regulator, soc_volt,
+ soc_volt);
+ if (ret < 0) {
+ printk(KERN_DEBUG "COULD NOT SET SOC VOLTAGE!!!!\n");
+ return ret;
}
- if (!IS_ERR(pu_regulator)) {
- ret = regulator_set_voltage(pu_regulator, pu_volt,
- pu_volt);
- if (ret < 0) {
- printk(KERN_DEBUG "COULD NOT SET PU VOLTAGE!!!!\n");
- return ret;
- }
+ }
+ if (!IS_ERR(pu_regulator)) {
+ ret = regulator_set_voltage(pu_regulator, pu_volt,
+ pu_volt);
+ if (ret < 0) {
+ printk(KERN_DEBUG "COULD NOT SET PU VOLTAGE!!!!\n");
+ return ret;
}
- soc_regulator_set = 1;
}
ret = regulator_set_voltage(cpu_regulator, gp_volt,
gp_volt);
printk(KERN_DEBUG "COULD NOT SET GP VOLTAGE!!!!\n");
return ret;
}
- if (soc_regulator_set) {
- if (!IS_ERR(soc_regulator)) {
- ret = regulator_set_voltage(soc_regulator, soc_volt,
- soc_volt);
- if (ret < 0) {
- printk(KERN_DEBUG "COULD NOT SET SOC VOLTAGE BACK!!!!\n");
- return ret;
- }
+ if (!IS_ERR(soc_regulator)) {
+ ret = regulator_set_voltage(soc_regulator, soc_volt,
+ soc_volt);
+ if (ret < 0) {
+ printk(KERN_DEBUG "COULD NOT SET SOC VOLTAGE BACK!!!!\n");
+ return ret;
}
- if (!IS_ERR(pu_regulator)) {
- ret = regulator_set_voltage(pu_regulator, pu_volt,
- pu_volt);
- if (ret < 0) {
- printk(KERN_DEBUG "COULD NOT SET PU VOLTAGE!!!!\n");
- return ret;
- }
+ }
+ if (!IS_ERR(pu_regulator)) {
+ ret = regulator_set_voltage(pu_regulator, pu_volt,
+ pu_volt);
+ if (ret < 0) {
+ printk(KERN_DEBUG "COULD NOT SET PU VOLTAGE!!!!\n");
+ return ret;
}
- soc_regulator_set = 0;
}
/* Check if the bus freq can be decreased.*/
bus_freq_update(cpu_clk, false);