diff options
author | Kevin Hilman <khilman@ti.com> | 2011-03-29 17:36:04 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 15:08:19 -0400 |
commit | 5892bb1fc6430d086f5c2a4216f9ed00070e31ad (patch) | |
tree | 6a64fdd3e6d4e80cae63c1fa3c947383b1024d7e /arch/arm/mach-omap2/vc.c | |
parent | 78614e0f8f32dca52beebaadfb53c2a3acf1604a (diff) |
OMAP3+: VC: cleanup voltage setup time configuration
- add setup_time field to struct omap_vc_channel (init'd from PMIC data)
- use VC/VP register access helper for read/modify/write
- move VFSM structure from omap_vdd_info into struct voltagedomain
- remove redunant _data suffix from VFSM structures and variables
- remove voltsetup_shift, use ffs() on the mask value to find the shift
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.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 8f0105a7bb4b..f78e62abe720 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c | |||
@@ -223,7 +223,6 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) | |||
223 | { | 223 | { |
224 | struct omap_vc_channel *vc = voltdm->vc; | 224 | struct omap_vc_channel *vc = voltdm->vc; |
225 | struct omap_vdd_info *vdd = voltdm->vdd; | 225 | struct omap_vdd_info *vdd = voltdm->vdd; |
226 | u32 vc_val; | ||
227 | 226 | ||
228 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { | 227 | if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { |
229 | pr_err("%s: PMIC info requried to configure vc for" | 228 | pr_err("%s: PMIC info requried to configure vc for" |
@@ -242,6 +241,7 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) | |||
242 | vc->i2c_slave_addr = vdd->pmic_info->i2c_slave_addr; | 241 | vc->i2c_slave_addr = vdd->pmic_info->i2c_slave_addr; |
243 | vc->volt_reg_addr = vdd->pmic_info->volt_reg_addr; | 242 | vc->volt_reg_addr = vdd->pmic_info->volt_reg_addr; |
244 | vc->cmd_reg_addr = vdd->pmic_info->cmd_reg_addr; | 243 | vc->cmd_reg_addr = vdd->pmic_info->cmd_reg_addr; |
244 | vc->setup_time = vdd->pmic_info->volt_setup_time; | ||
245 | 245 | ||
246 | /* Configure the i2c slave address for this VC */ | 246 | /* Configure the i2c slave address for this VC */ |
247 | voltdm->rmw(vc->smps_sa_mask, | 247 | voltdm->rmw(vc->smps_sa_mask, |
@@ -260,11 +260,9 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) | |||
260 | vc->common->smps_cmdra_reg); | 260 | vc->common->smps_cmdra_reg); |
261 | 261 | ||
262 | /* Configure the setup times */ | 262 | /* Configure the setup times */ |
263 | vc_val = voltdm->read(vdd->vfsm->voltsetup_reg); | 263 | voltdm->rmw(voltdm->vfsm->voltsetup_mask, |
264 | vc_val &= ~vdd->vfsm->voltsetup_mask; | 264 | vc->setup_time << __ffs(voltdm->vfsm->voltsetup_mask), |
265 | vc_val |= vdd->pmic_info->volt_setup_time << | 265 | voltdm->vfsm->voltsetup_reg); |
266 | vdd->vfsm->voltsetup_shift; | ||
267 | voltdm->write(vc_val, vdd->vfsm->voltsetup_reg); | ||
268 | 266 | ||
269 | if (cpu_is_omap34xx()) | 267 | if (cpu_is_omap34xx()) |
270 | omap3_vc_init_channel(voltdm); | 268 | omap3_vc_init_channel(voltdm); |