> Date: Mon, 31 Jul 2023 22:12:35 +0900
> From: SASANO Takayoshi <u...@mx5.nisiq.net>
> 
> Hi,
> 
> Mango Pi MQ-Quad and OrangePi Zero3 has X-Power AXP313A PMIC.
> 
> Here is a diff, but AXP313A's dcdc1 is not fully supported.
> 
> dcdc1 has three voltage ranges:
>       0.5-1.2V, 10mV/step (71 steps)
>       1.22-1.54V 20mV/step (17 steps)
>       1.6-3.4V 100mV/step (19 steps) *not supported this diff*
> 
> This restriction comes from current axppmic.c supports two voltage ranges.
> At least MQ-Quad/OPiZero3 uses dcdc1 for Allwinner H616's SYS/GPU
> (near 0.9V) so no need to support highest voltage range.

maybe add a note that the data sheet is wrong for dcdc3?

ok kettenis@

> Index: axppmic.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/fdt/axppmic.c,v
> retrieving revision 1.19
> diff -u -p -r1.19 axppmic.c
> --- axppmic.c 31 Jul 2023 12:23:35 -0000      1.19
> +++ axppmic.c 31 Jul 2023 13:00:12 -0000
> @@ -126,6 +126,21 @@ const struct axppmic_regdata axp221_regd
>       { NULL }
>  };
>  
> +const struct axppmic_regdata axp313a_regdata[] = {
> +     /* dcdc1: 1.6-3.4V (100mV step) not supported */
> +     { "dcdc1", 0x10, (1 << 0), (1 << 0), (0 << 0),
> +       0x13, 0x7f, 500000, 10000, 71, 122000, 20000, 17 },
> +     { "dcdc2", 0x10, (1 << 1), (1 << 1), (0 << 1),
> +       0x14, 0x7f, 500000, 10000, 71, 122000, 20000, 17 },
> +     { "dcdc3", 0x10, (1 << 2), (1 << 2), (0 << 2),
> +       0x15, 0x7f, 500000, 10000, 71, 122000, 20000, 32 },
> +     { "aldo1", 0x10, (1 << 3), (1 << 3), (0 << 3),
> +       0x16, 0x1f, 500000, 100000, 31 },
> +     { "dldo1", 0x10, (1 << 4), (1 << 4), (0 << 4),
> +       0x17, 0x1f, 500000, 100000, 31 },
> +     { NULL }
> +};
> +
>  const struct axppmic_regdata axp803_regdata[] = {
>       { "dcdc1", 0x10, (1 << 0), (1 << 0), (0 << 0),
>         0x20, 0x1f, 1600000, 100000, 19 },
> @@ -354,6 +369,7 @@ const struct axppmic_device axppmic_devi
>       { "x-powers,axp221", "AXP221", axp221_regdata, axp221_sensdata },
>       { "x-powers,axp223", "AXP223", axp221_regdata, axp221_sensdata },
>       { "x-powers,axp305", "AXP305", axp806_regdata },
> +     { "x-powers,axp313a", "AXP313A", axp313a_regdata },
>       { "x-powers,axp803", "AXP803", axp803_regdata, axp803_sensdata },
>       { "x-powers,axp805", "AXP805", axp806_regdata },
>       { "x-powers,axp806", "AXP806", axp806_regdata },
> 
> -- 
> SASANO Takayoshi (JG1UAA) <u...@mx5.nisiq.net>
> 
> 

Reply via email to