diff options
author | Nishanth Menon <nm@ti.com> | 2011-06-06 12:18:03 -0700 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-06-13 16:44:14 -0500 |
commit | 1b5250ff7160542cc6f4da4dc736281a636b78da (patch) | |
tree | c5d2bc5512956e3650daaef05fc83798473c9b78 /arch/arm/mach-omap2/vc.c | |
parent | 46197dcc66990ec7d5187517435f4e87013c722f (diff) | |
download | kernel_samsung_tuna-1b5250ff7160542cc6f4da4dc736281a636b78da.zip kernel_samsung_tuna-1b5250ff7160542cc6f4da4dc736281a636b78da.tar.gz kernel_samsung_tuna-1b5250ff7160542cc6f4da4dc736281a636b78da.tar.bz2 |
OMAP4: PM: VC: allow channels use of default channel i2c_slaveaddr
OMAP4's PRM_VC_CFG_CHANNEL register allows for flexibility of configuring
for various PMIC configurations. In combinations where the same slave address
is used for all domains, it is possible to setup the VC channel for the
dependent channels to use the same slave address as the default channel.
Since I2C addressing could be 7 bit or 11 bits as per the I2C specification,
we use the BIT(15) to flag that this should use the default channel's
configuration. Depending on the PMIC and platform used, this can
be populated on the PMIC's datastructure and percolates to VC's configuration.
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vc.c')
-rw-r--r-- | arch/arm/mach-omap2/vc.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index aa9f0bc..0c0e416 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -309,11 +309,21 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) vc->cmd_reg_addr = voltdm->pmic->cmd_reg_addr; vc->setup_time = voltdm->pmic->volt_setup_time; + if ((vc->flags & OMAP_VC_CHANNEL_DEFAULT) && + (vc->i2c_slave_addr == USE_DEFAULT_CHANNEL_I2C_PARAM)) { + pr_err("%s: voltdm %s: default channel " + "bad config-sa=%2x ?\n", __func__, voltdm->name, + vc->i2c_slave_addr); + return; + } + /* 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->cfg_channel |= vc_cfg_bits->sa; + if (vc->i2c_slave_addr != USE_DEFAULT_CHANNEL_I2C_PARAM) { + voltdm->rmw(vc->smps_sa_mask, + vc->i2c_slave_addr << __ffs(vc->smps_sa_mask), + vc->common->smps_sa_reg); + vc->cfg_channel |= vc_cfg_bits->sa; + } /* * Configure the PMIC register addresses. |