From: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
To: linusw@kernel.org
Cc: wens@kernel.org, jernej.skrabec@gmail.com, samuel@sholland.org,
andre.przywara@arm.com, linux-gpio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] pinctrl: sunxi: a733-r: use the A733 I/O voltage fields
Date: Mon, 12 Oct 2026 15:41:29 -0300 [thread overview]
Message-ID: <20261012184130.548261-3-vinicius.eduardo.pedrosa@gmail.com> (raw)
In-Reply-To: <20261012184130.548261-1-vinicius.eduardo.pedrosa@gmail.com>
The A733 R-PIO shares the A523-R descriptor, and with it the A523
inverted one-bit encoding and the access to PIO_POW_MOD_CTL. Its
SGPIO_POW_MOD_SEL has two-bit fields instead, and the manual documents
no control register at offset 0x344. With PL in fixed 3.3 V mode, as
read on a Radxa Cubie A7Z (0x000aaaaa), running the old helper on the
host with a 3.3 V request for PL gives 0x000aaaab, which is fixed
1.8 V. This was not run on the board.
Give the A733-R its own descriptor with the PL and PM fields, and
leave the A523-R as it is.
Fixes: 31d68e10381c ("pinctrl: sunxi: a523-r: add a733-r compatible string")
Signed-off-by: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
---
drivers/pinctrl/sunxi/pinctrl-sun55i-a523-r.c | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun55i-a523-r.c b/drivers/pinctrl/sunxi/pinctrl-sun55i-a523-r.c
index cffc1e53eef1..1aa7f32035e1 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun55i-a523-r.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun55i-a523-r.c
@@ -30,11 +30,33 @@ static struct sunxi_pinctrl_desc a523_r_pinctrl_data = {
.pin_base = PL_BASE,
};
+/*
+ * The A733 R-PIO has the A523 one's layout, but its SGPIO_POW_MOD_SEL uses
+ * two-bit fields, and the manual documents no control register at offset 0x344.
+ */
+static const u32 a733_r_io_bias_masks[SUNXI_PINCTRL_MAX_BANKS] = {
+ [0] = GENMASK(1, 0), /* PL */
+ [1] = GENMASK(3, 2), /* PM */
+};
+
+static struct sunxi_pinctrl_desc a733_r_pinctrl_data = {
+ .irq_banks = ARRAY_SIZE(a523_r_irq_bank_map),
+ .irq_bank_map = a523_r_irq_bank_map,
+ .io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL_2BIT,
+ .io_bias_masks = a733_r_io_bias_masks,
+ .pin_base = PL_BASE,
+};
+
static int a523_r_pinctrl_probe(struct platform_device *pdev)
{
+ struct sunxi_pinctrl_desc *desc = &a523_r_pinctrl_data;
+
+ if (of_device_is_compatible(pdev->dev.of_node,
+ "allwinner,sun60i-a733-r-pinctrl"))
+ desc = &a733_r_pinctrl_data;
+
return sunxi_pinctrl_dt_table_init(pdev, a523_r_nr_bank_pins,
- a523_r_irq_bank_muxes,
- &a523_r_pinctrl_data,
+ a523_r_irq_bank_muxes, desc,
SUNXI_PINCTRL_NCAT2_REG_LAYOUT);
}
--
2.43.0
prev parent reply other threads:[~2026-10-12 18:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 18:41 [PATCH 0/2] pinctrl: sunxi: A733: use the two-bit " Vinicius Pedrosa
2026-10-12 18:41 ` [PATCH 1/2] pinctrl: sunxi: a733: program " Vinicius Pedrosa
2026-10-13 14:03 ` Andre Przywara
2026-10-12 18:41 ` Vinicius Pedrosa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261012184130.548261-3-vinicius.eduardo.pedrosa@gmail.com \
--to=vinicius.eduardo.pedrosa@gmail.com \
--cc=andre.przywara@arm.com \
--cc=jernej.skrabec@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=wens@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®