Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272748
b: refs/heads/master
c: 0f01565
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hilman committed Sep 15, 2011
1 parent c70c95c commit 7f8be76
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 667216d6a435a27f5aed64aa30de583ddccc58c8
refs/heads/master: 0f01565a353e06f1f1d7757b212c51e61c6fea58
24 changes: 7 additions & 17 deletions trunk/arch/arm/mach-omap2/voltage.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ static LIST_HEAD(voltdm_list);

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;
}
Expand Down Expand Up @@ -107,22 +105,18 @@ unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm)
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);
}

/**
Expand Down Expand Up @@ -258,23 +252,19 @@ int omap_voltage_register_pmic(struct voltagedomain *voltdm,
* 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"
Expand Down Expand Up @@ -315,7 +305,7 @@ int __init omap_voltage_late_init(void)
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);
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/arm/mach-omap2/voltage.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct omap_vfsm_instance {
* @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;
Expand All @@ -82,6 +83,9 @@ struct voltagedomain {
u32 rate;
} sys_clk;

int (*scale) (struct voltagedomain *voltdm,
unsigned long target_volt);

struct omap_vdd_info *vdd;
};

Expand Down Expand Up @@ -145,14 +149,10 @@ struct omap_voltdm_pmic {
* @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,
Expand Down

0 comments on commit 7f8be76

Please sign in to comment.