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>
This commit is contained in:
parent
cdb868f581
commit
451a73cd46
|
@ -45,7 +45,7 @@ static int lp3971_set_bits(struct lp3971 *lp3971, u8 reg, u16 mask, u16 val);
|
||||||
LP3971_BUCK2 -> 4
|
LP3971_BUCK2 -> 4
|
||||||
LP3971_BUCK3 -> 6
|
LP3971_BUCK3 -> 6
|
||||||
*/
|
*/
|
||||||
#define BUCK_VOL_CHANGE_SHIFT(x) (((1 << x) & ~0x01) << 1)
|
#define BUCK_VOL_CHANGE_SHIFT(x) (((!!x) << 2) | (x & ~0x01))
|
||||||
#define BUCK_VOL_CHANGE_FLAG_GO 0x01
|
#define BUCK_VOL_CHANGE_FLAG_GO 0x01
|
||||||
#define BUCK_VOL_CHANGE_FLAG_TARGET 0x02
|
#define BUCK_VOL_CHANGE_FLAG_TARGET 0x02
|
||||||
#define BUCK_VOL_CHANGE_FLAG_MASK 0x03
|
#define BUCK_VOL_CHANGE_FLAG_MASK 0x03
|
||||||
|
|
Loading…
Reference in New Issue