OMAP2+: VC: support PMICs with separate voltage and command registers
The VC layer can support PMICs with separate voltage and command
registers by putting the different registers in the PRM_VC_SMPS_VOL_RA
and PRCM_VC_SMPS_CMD_RA registers respectively.
The PMIC data must supply at least a voltage register address
(volt_reg_addr). The command register address (cmd_reg_addr) is
optional. If the PMIC data does not supply a separate command
register address, the VC will use the voltage register address for both.
Signed-off-by: Kevin Hilman <khilman@ti.com>
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index b62363d..1bdbe7c 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -115,7 +115,7 @@
vc_valid = vc->common->valid;
vc_bypass_val_reg = vc->common->bypass_val_reg;
vc_bypass_value = (target_vsel << vc->common->data_shift) |
- (vdd->pmic_info->pmic_reg <<
+ (vdd->pmic_info->volt_reg_addr <<
vc->common->regaddr_shift) |
(vdd->pmic_info->i2c_slave_addr <<
vc->common->slaveaddr_shift);
@@ -264,7 +264,7 @@
vc_val = vdd->read_reg(vc->common->prm_mod,
vc->common->smps_volra_reg);
vc_val &= ~vc->smps_volra_mask;
- vc_val |= vdd->pmic_info->pmic_reg << vc->smps_volra_shift;
+ vc_val |= vdd->pmic_info->volt_reg_addr << vc->smps_volra_shift;
vdd->write_reg(vc_val, vc->common->prm_mod,
vc->common->smps_volra_reg);