[PATCH v2 0/5] regulator: add X-Powers AXP323 support

Andre Przywara posted 5 patches 1 month, 3 weeks ago
.../bindings/mfd/x-powers,axp152.yaml         |  3 +
drivers/mfd/axp20x-i2c.c                      |  1 +
drivers/mfd/axp20x.c                          | 58 ++++++++++++++-----
drivers/regulator/axp20x-regulator.c          | 13 ++++-
include/linux/mfd/axp20x.h                    |  4 +-
5 files changed, 61 insertions(+), 18 deletions(-)
[PATCH v2 0/5] regulator: add X-Powers AXP323 support
Posted by Andre Przywara 1 month, 3 weeks ago
A small update of version, just changing the regmap cache type to maple
tree, and adding the accrued tags (thanks to the reviewers!).
================================
The X-Powers AXP323 is a close sibling to the AXP313a PMIC, only that it
allows to dual-phase the first two DC/DC converters. This is controlled
via a new register. On the first glance that would sound like a
compatible extension, but any random AXP313a driver would not know about
the potential dual-phase nature of the second DCDC rail, so might want
to turn that off, spoiling the whole setup. So this patchset introduces
a new compatible string, without any fallbacks.

Patch 1 adds the DT binding documentation, patch 2 fixes some fragile
connection between PMIC IDs and an array. Patch 3 allows multiple AXP
chips, since the AXP323 seems to be often paired with the AXP717, and
there is some sysfs naming clash with the current code.
Patch 4 then adds the MFD bits, to introduce the new device type and that
extra register, while patch 4 eventually adds the new regulator device,
and takes care about the proper poly-phase detection.

One note: so far the poly-phased AXP PMICs had that setting already
enabled at reset time, so we just detected it and were good. However the
AXP323 on my board does not, so it requires enabling the dual-phase bit at
boot time. The BSP kernel does that in their boot0 (SPL) early boot code,
and the plan would be to do this either in U-Boot or TF-A for mainline.
But should we actually expose this in the DT, as some new property, to
give kernels a chance to set it? The rails in question power the secondary
cluster, so it's not strictly required at boot time, but it's probably too
late for the kernel anyway, given that SMP bringup is much earlier than
drivers? I would appreciate any thoughts here.

Thanks,
Andre

Changelog:
v1 ... v2:
- change regmap cache type to maple tree (as all the others use)
- add R-b: and ACK tags

Andre Przywara (5):
  dt-bindings: mfd: x-powers,axp152: Document AXP323
  mfd: axp20x: ensure relationship between IDs and model names
  mfd: axp20x: Allow multiple regulators
  mfd: axp20x: Add support for AXP323
  regulator: axp20x: add support for the AXP323

 .../bindings/mfd/x-powers,axp152.yaml         |  3 +
 drivers/mfd/axp20x-i2c.c                      |  1 +
 drivers/mfd/axp20x.c                          | 58 ++++++++++++++-----
 drivers/regulator/axp20x-regulator.c          | 13 ++++-
 include/linux/mfd/axp20x.h                    |  4 +-
 5 files changed, 61 insertions(+), 18 deletions(-)

-- 
2.46.2
Re: [PATCH v2 0/5] regulator: add X-Powers AXP323 support
Posted by Lee Jones 3 weeks, 6 days ago
On Mon, 07 Oct 2024 01:14:03 +0100, Andre Przywara wrote:
> A small update of version, just changing the regmap cache type to maple
> tree, and adding the accrued tags (thanks to the reviewers!).
> ================================
> The X-Powers AXP323 is a close sibling to the AXP313a PMIC, only that it
> allows to dual-phase the first two DC/DC converters. This is controlled
> via a new register. On the first glance that would sound like a
> compatible extension, but any random AXP313a driver would not know about
> the potential dual-phase nature of the second DCDC rail, so might want
> to turn that off, spoiling the whole setup. So this patchset introduces
> a new compatible string, without any fallbacks.
> 
> [...]

Applied, thanks!

[1/5] dt-bindings: mfd: x-powers,axp152: Document AXP323
      commit: bd91530aee6007a979e52d816779a6e10ed8c00a
[2/5] mfd: axp20x: ensure relationship between IDs and model names
      commit: 697a4001d31a607a72c6297e4eb0f7918c6e6929
[3/5] mfd: axp20x: Allow multiple regulators
      commit: e37ec32188701efa01455b9be42a392adab06ce4
[4/5] mfd: axp20x: Add support for AXP323
      commit: 35fec94afe045856456faca4879b9c560e39d1e3
[5/5] regulator: axp20x: add support for the AXP323
      commit: a0f8a8898e120d5a3f14cd22289daa3709d83f5b

--
Lee Jones [李琼斯]