sunxi: power: axp809: Fix DCDC4 programming
PATCH 1/1 sunxi: power: axp809: Fix DCDC4 programming
When trying to set the DCDC4 regulator, the code was accidentally setting the voltage register for DCDC5 (VCC-DRAM). The higher voltage doesn't harm the DRAM chips, but upsets the Linux regulator driver: when it tried to correct that, it tripped over a separate DT bug. The DCDC5 DT limits are 1.425 and 1.575V, which cannot bet set with the rail's resolution of 50mV. The kernel driver gave up, and made in turn the system hang, as the PMIC powers essential devices.
Fix the copy&paste bug by using the correct PMIC voltage register.
--- drivers/power/axp809.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/axp809.c +1 -1
@@ -93,7 +93,7 @@ int axp_set_dcdc4(unsigned int mvolt)return pmic_bus_clrbits (AXP809_OUTPUT_CTRL1 ,AXP809_OUTPUT_CTRL1_DCDC4_EN ); - ret =pmic_bus_write (AXP809_DCDC5_CTRL , cfg); + ret =pmic_bus_write (AXP809_DCDC4_CTRL , cfg);if (ret)return ret;
Signature · 1 line
2.46.2
Quoted 9 lines · Andre Przywara
When trying to set the DCDC4 regulator, the code was accidentally setting the voltage register for DCDC5 (VCC-DRAM). The higher voltage doesn't harm the DRAM chips, but upsets the Linux regulator driver: when it tried to correct that, it tripped over a separate DT bug. The DCDC5 DT limits are 1.425 and 1.575V, which cannot bet set with the rail's resolution of 50mV. The kernel driver gave up, and made in turn the system hang, as the PMIC powers essential devices.
Quoted 3 lines
Fix the copy&paste bug by using the correct PMIC voltage register.
Signed-off-by Andre Przywara <[email protected]>
Quoted 20 lines
--- drivers/power/axp809.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/axp809.c +1
-2@@ -93,7 +93,7 @@ int axp_set_dcdc4(unsigned int mvolt)return pmic_bus_clrbits (AXP809_OUTPUT_CTRL1 ,AXP809_OUTPUT_CTRL1_DCDC4_EN ); - ret =pmic_bus_write (AXP809_DCDC5_CTRL , cfg); + ret =pmic_bus_write (AXP809_DCDC4_CTRL , cfg);if (ret)return ret; --2.46.2
Jaehoon Chung
Reviewed-byQuoted 20 lines
-----Original Message-----
From: Chen-Yu Tsai <[email protected]>
Sent: Friday, October 25, 2024 11:43 PM
To: Andre Przywara <[email protected]>
Cc: Jaehoon Chung <[email protected]>; Jagan Teki <[email protected]>; Tom Rini <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] sunxi: power: axp809: Fix DCDC4 programmingQuoted 9 lines · On Tue, Oct 8, 2024 at 6:27?AM Andre Przywara <[email protected]> wrote:
When trying to set the DCDC4 regulator, the code was accidentally setting the voltage register for DCDC5 (VCC-DRAM). The higher voltage doesn't harm the DRAM chips, but upsets the Linux regulator driver: when it tried to correct that, it tripped over a separate DT bug. The DCDC5 DT limits are 1.425 and 1.575V, which cannot bet set with the rail's resolution of 50mV. The kernel driver gave up, and made in turn the system hang, as the PMIC powers essential devices.
Quoted 5 lines
Quoted 3 lines
Fix the copy&paste bug by using the correct PMIC voltage register.
Signed-off-by Andre Przywara <[email protected]>Reviewed-by Chen-Yu Tsai <[email protected]>
Quoted 21 lines
Quoted 21 lines
--- drivers/power/axp809.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/axp809.c +1
-2@@ -93,7 +93,7 @@ int axp_set_dcdc4(unsigned int mvolt)return pmic_bus_clrbits (AXP809_OUTPUT_CTRL1 ,AXP809_OUTPUT_CTRL1_DCDC4_EN ); - ret =pmic_bus_write (AXP809_DCDC5_CTRL , cfg); + ret =pmic_bus_write (AXP809_DCDC4_CTRL , cfg);if (ret)return ret; --2.46.2