Commit 9f79e9db authored by Haojian Zhuang's avatar Haojian Zhuang Committed by Liam Girdwood

regulator: use voltage number array in 88pm860x

A lot of condition comparision statements are used in original driver. These
statements are used to check the boundary of voltage numbers since voltage
number isn't linear.

Now use array of voltage numbers instead. Clean code with simpler way.
Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 192bbb95
......@@ -173,6 +173,7 @@ static struct resource regulator_resources[] = {
PM8607_REG_RESOURCE(LDO9, LDO9),
PM8607_REG_RESOURCE(LDO10, LDO10),
PM8607_REG_RESOURCE(LDO12, LDO12),
PM8607_REG_RESOURCE(VIBRATOR_SET, VIBRATOR_SET),
PM8607_REG_RESOURCE(LDO14, LDO14),
};
......@@ -199,6 +200,7 @@ static struct mfd_cell regulator_devs[] = {
PM8607_REG_DEVS(LDO9),
PM8607_REG_DEVS(LDO10),
PM8607_REG_DEVS(LDO12),
PM8607_REG_DEVS(LDO13),
PM8607_REG_DEVS(LDO14),
};
......
This diff is collapsed.
......@@ -132,6 +132,7 @@ enum {
PM8607_ID_LDO9,
PM8607_ID_LDO10,
PM8607_ID_LDO12,
PM8607_ID_LDO13,
PM8607_ID_LDO14,
PM8607_ID_RG_MAX,
......@@ -309,7 +310,7 @@ struct pm860x_chip {
};
#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */
#define PM8607_MAX_REGULATOR PM8607_ID_RG_MAX /* 3 Bucks, 13 LDOs */
enum {
GI2C_PORT = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment