Skip to content

Commit

Permalink
SmartReflex: allow to disable SR calibrations
Browse files Browse the repository at this point in the history
Based on steven676's work for encore.

[steven@steven676.net: add voltdm->name to log message]
  • Loading branch information
sconosciuto authored and steven676 committed Sep 21, 2013
1 parent f63dd8b commit 11e01a3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
16 changes: 15 additions & 1 deletion arch/arm/mach-omap2/smartreflex-class1p5.c
Expand Up @@ -291,7 +291,14 @@ static void sr_class1p5_calib_work(struct work_struct *work)
u_volt_margin = volt_data->volt_margin;
}

u_volt_safe += u_volt_margin;
if (u_volt_margin & SR1P5_MARGIN_DISABLE_SR) {
/* XXX This should be impossible! */
pr_err("%s: SR calibration ran for %s OPP with vnom %d"
"for which SR was disabled??!\n", __func__,
voltdm->name, volt_data->volt_nominal);
} else {
u_volt_safe += u_volt_margin;
}
}

if (u_volt_safe > volt_data->volt_nominal) {
Expand Down Expand Up @@ -420,6 +427,13 @@ static int sr_class1p5_enable(struct voltagedomain *voltdm,
return -EINVAL;
}

/* SR is disabled for this OPP, don't calibrate */
if (volt_data->volt_margin == SR1P5_MARGIN_DISABLE_SR) {
pr_info_once("%s: %s: SR is disabled for this OPP, volt_nominal=%d\n",
__func__, voltdm->name, volt_data->volt_nominal);
return 0;
}

/* If already calibrated, nothing to do here.. */
if (volt_data->volt_calibrated)
return 0;
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-omap2/voltage.h
Expand Up @@ -161,6 +161,13 @@ struct omap_volt_data {
int abb_type;
};

/*
* XXX HACK
* Special volt_margin value to set to disable SmartReflex class 1.5
* calibration entirely for a particular voltage.
*/
#define SR1P5_MARGIN_DISABLE_SR (1 << 31)

/*
* Introduced in OMAP4, is a concept of a default channel - in OMAP4, this
* channel is MPU, all other domains such as IVA/CORE, could optionally
Expand Down

0 comments on commit 11e01a3

Please sign in to comment.