diff options
author | Kevin Hilman <khilman@ti.com> | 2011-04-05 18:15:31 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-09-15 15:09:08 -0400 |
commit | 76ea7424f80350884b4d70ae54cfa51f7f9b2a48 (patch) | |
tree | 933d9d3590c21860fcf02fd594b0a5db46c60252 /arch/arm/mach-omap2/vp.c | |
parent | 6f56727383ca3233f40af5e792a08bf07b18f5fd (diff) |
OMAP3+: VP: create VP helper function for updating error gain
Create new helper function in VP layer for updating VP error gain.
Currently used during pre-scale for VP force update and VC bypass.
TODO: determine if this can be removed from the pre-scale path and
moved to VP enable path.
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/vp.c')
-rw-r--r-- | arch/arm/mach-omap2/vp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index ea61a47bd199..f68a6db27111 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c | |||
@@ -106,6 +106,25 @@ void __init omap_vp_init(struct voltagedomain *voltdm) | |||
106 | voltdm->write(vp_val, vp->vlimitto); | 106 | voltdm->write(vp_val, vp->vlimitto); |
107 | } | 107 | } |
108 | 108 | ||
109 | int omap_vp_update_errorgain(struct voltagedomain *voltdm, | ||
110 | unsigned long target_volt) | ||
111 | { | ||
112 | struct omap_volt_data *volt_data; | ||
113 | |||
114 | /* Get volt_data corresponding to target_volt */ | ||
115 | volt_data = omap_voltage_get_voltdata(voltdm, target_volt); | ||
116 | if (IS_ERR(volt_data)) | ||
117 | return -EINVAL; | ||
118 | |||
119 | /* Setting vp errorgain based on the voltage */ | ||
120 | voltdm->rmw(voltdm->vp->common->vpconfig_errorgain_mask, | ||
121 | volt_data->vp_errgain << | ||
122 | __ffs(voltdm->vp->common->vpconfig_errorgain_mask), | ||
123 | voltdm->vp->vpconfig); | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
109 | /* VP force update method of voltage scaling */ | 128 | /* VP force update method of voltage scaling */ |
110 | int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, | 129 | int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, |
111 | unsigned long target_volt) | 130 | unsigned long target_volt) |