diff options
author | Todd Poynor <toddpoynor@google.com> | 2011-05-27 22:15:59 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 15:09:08 -0400 |
commit | bea30ed65fb2432097f362ce17042e22febcb616 (patch) | |
tree | b4bb15f0099e1d7e0fbe7ef5920491f6f388f5bd /arch/arm | |
parent | 0f01565a353e06f1f1d7757b212c51e61c6fea58 (diff) |
OMAP: VP: Explicitly mask VPVOLTAGE field
Reading the VPVOLTAGE field of PRM_VP_*_VOLTAGE registers currently
relies on a u32 -> u8 conversion to mask off the FORCEUPDATEWAIT field
in the upper bits. Make this explicit using the mask symbol
already defined, added as a new field in struct omap_vp_common.
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/vp.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/vp.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/vp3xxx_data.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/vp44xx_data.c | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index e7d38f67db87..38076205312e 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c | |||
@@ -227,7 +227,8 @@ unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm) | |||
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | 229 | ||
230 | curr_vsel = voltdm->read(vp->voltage); | 230 | curr_vsel = (voltdm->read(vp->voltage) & vp->common->vpvoltage_mask) |
231 | >> __ffs(vp->common->vpvoltage_mask); | ||
231 | 232 | ||
232 | if (!voltdm->pmic || !voltdm->pmic->vsel_to_uv) { | 233 | if (!voltdm->pmic || !voltdm->pmic->vsel_to_uv) { |
233 | pr_warning("%s: PMIC function to convert vsel to voltage" | 234 | pr_warning("%s: PMIC function to convert vsel to voltage" |
diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h index 96bbb23d2de2..7dc5cb3cd60c 100644 --- a/arch/arm/mach-omap2/vp.h +++ b/arch/arm/mach-omap2/vp.h | |||
@@ -63,6 +63,7 @@ struct omap_vp_ops { | |||
63 | * @vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg | 63 | * @vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg |
64 | * @vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg | 64 | * @vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg |
65 | * @vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg | 65 | * @vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg |
66 | * @vpvoltage_mask: VPVOLTAGE field mask in PRM_VP*_VOLTAGE reg | ||
66 | */ | 67 | */ |
67 | struct omap_vp_common { | 68 | struct omap_vp_common { |
68 | u32 vpconfig_erroroffset_mask; | 69 | u32 vpconfig_erroroffset_mask; |
@@ -79,6 +80,7 @@ struct omap_vp_common { | |||
79 | u8 vlimitto_vddmin_shift; | 80 | u8 vlimitto_vddmin_shift; |
80 | u8 vlimitto_vddmax_shift; | 81 | u8 vlimitto_vddmax_shift; |
81 | u8 vlimitto_timeout_shift; | 82 | u8 vlimitto_timeout_shift; |
83 | u8 vpvoltage_mask; | ||
82 | 84 | ||
83 | const struct omap_vp_ops *ops; | 85 | const struct omap_vp_ops *ops; |
84 | }; | 86 | }; |
diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c index d429c447eef0..260c554b1547 100644 --- a/arch/arm/mach-omap2/vp3xxx_data.c +++ b/arch/arm/mach-omap2/vp3xxx_data.c | |||
@@ -51,6 +51,8 @@ static const struct omap_vp_common omap3_vp_common = { | |||
51 | .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, | 51 | .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, |
52 | .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, | 52 | .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, |
53 | .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, | 53 | .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, |
54 | .vpvoltage_mask = OMAP3430_VPVOLTAGE_MASK, | ||
55 | |||
54 | .ops = &omap3_vp_ops, | 56 | .ops = &omap3_vp_ops, |
55 | }; | 57 | }; |
56 | 58 | ||
diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c index 0daf2a47dc28..b4e77044891e 100644 --- a/arch/arm/mach-omap2/vp44xx_data.c +++ b/arch/arm/mach-omap2/vp44xx_data.c | |||
@@ -51,6 +51,7 @@ static const struct omap_vp_common omap4_vp_common = { | |||
51 | .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT, | 51 | .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT, |
52 | .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT, | 52 | .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT, |
53 | .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT, | 53 | .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT, |
54 | .vpvoltage_mask = OMAP4430_VPVOLTAGE_MASK, | ||
54 | .ops = &omap4_vp_ops, | 55 | .ops = &omap4_vp_ops, |
55 | }; | 56 | }; |
56 | 57 | ||