summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vc.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-06-09 11:01:55 -0700
committerKevin Hilman <khilman@ti.com>2011-09-15 12:02:56 -0700
commite4e021c5491537783f5f65a6defa92e6098a3658 (patch)
tree01f6736da2d7584f6740401b6f297d80f8565dc6 /arch/arm/mach-omap2/vc.c
parentba112a4e86ba8f0f9546bd953374cde064b507ca (diff)
OMAP3+: VC: cleanup PMIC register address configuration
- support both voltage register address and command register address for each VC channel - add fields for voltage register address (volra) and command register address (cmdra) to struct omap_vc_channel - use VC/VP register access read/modify/write helper - remove volra_shift field (use __ffs(mask) for shift value) - I2C addresses 10-bit, change size to u16 Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vc.c')
-rw-r--r--arch/arm/mach-omap2/vc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index d5e792f20f1..22db6e6764d 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -243,17 +243,24 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
/* get PMIC/board specific settings */
vc->i2c_slave_addr = vdd->pmic_info->i2c_slave_addr;
+ vc->volt_reg_addr = vdd->pmic_info->volt_reg_addr;
+ vc->cmd_reg_addr = vdd->pmic_info->cmd_reg_addr;
/* 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);
- /* Setup the VOLRA(pmic reg addr) in VC */
- vc_val = voltdm->read(vc->common->smps_volra_reg);
- vc_val &= ~vc->smps_volra_mask;
- vc_val |= vdd->pmic_info->volt_reg_addr << vc->smps_volra_shift;
- voltdm->write(vc_val, vc->common->smps_volra_reg);
+ /*
+ * Configure the PMIC register addresses.
+ */
+ voltdm->rmw(vc->smps_volra_mask,
+ vc->volt_reg_addr << __ffs(vc->smps_volra_mask),
+ vc->common->smps_volra_reg);
+ 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);
/* Configure the setup times */
vc_val = voltdm->read(vdd->vfsm->voltsetup_reg);