power: rk808: fix ldo register offset

A patch from »power: rk808: fix ldo register offset« in state Mainline for u-boot

From: Heiko Stuebner <heiko@...> Date: Sat, 6 May 2017 21:16:23 +0200


Till now get_ldo_reg did a return &rk808_ldo[num - 1]; to return the ldo register offset but didn't take into account that its calling functions already created the ldo as ldo = dev->driver_data - 1. This resulted in the setting for ldo8 writing to the register of ldo7 and so on. So fix this and get the correct ldo register data. Signed-off-by: Heiko Stuebner <heiko@...>


drivers/power/regulator/rk8xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)


  • 2 lines added
  • 2 lines removed


----------------------- drivers/power/regulator/rk8xx.c ------------------------
index e655c2d91f..c1ece96b66 100644
@@ -92,9 +92,9 @@ static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
struct rk8xx_priv *priv = dev_get_priv(pmic);
switch (priv->variant) {
case RK818_ID:
- return &rk818_ldo[num - 1];
+ return &rk818_ldo[num];
- return &rk808_ldo[num - 1];
+ return &rk808_ldo[num];

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.