]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
OMAP2+: VC: support PMICs with separate voltage and command registers
authorKevin Hilman <khilman@ti.com>
Tue, 22 Mar 2011 21:12:37 +0000 (14:12 -0700)
committerKevin Hilman <khilman@ti.com>
Thu, 15 Sep 2011 18:39:11 +0000 (11:39 -0700)
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>
arch/arm/mach-omap2/omap_twl.c
arch/arm/mach-omap2/vc.c
arch/arm/mach-omap2/voltage.h

index 760487bcfca62706a5246c9fb5bbc1451f9cb382..3249fe3c3c1db8cca43c05cb9c17c93332a77fb0 100644 (file)
@@ -158,7 +158,7 @@ static struct omap_volt_pmic_info omap3_mpu_volt_info = {
        .vp_vddmax              = OMAP3430_VP1_VLIMITTO_VDDMAX,
        .vp_timeout_us          = OMAP3_VP_VLIMITTO_TIMEOUT_US,
        .i2c_slave_addr         = OMAP3_SRI2C_SLAVE_ADDR,
-       .pmic_reg               = OMAP3_VDD_MPU_SR_CONTROL_REG,
+       .volt_reg_addr          = OMAP3_VDD_MPU_SR_CONTROL_REG,
        .vsel_to_uv             = twl4030_vsel_to_uv,
        .uv_to_vsel             = twl4030_uv_to_vsel,
 };
@@ -178,7 +178,7 @@ static struct omap_volt_pmic_info omap3_core_volt_info = {
        .vp_vddmax              = OMAP3430_VP2_VLIMITTO_VDDMAX,
        .vp_timeout_us          = OMAP3_VP_VLIMITTO_TIMEOUT_US,
        .i2c_slave_addr         = OMAP3_SRI2C_SLAVE_ADDR,
-       .pmic_reg               = OMAP3_VDD_CORE_SR_CONTROL_REG,
+       .volt_reg_addr          = OMAP3_VDD_CORE_SR_CONTROL_REG,
        .vsel_to_uv             = twl4030_vsel_to_uv,
        .uv_to_vsel             = twl4030_uv_to_vsel,
 };
@@ -198,7 +198,7 @@ static struct omap_volt_pmic_info omap4_mpu_volt_info = {
        .vp_vddmax              = OMAP4_VP_MPU_VLIMITTO_VDDMAX,
        .vp_timeout_us          = OMAP4_VP_VLIMITTO_TIMEOUT_US,
        .i2c_slave_addr         = OMAP4_SRI2C_SLAVE_ADDR,
-       .pmic_reg               = OMAP4_VDD_MPU_SR_VOLT_REG,
+       .volt_reg_addr          = OMAP4_VDD_MPU_SR_VOLT_REG,
        .vsel_to_uv             = twl6030_vsel_to_uv,
        .uv_to_vsel             = twl6030_uv_to_vsel,
 };
@@ -218,7 +218,7 @@ static struct omap_volt_pmic_info omap4_iva_volt_info = {
        .vp_vddmax              = OMAP4_VP_IVA_VLIMITTO_VDDMAX,
        .vp_timeout_us          = OMAP4_VP_VLIMITTO_TIMEOUT_US,
        .i2c_slave_addr         = OMAP4_SRI2C_SLAVE_ADDR,
-       .pmic_reg               = OMAP4_VDD_IVA_SR_VOLT_REG,
+       .volt_reg_addr          = OMAP4_VDD_IVA_SR_VOLT_REG,
        .vsel_to_uv             = twl6030_vsel_to_uv,
        .uv_to_vsel             = twl6030_uv_to_vsel,
 };
@@ -238,7 +238,7 @@ static struct omap_volt_pmic_info omap4_core_volt_info = {
        .vp_vddmax              = OMAP4_VP_CORE_VLIMITTO_VDDMAX,
        .vp_timeout_us          = OMAP4_VP_VLIMITTO_TIMEOUT_US,
        .i2c_slave_addr         = OMAP4_SRI2C_SLAVE_ADDR,
-       .pmic_reg               = OMAP4_VDD_CORE_SR_VOLT_REG,
+       .volt_reg_addr          = OMAP4_VDD_CORE_SR_VOLT_REG,
        .vsel_to_uv             = twl6030_vsel_to_uv,
        .uv_to_vsel             = twl6030_uv_to_vsel,
 };
index b62363d9d2b7c438c2adb6817a09095c7492a4c2..1bdbe7c15612ad070f796ac3052123f5e5ac13d9 100644 (file)
@@ -115,7 +115,7 @@ int omap_vc_bypass_scale(struct voltagedomain *voltdm,
        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 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
        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);
 
index ea6bb98c63f8428012f02dcbba90c716aed1232a..5ca30fca114d1ca0da66bfa9b87af771098f7f41 100644 (file)
@@ -96,6 +96,8 @@ struct omap_volt_data {
  * @step_size: PMIC voltage step size (in uv)
  * @vsel_to_uv:        PMIC API to convert vsel value to actual voltage in uV.
  * @uv_to_vsel:        PMIC API to convert voltage in uV to vsel value.
+ * @volt_reg_addr: voltage configuration register address
+ * @cmd_reg_addr: command (on, on-LP, ret, off) configuration register address
  */
 struct omap_volt_pmic_info {
        int slew_rate;
@@ -112,7 +114,8 @@ struct omap_volt_pmic_info {
        u8 vp_vddmax;
        u8 vp_timeout_us;
        u8 i2c_slave_addr;
-       u8 pmic_reg;
+       u8 volt_reg_addr;
+       u8 cmd_reg_addr;
        unsigned long (*vsel_to_uv) (const u8 vsel);
        u8 (*uv_to_vsel) (unsigned long uV);
 };