ARM Sunxi Platform Development
 help / color / mirror / Atom feed
* [PATCH] pinctrl: sunxi: skip unused per-bank supply on controllers without IO bias
@ 2026-10-26 14:47 hsyysy
  2026-10-26 14:58 ` sashiko-bot
  2026-10-26 15:20 ` [PATCH v2] pinctrl: sunxi: request the per-bank supply optionally Yang Siyuan
  0 siblings, 2 replies; 5+ messages in thread
From: hsyysy @ 2026-10-26 14:47 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-gpio,
	linux-arm-kernel, linux-sunxi, linux-kernel, Yang Siyuan

From: Yang Siyuan <hsyysy@163.com>

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@163.com>
---
 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


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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-26 14:47 [PATCH] pinctrl: sunxi: skip unused per-bank supply on controllers without IO bias hsyysy
2026-10-26 14:58 ` sashiko-bot
2026-10-26 15:20 ` [PATCH v2] pinctrl: sunxi: request the per-bank supply optionally Yang Siyuan
2026-10-26 15:39   ` sashiko-bot
2026-10-26 16:57   ` [PATCH v3] " Yang Siyuan

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