@@ -9,6 +9,28 @@
#include "prm-regbits-44xx.h"
#include "prm44xx.h"
+unsigned long omap_vp_get_init_voltage(struct voltagedomain *voltdm)
+{
+ struct omap_vp_instance *vp = voltdm->vp;
+ u32 vpconfig;
+ u8 vsel;
+ unsigned long volt;
+
+ /* sanity */
+ if (!voltdm->pmic || !voltdm->pmic->vsel_to_uv
+ || !voltdm->read || !voltdm->write)
+ return 0;
+
+ vpconfig = voltdm->read(vp->vpconfig);
+ vpconfig &= vp->common->vpconfig_initvoltage_mask;
+
+ vsel = vpconfig >> __ffs(vp->common->vpconfig_initvoltage_mask);
+
+ volt = voltdm->pmic->vsel_to_uv(vsel);
+
+ return volt;
+}
+
static u32 _vp_set_init_voltage(struct voltagedomain *voltdm, u32 volt)
{
struct omap_vp_instance *vp = voltdm->vp;
@@ -120,6 +120,7 @@ extern struct omap_vp_instance omap4_vp_core;
void omap_vp_init(struct voltagedomain *voltdm);
void omap_vp_enable(struct voltagedomain *voltdm);
void omap_vp_disable(struct voltagedomain *voltdm);
+unsigned long omap_vp_get_init_voltage(struct voltagedomain *voltdm);
int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
unsigned long target_volt);
int omap_vp_update_errorgain(struct voltagedomain *voltdm,