[PATCH] pinctrl: sunxi: skip unused per-bank supply on controllers without IO bias

From: hsyysy

Date: Mon Oct 26 2026 - 10:53:46 EST


From: Yang Siyuan <hsyysy@xxxxxxx>

sunxi_pmx_request() always requests the "vcc-pX" regulator of the pin's
bank, but that supply is only consumed by
sunxi_pinctrl_set_io_bias_cfg(). Controllers without io_bias_cfg_variant
never use it, so the request only makes the regulator core warn:

sun50i-h616-r-pinctrl 7022000.pinctrl: supply vcc-pl not found, using
dummy regulator

The H616 R_PIO is such a controller, and its PL0/PL1 pins drive the
R_I2C bus, so every H616 board hits the warning during boot.

Return early when the controller cannot configure the IO bias voltage,
and teach the free path that no supply was requested for that bank.

Signed-off-by: Yang Siyuan <hsyysy@xxxxxxx>
---
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 70099052d..a5222cfbd 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -924,6 +924,15 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset)
return 0;
}

+ /*
+ * The per-bank supply is only used to configure the IO bias voltage.
+ * Controllers without bias configuration (e.g. the H616 R_PIO) have no
+ * supply to request, and asking for one only makes the regulator core
+ * warn about the missing regulator for every bank in use.
+ */
+ if (!pctl->desc->io_bias_cfg_variant)
+ return 0;
+
snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank);
reg = regulator_get(pctl->dev, supply);
if (IS_ERR(reg))
@@ -959,6 +968,10 @@ static int sunxi_pmx_free(struct pinctrl_dev *pctldev, unsigned offset)
PINS_PER_BANK;
struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset];

+ /* No supply was requested for this bank (no IO bias configuration). */
+ if (!s_reg->regulator)
+ return 0;
+
if (!refcount_dec_and_test(&s_reg->refcount))
return 0;

base-commit: 091b06388b117fefdcb63336ac09956a4914b961
--
2.56.0