From 1b5250ff7160542cc6f4da4dc736281a636b78da Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 6 Jun 2011 12:18:03 -0700 Subject: 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 --- arch/arm/mach-omap2/vc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-omap2/vc.c') 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. -- cgit v1.1