]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - arch/arm/mach-omap2/vp.c
Merge tag 'pm-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[can-eth-gw-linux.git] / arch / arm / mach-omap2 / vp.c
index 85241b828c029e45b2f494925af3a3296cd92982..a3c30655aa300ee6ceb5daa02a8fcd6abfe4de6c 100644 (file)
@@ -58,8 +58,10 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
        sys_clk_rate = voltdm->sys_clk.rate / 1000;
 
        timeout = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000;
-       vddmin = voltdm->pmic->vp_vddmin;
-       vddmax = voltdm->pmic->vp_vddmax;
+       vddmin = max(voltdm->vp_param->vddmin, voltdm->pmic->vddmin);
+       vddmax = min(voltdm->vp_param->vddmax, voltdm->pmic->vddmax);
+       vddmin = voltdm->pmic->uv_to_vsel(vddmin);
+       vddmax = voltdm->pmic->uv_to_vsel(vddmax);
 
        waittime = DIV_ROUND_UP(voltdm->pmic->step_size * sys_clk_rate,
                                1000 * voltdm->pmic->slew_rate);
@@ -138,7 +140,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
                udelay(1);
        }
        if (timeout >= VP_TRANXDONE_TIMEOUT) {
-               pr_warn("%s: vdd_%s TRANXDONE timeout exceeded. Voltage change aborted",
+               pr_warn("%s: vdd_%s TRANXDONE timeout exceeded. Voltage change aborted\n",
                        __func__, voltdm->name);
                return -ETIMEDOUT;
        }
@@ -197,7 +199,7 @@ void omap_vp_enable(struct voltagedomain *voltdm)
        u32 vpconfig, volt;
 
        if (!voltdm || IS_ERR(voltdm)) {
-               pr_warning("%s: VDD specified does not exist!\n", __func__);
+               pr_warn("%s: VDD specified does not exist!\n", __func__);
                return;
        }
 
@@ -214,8 +216,8 @@ void omap_vp_enable(struct voltagedomain *voltdm)
 
        volt = voltdm_get_voltage(voltdm);
        if (!volt) {
-               pr_warning("%s: unable to find current voltage for %s\n",
-                          __func__, voltdm->name);
+               pr_warn("%s: unable to find current voltage for %s\n",
+                       __func__, voltdm->name);
                return;
        }
 
@@ -242,7 +244,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
        int timeout;
 
        if (!voltdm || IS_ERR(voltdm)) {
-               pr_warning("%s: VDD specified does not exist!\n", __func__);
+               pr_warn("%s: VDD specified does not exist!\n", __func__);
                return;
        }
 
@@ -272,8 +274,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
                          VP_IDLE_TIMEOUT, timeout);
 
        if (timeout >= VP_IDLE_TIMEOUT)
-               pr_warning("%s: vdd_%s idle timedout\n",
-                       __func__, voltdm->name);
+               pr_warn("%s: vdd_%s idle timedout\n", __func__, voltdm->name);
 
        vp->enabled = false;