static int __init _config_common_vdd_data(struct voltagedomain *voltdm)
{
- struct omap_vdd_info *vdd = voltdm->vdd;
-
/* Generic voltage parameters */
- vdd->volt_scale = omap_vp_forceupdate_scale;
+ voltdm->scale = omap_vp_forceupdate_scale;
return 0;
}
int omap_voltage_scale_vdd(struct voltagedomain *voltdm,
unsigned long target_volt)
{
- struct omap_vdd_info *vdd;
-
if (!voltdm || IS_ERR(voltdm)) {
pr_warning("%s: VDD specified does not exist!\n", __func__);
return -EINVAL;
}
- vdd = voltdm->vdd;
-
- if (!vdd->volt_scale) {
+ if (!voltdm->scale) {
pr_err("%s: No voltage scale API registered for vdd_%s\n",
__func__, voltdm->name);
return -ENODATA;
}
- return vdd->volt_scale(voltdm, target_volt);
+ return voltdm->scale(voltdm, target_volt);
}
/**
* defined in voltage.h
*/
void omap_change_voltscale_method(struct voltagedomain *voltdm,
- int voltscale_method)
+ int voltscale_method)
{
- struct omap_vdd_info *vdd;
-
if (!voltdm || IS_ERR(voltdm)) {
pr_warning("%s: VDD specified does not exist!\n", __func__);
return;
}
- vdd = voltdm->vdd;
-
switch (voltscale_method) {
case VOLTSCALE_VPFORCEUPDATE:
- vdd->volt_scale = omap_vp_forceupdate_scale;
+ voltdm->scale = omap_vp_forceupdate_scale;
return;
case VOLTSCALE_VCBYPASS:
- vdd->volt_scale = omap_vc_bypass_scale;
+ voltdm->scale = omap_vc_bypass_scale;
return;
default:
pr_warning("%s: Trying to change the method of voltage scaling"
clk_put(sys_ck);
if (voltdm->vc) {
- voltdm->vdd->volt_scale = omap_vc_bypass_scale;
+ voltdm->scale = omap_vc_bypass_scale;
omap_vc_init_channel(voltdm);
}
* @read: read-modify-write a VC/VP register
* @sys_clk: system clock name/frequency, used for various timing calculations
* @vdd: to be removed
+ * @scale: function used to scale the voltage of the voltagedomain
*/
struct voltagedomain {
char *name;
u32 rate;
} sys_clk;
+ int (*scale) (struct voltagedomain *voltdm,
+ unsigned long target_volt);
+
struct omap_vdd_info *vdd;
};
* @volt_data : voltage table having the distinct voltages supported
* by the domain and other associated per voltage data.
* @curr_volt : current voltage for this vdd.
- * @volt_scale : API to scale the voltage of the vdd.
*/
struct omap_vdd_info {
struct omap_volt_data *volt_data;
u32 curr_volt;
-
- int (*volt_scale) (struct voltagedomain *voltdm,
- unsigned long target_volt);
};
int omap_voltage_scale_vdd(struct voltagedomain *voltdm,