All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] power: rk808: fix ldo register offset
@ 2017-05-06 19:21 Heiko Stuebner
  2017-05-07 10:58 ` Jacob Chen
  2017-05-14  9:32 ` Simon Glass
  0 siblings, 2 replies; 4+ messages in thread
From: Heiko Stuebner @ 2017-05-06 19:21 UTC (permalink / raw)
  To: u-boot

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@sntech.de>
---
 drivers/power/regulator/rk8xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c
index e655c2d91f..c1ece96b66 100644
--- a/drivers/power/regulator/rk8xx.c
+++ b/drivers/power/regulator/rk8xx.c
@@ -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];
 	default:
-		return &rk808_ldo[num - 1];
+		return &rk808_ldo[num];
 	}
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] power: rk808: fix ldo register offset
  2017-05-06 19:21 [U-Boot] [PATCH] power: rk808: fix ldo register offset Heiko Stuebner
@ 2017-05-07 10:58 ` Jacob Chen
  2017-05-14  9:32 ` Simon Glass
  1 sibling, 0 replies; 4+ messages in thread
From: Jacob Chen @ 2017-05-07 10:58 UTC (permalink / raw)
  To: u-boot

Hi,

2017-05-07 3:21 GMT+08:00 Heiko Stuebner <heiko@sntech.de>:
> 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@sntech.de>
> ---
>  drivers/power/regulator/rk8xx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c
> index e655c2d91f..c1ece96b66 100644
> --- a/drivers/power/regulator/rk8xx.c
> +++ b/drivers/power/regulator/rk8xx.c
> @@ -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];
>         default:
> -               return &rk808_ldo[num - 1];
> +               return &rk808_ldo[num];
>         }
>  }
>
> --
> 2.11.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot


Sorry for untest patches, Reviewed-by: Jacob Chen <jacob2.chen@rock-chips.com>.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] power: rk808: fix ldo register offset
  2017-05-06 19:21 [U-Boot] [PATCH] power: rk808: fix ldo register offset Heiko Stuebner
  2017-05-07 10:58 ` Jacob Chen
@ 2017-05-14  9:32 ` Simon Glass
  2017-05-24  0:48   ` sjg at google.com
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Glass @ 2017-05-14  9:32 UTC (permalink / raw)
  To: u-boot

On 6 May 2017 at 13:21, Heiko Stuebner <heiko@sntech.de> wrote:
> 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@sntech.de>
> ---
>  drivers/power/regulator/rk8xx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Acked-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] power: rk808: fix ldo register offset
  2017-05-14  9:32 ` Simon Glass
@ 2017-05-24  0:48   ` sjg at google.com
  0 siblings, 0 replies; 4+ messages in thread
From: sjg at google.com @ 2017-05-24  0:48 UTC (permalink / raw)
  To: u-boot

On 6 May 2017 at 13:21, Heiko Stuebner <heiko@sntech.de> wrote:
> 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@sntech.de>
> ---
>  drivers/power/regulator/rk8xx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-24  0:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-06 19:21 [U-Boot] [PATCH] power: rk808: fix ldo register offset Heiko Stuebner
2017-05-07 10:58 ` Jacob Chen
2017-05-14  9:32 ` Simon Glass
2017-05-24  0:48   ` sjg at google.com

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.