diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-03-10 20:50:07 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-03-22 15:44:45 -0400 |
commit | 451a73cd46573444f68f412c87439c0a291718ec (patch) | |
tree | 3cf24100680cdcfad0fc7cf5b0dd0320f2092e3d /drivers/regulator/lp3971.c | |
parent | cdb868f58103825856e27aa4e1f26943fc119e41 (diff) |
lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
Given x=0,1,2, current implementation of BUCK_VOL_CHANGE_SHIFT(x) returns 0,4,8.
The correct return value should be 0,4,6.
This patch fix the logic.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/lp3971.c')
-rw-r--r-- | drivers/regulator/lp3971.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index 8bdcf41ab68c..b20b3e1d821a 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c | |||
@@ -45,7 +45,7 @@ static int lp3971_set_bits(struct lp3971 *lp3971, u8 reg, u16 mask, u16 val); | |||
45 | LP3971_BUCK2 -> 4 | 45 | LP3971_BUCK2 -> 4 |
46 | LP3971_BUCK3 -> 6 | 46 | LP3971_BUCK3 -> 6 |
47 | */ | 47 | */ |
48 | #define BUCK_VOL_CHANGE_SHIFT(x) (((1 << x) & ~0x01) << 1) | 48 | #define BUCK_VOL_CHANGE_SHIFT(x) (((!!x) << 2) | (x & ~0x01)) |
49 | #define BUCK_VOL_CHANGE_FLAG_GO 0x01 | 49 | #define BUCK_VOL_CHANGE_FLAG_GO 0x01 |
50 | #define BUCK_VOL_CHANGE_FLAG_TARGET 0x02 | 50 | #define BUCK_VOL_CHANGE_FLAG_TARGET 0x02 |
51 | #define BUCK_VOL_CHANGE_FLAG_MASK 0x03 | 51 | #define BUCK_VOL_CHANGE_FLAG_MASK 0x03 |