Lines Matching full:vp
8 #include "vp.h"
15 struct omap_vp_instance *vp = voltdm->vp; in _vp_set_init_voltage() local
21 vpconfig = voltdm->read(vp->vpconfig); in _vp_set_init_voltage()
22 vpconfig &= ~(vp->common->vpconfig_initvoltage_mask | in _vp_set_init_voltage()
23 vp->common->vpconfig_forceupdate | in _vp_set_init_voltage()
24 vp->common->vpconfig_initvdd); in _vp_set_init_voltage()
25 vpconfig |= vsel << __ffs(vp->common->vpconfig_initvoltage_mask); in _vp_set_init_voltage()
26 voltdm->write(vpconfig, vp->vpconfig); in _vp_set_init_voltage()
29 voltdm->write((vpconfig | vp->common->vpconfig_initvdd), in _vp_set_init_voltage()
30 vp->vpconfig); in _vp_set_init_voltage()
33 voltdm->write(vpconfig, vp->vpconfig); in _vp_set_init_voltage()
41 struct omap_vp_instance *vp = voltdm->vp; in omap_vp_init() local
56 vp->enabled = false; in omap_vp_init()
77 __ffs(voltdm->vp->common->vpconfig_erroroffset_mask)) | in omap_vp_init()
78 vp->common->vpconfig_timeouten; in omap_vp_init()
79 voltdm->write(val, vp->vpconfig); in omap_vp_init()
82 val = (waittime << vp->common->vstepmin_smpswaittimemin_shift) | in omap_vp_init()
83 (vstepmin << vp->common->vstepmin_stepmin_shift); in omap_vp_init()
84 voltdm->write(val, vp->vstepmin); in omap_vp_init()
87 val = (vstepmax << vp->common->vstepmax_stepmax_shift) | in omap_vp_init()
88 (waittime << vp->common->vstepmax_smpswaittimemax_shift); in omap_vp_init()
89 voltdm->write(val, vp->vstepmax); in omap_vp_init()
92 val = (vddmax << vp->common->vlimitto_vddmax_shift) | in omap_vp_init()
93 (vddmin << vp->common->vlimitto_vddmin_shift) | in omap_vp_init()
94 (timeout << vp->common->vlimitto_timeout_shift); in omap_vp_init()
95 voltdm->write(val, vp->vlimitto); in omap_vp_init()
103 if (!voltdm->vp) in omap_vp_update_errorgain()
111 /* Setting vp errorgain based on the voltage */ in omap_vp_update_errorgain()
112 voltdm->rmw(voltdm->vp->common->vpconfig_errorgain_mask, in omap_vp_update_errorgain()
114 __ffs(voltdm->vp->common->vpconfig_errorgain_mask), in omap_vp_update_errorgain()
115 voltdm->vp->vpconfig); in omap_vp_update_errorgain()
120 /* VP force update method of voltage scaling */
124 struct omap_vp_instance *vp = voltdm->vp; in omap_vp_forceupdate_scale() local
138 vp->common->ops->clear_txdone(vp->id); in omap_vp_forceupdate_scale()
139 if (!vp->common->ops->check_txdone(vp->id)) in omap_vp_forceupdate_scale()
152 voltdm->write(vpconfig | vp->common->vpconfig_forceupdate, in omap_vp_forceupdate_scale()
153 voltdm->vp->vpconfig); in omap_vp_forceupdate_scale()
160 omap_test_timeout(vp->common->ops->check_txdone(vp->id), in omap_vp_forceupdate_scale()
174 vp->common->ops->clear_txdone(vp->id); in omap_vp_forceupdate_scale()
175 if (!vp->common->ops->check_txdone(vp->id)) in omap_vp_forceupdate_scale()
185 voltdm->write(vpconfig, vp->vpconfig); in omap_vp_forceupdate_scale()
191 * omap_vp_enable() - API to enable a particular VP
192 * @voltdm: pointer to the VDD whose VP is to be enabled.
199 struct omap_vp_instance *vp; in omap_vp_enable() local
207 vp = voltdm->vp; in omap_vp_enable()
214 /* If VP is already enabled, do nothing. Return */ in omap_vp_enable()
215 if (vp->enabled) in omap_vp_enable()
227 /* Enable VP */ in omap_vp_enable()
228 vpconfig |= vp->common->vpconfig_vpenable; in omap_vp_enable()
229 voltdm->write(vpconfig, vp->vpconfig); in omap_vp_enable()
231 vp->enabled = true; in omap_vp_enable()
235 * omap_vp_disable() - API to disable a particular VP
236 * @voltdm: pointer to the VDD whose VP is to be disabled.
243 struct omap_vp_instance *vp; in omap_vp_disable() local
252 vp = voltdm->vp; in omap_vp_disable()
259 /* If VP is already disabled, do nothing. Return */ in omap_vp_disable()
260 if (!vp->enabled) { in omap_vp_disable()
261 pr_warn("%s: Trying to disable VP for vdd_%s when it is already disabled\n", in omap_vp_disable()
266 /* Disable VP */ in omap_vp_disable()
267 vpconfig = voltdm->read(vp->vpconfig); in omap_vp_disable()
268 vpconfig &= ~vp->common->vpconfig_vpenable; in omap_vp_disable()
269 voltdm->write(vpconfig, vp->vpconfig); in omap_vp_disable()
272 * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us in omap_vp_disable()
274 omap_test_timeout((voltdm->read(vp->vstatus)), in omap_vp_disable()
280 vp->enabled = false; in omap_vp_disable()