Re: [PATCH v10 3/3] regulator: axp20x: Add support for AXP313a variant

From: Chen-Yu Tsai
Date: Sun Apr 02 2023 - 02:13:27 EST


On Sat, Apr 1, 2023 at 8:19 AM Andre Przywara <andre.przywara@xxxxxxx> wrote:
>
> From: Martin Botka <martin.botka@xxxxxxxxxxxxxx>
>
> The AXP313a is your typical I2C controlled PMIC, although in a lighter
> fashion compared to the other X-Powers PMICs: it has only three DCDC
> rails, three LDOs, and no battery charging support.
>
> The AXP313a datasheet does not describe a register to change the DCDC
> switching frequency, and talks of it being fixed at 3 MHz. Check that
> the property allowing to change that frequency is absent from the DT,
> and bail out otherwise.
>
> The third LDO, RTCLDO, is fixed, and cannot even be turned on or off,
> programmatically. On top of that, its voltage is customisable (either
> 1.8V or 3.3V), which we cannot describe easily using the existing
> regulator wrapper functions. This should be fixed properly, using
> regulator-{min,max}-microvolt in the DT, but this requires more changes
> to the code. As some other PMICs (AXP2xx, AXP803) seem to paper over the
> same problem as well, we follow suit here and pretend it's a fixed 1.8V
> regulator. A proper fix can follow later. The BSP code seems to ignore
> this regulator altogether.
>
> Describe the AXP313A's voltage settings and switch registers, how the
> voltages are encoded, and connect this to the MFD device via its
> regulator ID.
>
> Signed-off-by: Martin Botka <martin.botka@xxxxxxxxxxxxxx>
> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>

Reviewed-by: Chen-Yu Tsai <wens@xxxxxxxx>