mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/7] Add support for the X-Powers AXP2101 PMIC
@ 2026-10-23 10:03 Olivier Louvignes
  2026-10-23 10:03 ` [PATCH 1/7] dt-bindings: mfd: x-powers,axp152: Add the AXP2101 Olivier Louvignes
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Olivier Louvignes @ 2026-10-23 10:03 UTC (permalink / raw)
  To: Lee Jones, Chen-Yu Tsai
  Cc: Olivier Louvignes, Conor Dooley, Krzysztof Kozlowski,
	Liam Girdwood, Mark Brown, Rob Herring, Sebastian Reichel,
	devicetree, linux-kernel, linux-pm, mfd

This adds the AXP2101 to the axp20x drivers: the MFD core with its
registers and interrupts, the regulators, the USB power supply and the
battery charger. The PMIC is on the HiBy R1, a music player built on an
Ingenic X1600. It follows how the AXP717 was added: the existing
drivers are extended, and the two power supplies get their own
compatibles because their registers differ.

Not handled yet: the PMIC's own fuel gauge (the R1 uses a CW2015, and the
AXP2101's reads 0% without a battery model), the power key, the ADC
channels, the TS pin, and writing the input current limit.

Sources: there is no datasheet behind this. The register map comes from
the GPL-2.0 AXP2101 driver of the hiby-custom-kernel project
(github.com/Jepl4r/hiby-custom-kernel), an open replacement for HiBy's
closed module, and was checked against the chip on a running R1.

Tested on the R1, on v7.3 with out-of-tree board patches:
- The rails the stock firmware turns on (DCDC1-4 at 3.3, 1.1, 1.8 and
  1.2 V, ALDO2 3.3 V, ALDO3 1.1 V, ALDO4 3.3 V, BLDO1 and BLDO2 2.8 V)
  read back at their stock voltages, and the regulator registers
  0x80-0x9a stay byte for byte as the stock firmware left them. No
  voltage was changed from Linux. BLDO1 and BLDO2 (2.8 V, the LCD
  supplies) are switched on and off from Linux by the panel driver, which
  claims them: bits 4 and 5 of register 0x90 clear and set again with
  the screen blanking and unblanking, about 20 cycles over 8 boots, with
  the selectors (0x96 and 0x97) staying at 0x17. That does not change a
  voltage, since the registers already held 2.8 V. DCDC5, ALDO1, DLDO1-2
  and CPUSLDO are off on the R1 and only come from the register map.
- "poweroff -f" turns the R1 off, through COMM_CFG.
- Unplugging and replugging USB gives one VBUS_REMOVAL and one
  VBUS_PLUGIN interrupt, and the USB supply goes online 1, 0, 1.
- The charger registers read back as the stock firmware's values after
  boot, and the battery status is Full on USB, Discharging unplugged and
  Charging after a replug.

Every patch builds on 734bef548a96 (v7.3-7363) with W=1, passes
checkpatch --strict, and the three bindings pass dt_binding_check.

Open questions: whether extending the axp20x drivers is what you want
here (the alternative is a driver of its own), and whether programming
the charger from the monitored battery at probe, read-only afterwards,
is acceptable for the battery supply.

Olivier Louvignes (7):
  dt-bindings: mfd: x-powers,axp152: Add the AXP2101
  mfd: axp20x: Add support for the AXP2101
  regulator: axp20x: Add support for the AXP2101
  dt-bindings: power: supply: axp20x-usb-power: Add the AXP2101
  power: supply: axp20x_usb_power: Add support for the AXP2101
  dt-bindings: power: supply: axp20x-battery: Add the AXP2101
  power: supply: axp20x_battery: Add support for the AXP2101

 .../bindings/mfd/x-powers,axp152.yaml         |   3 +
 .../x-powers,axp20x-battery-power-supply.yaml |   1 +
 .../x-powers,axp20x-usb-power-supply.yaml     |   1 +
 drivers/mfd/axp20x-i2c.c                      |   2 +
 drivers/mfd/axp20x.c                          | 107 ++++++++-
 drivers/power/supply/axp20x_battery.c         | 221 ++++++++++++++++++
 drivers/power/supply/axp20x_usb_power.c       |  86 +++++++
 drivers/regulator/axp20x-regulator.c          |  88 +++++++
 include/linux/mfd/axp20x.h                    | 114 +++++++++
 9 files changed, 621 insertions(+), 2 deletions(-)


base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
-- 
2.39.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-10-26  9:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 10:03 [PATCH 0/7] Add support for the X-Powers AXP2101 PMIC Olivier Louvignes
2026-10-23 10:03 ` [PATCH 1/7] dt-bindings: mfd: x-powers,axp152: Add the AXP2101 Olivier Louvignes
2026-10-26  9:30   ` Krzysztof Kozlowski
2026-10-26  9:31     ` Krzysztof Kozlowski
2026-10-23 10:03 ` [PATCH 2/7] mfd: axp20x: Add support for " Olivier Louvignes
2026-10-23 10:03 ` [PATCH 3/7] regulator: " Olivier Louvignes
2026-10-23 11:58   ` Mark Brown
2026-10-23 10:03 ` [PATCH 4/7] dt-bindings: power: supply: axp20x-usb-power: Add " Olivier Louvignes
2026-10-26  9:32   ` Krzysztof Kozlowski
2026-10-23 10:03 ` [PATCH 5/7] power: supply: axp20x_usb_power: Add support for " Olivier Louvignes
2026-10-23 10:04 ` [PATCH 6/7] dt-bindings: power: supply: axp20x-battery: Add " Olivier Louvignes
2026-10-26  9:33   ` Krzysztof Kozlowski
2026-10-23 10:04 ` [PATCH 7/7] power: supply: axp20x_battery: Add support for " Olivier Louvignes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®