[U-Boot] [PATCH][RFT] sunxi: power: axp809.c: Fix aldo1-2 being disabled for mvolt != 0

Jaehoon Chung jh80.chung at samsung.com
Thu Jan 19 12:46:19 CET 2017


Hi,

On 01/19/2017 05:53 AM, Rask Ingemann Lambertsen wrote:
> The execution flow is currently like this for aldo_num == 1 or 2:
> 
> int axp_set_aldo(int aldo_num, unsigned int mvolt)
> {
> ...
> 	if (mvolt == 0)
> 		return pmic_bus_clrbits(AXP809_OUTPUT_CTRL1,
> 				AXP809_OUTPUT_CTRL1_ALDO1_EN << (aldo_num - 1));
> ...
> 	return pmic_bus_clrbits(AXP809_OUTPUT_CTRL1,
>  				AXP809_OUTPUT_CTRL1_ALDO1_EN << (aldo_num - 1));
>  }
> 
> I.e. aldo1 and aldo2 will always be disabled. This patch fixes it by
> setting (rather than clearing) the enable bit when mvolt != 0.
> 
> Signed-off-by: Rask Ingemann Lambertsen <rask at formelder.dk>
> Fixes: 795857df413a ("sunxi: power: add AXP809 support")

It makes sense. if someone can test it, it's more better. :)
I can't access u-boot-pmic git repository yet.
So if possible, i will make the "pmic" branch on u-boot-mmc.

And i will apply the patches relevant to Power.

Best Regards,
Jaehoon Chung

> ---
> 
> This patch needs someone to test it. I can't do so myself because I don't
> have any hardware with an AXP809 PMIC. I just happened to spot the bug
> when looking at the code.
> 
>  drivers/power/axp809.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/axp809.c b/drivers/power/axp809.c
> index c5b608d..5b5cb36 100644
> --- a/drivers/power/axp809.c
> +++ b/drivers/power/axp809.c
> @@ -143,7 +143,7 @@ int axp_set_aldo(int aldo_num, unsigned int mvolt)
>  	if (aldo_num == 3)
>  		return pmic_bus_setbits(AXP809_OUTPUT_CTRL2,
>  					AXP809_OUTPUT_CTRL2_ALDO3_EN);
> -	return pmic_bus_clrbits(AXP809_OUTPUT_CTRL1,
> +	return pmic_bus_setbits(AXP809_OUTPUT_CTRL1,
>  				AXP809_OUTPUT_CTRL1_ALDO1_EN << (aldo_num - 1));
>  }
>  
> 



More information about the U-Boot mailing list