]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-omap2/vc.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto...
[~andy/linux] / arch / arm / mach-omap2 / vc.c
index e872a0369afb8ee4e4a8378cd4945f3ba3034e48..031d116fbf103fff322a4e13bb16ae4221b28d02 100644 (file)
@@ -94,7 +94,7 @@ static int omap_vc_config_channel(struct voltagedomain *voltdm)
 
        voltdm->rmw(CFG_CHANNEL_MASK << vc->cfg_channel_sa_shift,
                    vc->cfg_channel << vc->cfg_channel_sa_shift,
-                   vc->common->cfg_channel_reg);
+                   vc->cfg_channel_reg);
 
        return 0;
 }
@@ -105,9 +105,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
                      u8 *target_vsel, u8 *current_vsel)
 {
        struct omap_vc_channel *vc = voltdm->vc;
-       struct omap_vdd_info *vdd = voltdm->vdd;
-       struct omap_volt_data *volt_data;
-       u32 vc_cmdval, vp_errgain_val;
+       u32 vc_cmdval;
 
        /* Check if sufficient pmic info is available for this vdd */
        if (!voltdm->pmic) {
@@ -129,13 +127,8 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
                return -EINVAL;
        }
 
-       /* Get volt_data corresponding to target_volt */
-       volt_data = omap_voltage_get_voltdata(voltdm, target_volt);
-       if (IS_ERR(volt_data))
-               volt_data = NULL;
-
        *target_vsel = voltdm->pmic->uv_to_vsel(target_volt);
-       *current_vsel = voltdm->pmic->uv_to_vsel(vdd->curr_volt);
+       *current_vsel = voltdm->pmic->uv_to_vsel(voltdm->nominal_volt);
 
        /* Setting the ON voltage to the new target voltage */
        vc_cmdval = voltdm->read(vc->cmdval_reg);
@@ -143,15 +136,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
        vc_cmdval |= (*target_vsel << vc->common->cmd_on_shift);
        voltdm->write(vc_cmdval, vc->cmdval_reg);
 
-       /* Setting vp errorgain based on the voltage */
-       if (volt_data) {
-               vp_errgain_val = voltdm->read(voltdm->vp->vpconfig);
-               vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain;
-               vp_errgain_val &= voltdm->vp->common->vpconfig_errorgain_mask;
-               vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain <<
-                       voltdm->vp->common->vpconfig_errorgain_shift;
-               voltdm->write(vp_errgain_val, voltdm->vp->vpconfig);
-       }
+       omap_vp_update_errorgain(voltdm, target_volt);
 
        return 0;
 }
@@ -160,7 +145,6 @@ void omap_vc_post_scale(struct voltagedomain *voltdm,
                        unsigned long target_volt,
                        u8 target_vsel, u8 current_vsel)
 {
-       struct omap_vdd_info *vdd = voltdm->vdd;
        u32 smps_steps = 0, smps_delay = 0;
 
        smps_steps = abs(target_vsel - current_vsel);
@@ -168,8 +152,6 @@ void omap_vc_post_scale(struct voltagedomain *voltdm,
        smps_delay = ((smps_steps * voltdm->pmic->step_size) /
                        voltdm->pmic->slew_rate) + 2;
        udelay(smps_delay);
-
-       vdd->curr_volt = target_volt;
 }
 
 /* vc_bypass_scale - VC bypass method of voltage scaling */
@@ -337,7 +319,7 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
        /* Configure the i2c slave address for this VC */
        voltdm->rmw(vc->smps_sa_mask,
                    vc->i2c_slave_addr << __ffs(vc->smps_sa_mask),
-                   vc->common->smps_sa_reg);
+                   vc->smps_sa_reg);
        vc->cfg_channel |= vc_cfg_bits->sa;
 
        /*
@@ -345,13 +327,13 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
         */
        voltdm->rmw(vc->smps_volra_mask,
                    vc->volt_reg_addr << __ffs(vc->smps_volra_mask),
-                   vc->common->smps_volra_reg);
+                   vc->smps_volra_reg);
        vc->cfg_channel |= vc_cfg_bits->rav;
 
        if (vc->cmd_reg_addr) {
                voltdm->rmw(vc->smps_cmdra_mask,
                            vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask),
-                           vc->common->smps_cmdra_reg);
+                           vc->smps_cmdra_reg);
                vc->cfg_channel |= vc_cfg_bits->rac | vc_cfg_bits->racen;
        }