From: Jason Liu Date: Wed, 15 Feb 2012 10:34:41 +0000 (+0800) Subject: ENGR00174540: i.mx6: anatop_regulator: LDO voltage print not correctly X-Git-Tag: v3.0.35-fsl_4.1.0~1620 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=27ed4ce8ae67ba67da753944a31037b6371d597f;p=karo-tx-linux.git ENGR00174540: i.mx6: anatop_regulator: LDO voltage print not correctly The LDO voltage constraint not printed correctly: print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal print_constraints: vddsoc: 725 <--> 1300 mV at 700 mV fast normal print_constraints: vdd2p5: 2000 <--> 2775 mV at 2000 mV fast normal print_constraints: vdd1p1: 800 <--> 1400 mV at 700 mV fast normal print_constraints: vdd3p0: 2800 <--> 3150 mV at 2625 mV fast normal There due to one typo: << in the code, thus will make the LDO constraint print not correctly, the patch will make the print correctly as the followings: print_constraints: vddpu: 725 <--> 1300 mV at 1100 mV fast normal print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal print_constraints: vdd3p0: 2800 <--> 3150 mV at 3000 mV fast normal Signed-off-by: Jason Liu --- diff --git a/arch/arm/mach-mx6/mx6_anatop_regulator.c b/arch/arm/mach-mx6/mx6_anatop_regulator.c index 89c053a00f71..fd7e0c3fbdee 100644 --- a/arch/arm/mach-mx6/mx6_anatop_regulator.c +++ b/arch/arm/mach-mx6/mx6_anatop_regulator.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -44,7 +44,7 @@ static int get_voltage(struct anatop_regulator *sreg) struct anatop_regulator_data *rdata = sreg->rdata; if (sreg->rdata->control_reg) { - u32 val = (__raw_readl(rdata->control_reg) << + u32 val = (__raw_readl(rdata->control_reg) >> rdata->vol_bit_shift) & rdata->vol_bit_mask; uv = rdata->min_voltage + (val - rdata->min_bit_val) * 25000; pr_debug("vddio = %d, val=%u\n", uv, val);