git: 486633127e37 - main - axp81x: Fix the number of steps of the first range of DCDC5

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Fri, 13 Nov 2026 07:29:47 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=486633127e37389dc83449bbc13dfa670ea78ba5

commit 486633127e37389dc83449bbc13dfa670ea78ba5
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-11-13 06:35:25 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-13 07:29:30 +0000

    axp81x: Fix the number of steps of the first range of DCDC5
    
    The voltage of DCDC5 goes from 800mV to 1120mV in 10mV steps with the
    codes 0x00 to 0x20, then from 1140mV to 1840mV in 20mV steps with the
    codes 0x21 to 0x44.  The first range has 32 steps and not 42, so every
    code above 32 was decoded and encoded wrongly: the driver read 1160mV
    for the 1.2V that the firmware sets for the DRAM, did not see it in the
    range of the FDT and wrote a code that is really 1280mV.  The same
    happens for the other voltages, 1.36V is set to 1.46V and 1.5V to 1.6V.
    It also made the voltage reported for the regulator wrong.
    
    Reported by:    llm-postcr
    Fixes:          c175fd0fe8a3 ("axp81x: Add support for AXP803")
    Tested on: A64
---
 sys/arm/allwinner/axp81x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm/allwinner/axp81x.c b/sys/arm/allwinner/axp81x.c
index 7db28242a3db..279113bb5294 100644
--- a/sys/arm/allwinner/axp81x.c
+++ b/sys/arm/allwinner/axp81x.c
@@ -466,7 +466,7 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = {
 		.voltage_min = 800,
 		.voltage_max = 1840,
 		.voltage_step1 = 10,
-		.voltage_nstep1 = 42,
+		.voltage_nstep1 = 32,
 		.voltage_step2 = 20,
 		.voltage_nstep2 = 36,
 	},