Skip to content

Commit

Permalink
ARM: vexpress/TC2: Convert OPP voltage to uV before storing
Browse files Browse the repository at this point in the history
The SPC stores voltage in mV while the code assumes it was returning
uV. Convert the returned voltage to uV before storing. Also fix the
comment depicting voltage to uV.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
  • Loading branch information
Punit Agrawal authored and Pawel Moll committed Apr 24, 2014
1 parent d08b803 commit cf2e0a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-vexpress/spc.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static irqreturn_t ve_spc_irq_handler(int irq, void *data)
* +--------------------------+
* | 31 20 | 19 0 |
* +--------------------------+
* | u_volt | freq(kHz) |
* | m_volt | freq(kHz) |
* +--------------------------+
*/
#define MULT_FACTOR 20
Expand All @@ -414,7 +414,7 @@ static int ve_spc_populate_opps(uint32_t cluster)
ret = ve_spc_read_sys_cfg(SYSCFG_SCC, off, &data);
if (!ret) {
opps->freq = (data & FREQ_MASK) * MULT_FACTOR;
opps->u_volt = data >> VOLT_SHIFT;
opps->u_volt = (data >> VOLT_SHIFT) * 1000;
} else {
break;
}
Expand Down

0 comments on commit cf2e0a7

Please sign in to comment.