aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/vc.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-03-30 14:01:10 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:08:57 -0400
commitce8ebe0dfb1f8713337cebf82499d3dced288328 (patch)
tree3ffb4cac949459b9feda4f307d4d9b51b0da3a5c /arch/arm/mach-omap2/vc.c
parent24d3194a2c9bc4d2315117915d4d22c395c07fd5 (diff)
OMAP3+: voltage domain: move PMIC struct from vdd_info into struct voltagedomain
Move structure containing PMIC configurable settings into struct voltagedomain. In the process, rename from omap_volt_pmic_info to omap_voltdm_pmic (_info suffix is not helpful.) No functional changes. 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.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 1791f79112bf..4ac761440d62 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -79,13 +79,13 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
79 vp_common = vdd->vp_data->vp_common; 79 vp_common = vdd->vp_data->vp_common;
80 80
81 /* Check if sufficient pmic info is available for this vdd */ 81 /* Check if sufficient pmic info is available for this vdd */
82 if (!vdd->pmic_info) { 82 if (!voltdm->pmic) {
83 pr_err("%s: Insufficient pmic info to scale the vdd_%s\n", 83 pr_err("%s: Insufficient pmic info to scale the vdd_%s\n",
84 __func__, voltdm->name); 84 __func__, voltdm->name);
85 return -EINVAL; 85 return -EINVAL;
86 } 86 }
87 87
88 if (!vdd->pmic_info->uv_to_vsel) { 88 if (!voltdm->pmic->uv_to_vsel) {
89 pr_err("%s: PMIC function to convert voltage in uV to" 89 pr_err("%s: PMIC function to convert voltage in uV to"
90 "vsel not registered. Hence unable to scale voltage" 90 "vsel not registered. Hence unable to scale voltage"
91 "for vdd_%s\n", __func__, voltdm->name); 91 "for vdd_%s\n", __func__, voltdm->name);
@@ -103,7 +103,7 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
103 if (IS_ERR(volt_data)) 103 if (IS_ERR(volt_data))
104 volt_data = NULL; 104 volt_data = NULL;
105 105
106 *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt); 106 *target_vsel = voltdm->pmic->uv_to_vsel(target_volt);
107 *current_vsel = voltdm->read(vdd->vp_data->voltage); 107 *current_vsel = voltdm->read(vdd->vp_data->voltage);
108 108
109 /* Setting the ON voltage to the new target voltage */ 109 /* Setting the ON voltage to the new target voltage */
@@ -134,8 +134,8 @@ void omap_vc_post_scale(struct voltagedomain *voltdm,
134 134
135 smps_steps = abs(target_vsel - current_vsel); 135 smps_steps = abs(target_vsel - current_vsel);
136 /* SMPS slew rate / step size. 2us added as buffer. */ 136 /* SMPS slew rate / step size. 2us added as buffer. */
137 smps_delay = ((smps_steps * vdd->pmic_info->step_size) / 137 smps_delay = ((smps_steps * voltdm->pmic->step_size) /
138 vdd->pmic_info->slew_rate) + 2; 138 voltdm->pmic->slew_rate) + 2;
139 udelay(smps_delay); 139 udelay(smps_delay);
140 140
141 vdd->curr_volt = target_volt; 141 vdd->curr_volt = target_volt;
@@ -240,11 +240,10 @@ static void __init omap4_vc_init_channel(struct voltagedomain *voltdm)
240void __init omap_vc_init_channel(struct voltagedomain *voltdm) 240void __init omap_vc_init_channel(struct voltagedomain *voltdm)
241{ 241{
242 struct omap_vc_channel *vc = voltdm->vc; 242 struct omap_vc_channel *vc = voltdm->vc;
243 struct omap_vdd_info *vdd = voltdm->vdd;
244 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; 243 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
245 u32 val; 244 u32 val;
246 245
247 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { 246 if (!voltdm->pmic || !voltdm->pmic->uv_to_vsel) {
248 pr_err("%s: PMIC info requried to configure vc for" 247 pr_err("%s: PMIC info requried to configure vc for"
249 "vdd_%s not populated.Hence cannot initialize vc\n", 248 "vdd_%s not populated.Hence cannot initialize vc\n",
250 __func__, voltdm->name); 249 __func__, voltdm->name);
@@ -260,10 +259,10 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
260 vc->cfg_channel = 0; 259 vc->cfg_channel = 0;
261 260
262 /* get PMIC/board specific settings */ 261 /* get PMIC/board specific settings */
263 vc->i2c_slave_addr = vdd->pmic_info->i2c_slave_addr; 262 vc->i2c_slave_addr = voltdm->pmic->i2c_slave_addr;
264 vc->volt_reg_addr = vdd->pmic_info->volt_reg_addr; 263 vc->volt_reg_addr = voltdm->pmic->volt_reg_addr;
265 vc->cmd_reg_addr = vdd->pmic_info->cmd_reg_addr; 264 vc->cmd_reg_addr = voltdm->pmic->cmd_reg_addr;
266 vc->setup_time = vdd->pmic_info->volt_setup_time; 265 vc->setup_time = voltdm->pmic->volt_setup_time;
267 266
268 /* Configure the i2c slave address for this VC */ 267 /* Configure the i2c slave address for this VC */
269 voltdm->rmw(vc->smps_sa_mask, 268 voltdm->rmw(vc->smps_sa_mask,
@@ -287,10 +286,10 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
287 } 286 }
288 287
289 /* Set up the on, inactive, retention and off voltage */ 288 /* Set up the on, inactive, retention and off voltage */
290 on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); 289 on_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->on_volt);
291 onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); 290 onlp_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->onlp_volt);
292 ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); 291 ret_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->ret_volt);
293 off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); 292 off_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->off_volt);
294 val = ((on_vsel << vc->common->cmd_on_shift) | 293 val = ((on_vsel << vc->common->cmd_on_shift) |
295 (onlp_vsel << vc->common->cmd_onlp_shift) | 294 (onlp_vsel << vc->common->cmd_onlp_shift) |
296 (ret_vsel << vc->common->cmd_ret_shift) | 295 (ret_vsel << vc->common->cmd_ret_shift) |