aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-03-22 17:12:37 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 14:39:11 -0400
commite74e44054f8297d60fbd2ed1d412d84055afee8c (patch)
tree2bbfb22023db5153b809653f73bbd0a08ab5ad92 /arch/arm/mach-omap2
parent01f48d308db1cfcfb0151d8d91153fd73e84ae40 (diff)
OMAP2+: VC: support PMICs with separate voltage and command registers
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>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap_twl.c10
-rw-r--r--arch/arm/mach-omap2/vc.c4
-rw-r--r--arch/arm/mach-omap2/voltage.h5
3 files changed, 11 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index 760487bcfca6..3249fe3c3c1d 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -158,7 +158,7 @@ static struct omap_volt_pmic_info omap3_mpu_volt_info = {
158 .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX, 158 .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX,
159 .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, 159 .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
160 .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, 160 .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
161 .pmic_reg = OMAP3_VDD_MPU_SR_CONTROL_REG, 161 .volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG,
162 .vsel_to_uv = twl4030_vsel_to_uv, 162 .vsel_to_uv = twl4030_vsel_to_uv,
163 .uv_to_vsel = twl4030_uv_to_vsel, 163 .uv_to_vsel = twl4030_uv_to_vsel,
164}; 164};
@@ -178,7 +178,7 @@ static struct omap_volt_pmic_info omap3_core_volt_info = {
178 .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX, 178 .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX,
179 .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, 179 .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
180 .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, 180 .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
181 .pmic_reg = OMAP3_VDD_CORE_SR_CONTROL_REG, 181 .volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG,
182 .vsel_to_uv = twl4030_vsel_to_uv, 182 .vsel_to_uv = twl4030_vsel_to_uv,
183 .uv_to_vsel = twl4030_uv_to_vsel, 183 .uv_to_vsel = twl4030_uv_to_vsel,
184}; 184};
@@ -198,7 +198,7 @@ static struct omap_volt_pmic_info omap4_mpu_volt_info = {
198 .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX, 198 .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX,
199 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, 199 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
200 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, 200 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
201 .pmic_reg = OMAP4_VDD_MPU_SR_VOLT_REG, 201 .volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG,
202 .vsel_to_uv = twl6030_vsel_to_uv, 202 .vsel_to_uv = twl6030_vsel_to_uv,
203 .uv_to_vsel = twl6030_uv_to_vsel, 203 .uv_to_vsel = twl6030_uv_to_vsel,
204}; 204};
@@ -218,7 +218,7 @@ static struct omap_volt_pmic_info omap4_iva_volt_info = {
218 .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX, 218 .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX,
219 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, 219 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
220 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, 220 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
221 .pmic_reg = OMAP4_VDD_IVA_SR_VOLT_REG, 221 .volt_reg_addr = OMAP4_VDD_IVA_SR_VOLT_REG,
222 .vsel_to_uv = twl6030_vsel_to_uv, 222 .vsel_to_uv = twl6030_vsel_to_uv,
223 .uv_to_vsel = twl6030_uv_to_vsel, 223 .uv_to_vsel = twl6030_uv_to_vsel,
224}; 224};
@@ -238,7 +238,7 @@ static struct omap_volt_pmic_info omap4_core_volt_info = {
238 .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, 238 .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX,
239 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, 239 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
240 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, 240 .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
241 .pmic_reg = OMAP4_VDD_CORE_SR_VOLT_REG, 241 .volt_reg_addr = OMAP4_VDD_CORE_SR_VOLT_REG,
242 .vsel_to_uv = twl6030_vsel_to_uv, 242 .vsel_to_uv = twl6030_vsel_to_uv,
243 .uv_to_vsel = twl6030_uv_to_vsel, 243 .uv_to_vsel = twl6030_uv_to_vsel,
244}; 244};
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index b62363d9d2b7..1bdbe7c15612 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -115,7 +115,7 @@ int omap_vc_bypass_scale(struct voltagedomain *voltdm,
115 vc_valid = vc->common->valid; 115 vc_valid = vc->common->valid;
116 vc_bypass_val_reg = vc->common->bypass_val_reg; 116 vc_bypass_val_reg = vc->common->bypass_val_reg;
117 vc_bypass_value = (target_vsel << vc->common->data_shift) | 117 vc_bypass_value = (target_vsel << vc->common->data_shift) |
118 (vdd->pmic_info->pmic_reg << 118 (vdd->pmic_info->volt_reg_addr <<
119 vc->common->regaddr_shift) | 119 vc->common->regaddr_shift) |
120 (vdd->pmic_info->i2c_slave_addr << 120 (vdd->pmic_info->i2c_slave_addr <<
121 vc->common->slaveaddr_shift); 121 vc->common->slaveaddr_shift);
@@ -264,7 +264,7 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
264 vc_val = vdd->read_reg(vc->common->prm_mod, 264 vc_val = vdd->read_reg(vc->common->prm_mod,
265 vc->common->smps_volra_reg); 265 vc->common->smps_volra_reg);
266 vc_val &= ~vc->smps_volra_mask; 266 vc_val &= ~vc->smps_volra_mask;
267 vc_val |= vdd->pmic_info->pmic_reg << vc->smps_volra_shift; 267 vc_val |= vdd->pmic_info->volt_reg_addr << vc->smps_volra_shift;
268 vdd->write_reg(vc_val, vc->common->prm_mod, 268 vdd->write_reg(vc_val, vc->common->prm_mod,
269 vc->common->smps_volra_reg); 269 vc->common->smps_volra_reg);
270 270
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index ea6bb98c63f8..5ca30fca114d 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -96,6 +96,8 @@ struct omap_volt_data {
96 * @step_size: PMIC voltage step size (in uv) 96 * @step_size: PMIC voltage step size (in uv)
97 * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV. 97 * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV.
98 * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value. 98 * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value.
99 * @volt_reg_addr: voltage configuration register address
100 * @cmd_reg_addr: command (on, on-LP, ret, off) configuration register address
99 */ 101 */
100struct omap_volt_pmic_info { 102struct omap_volt_pmic_info {
101 int slew_rate; 103 int slew_rate;
@@ -112,7 +114,8 @@ struct omap_volt_pmic_info {
112 u8 vp_vddmax; 114 u8 vp_vddmax;
113 u8 vp_timeout_us; 115 u8 vp_timeout_us;
114 u8 i2c_slave_addr; 116 u8 i2c_slave_addr;
115 u8 pmic_reg; 117 u8 volt_reg_addr;
118 u8 cmd_reg_addr;
116 unsigned long (*vsel_to_uv) (const u8 vsel); 119 unsigned long (*vsel_to_uv) (const u8 vsel);
117 u8 (*uv_to_vsel) (unsigned long uV); 120 u8 (*uv_to_vsel) (unsigned long uV);
118}; 121};