diff options
author | Kevin Hilman <khilman@ti.com> | 2011-03-29 14:02:36 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 12:02:55 -0700 |
commit | ba112a4e86ba8f0f9546bd953374cde064b507ca (patch) | |
tree | d35d58857d8a44d4ea501328b34fe1572ffb211b /arch/arm/mach-omap2/vc.c | |
parent | 4bcc475ebd06a04e1531254c27c6cf508ef8ebf9 (diff) |
OMAP3+: VC: cleanup i2c slave address configuration
- Add an i2c_slave_address field to the omap_vc_channel
- use VC/VP read/modify/write helper instead of open-coding
- remove smps_sa_shift, use __ffs(mask) for shift value
- I2C addresses 10-bit, change size to u16
Special thanks to Shweta Gulati <shweta.gulati@ti.com> for suggesting
the use of __ffs(x) instead of ffs(x) - 1.
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.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index f1c73cbe3cb4..d5e792f20f16 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -241,11 +241,13 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) return; } - /* Set up the SMPS_SA(i2c slave address in VC */ - vc_val = voltdm->read(vc->common->smps_sa_reg); - vc_val &= ~vc->smps_sa_mask; - vc_val |= vdd->pmic_info->i2c_slave_addr << vc->smps_sa_shift; - voltdm->write(vc_val, vc->common->smps_sa_reg); + /* get PMIC/board specific settings */ + vc->i2c_slave_addr = vdd->pmic_info->i2c_slave_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); |