mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
To: Linus Walleij <linusw@kernel.org>, linux-gpio@vger.kernel.org
Cc: Andre Przywara <andre.przywara@arm.com>,
	Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Enzo Adriano <enzo.adriano.code@gmail.com>,
	Pablo Mazzini <pmazzini@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] pinctrl: sunxi: a733: do not switch the mux to read IRQ lines
Date: Tue, 10 Nov 2026 10:01:57 -0300	[thread overview]
Message-ID: <20261110130157.112155-1-vinicius.eduardo.pedrosa@gmail.com> (raw)

The A733 description sets irq_read_needs_mux. When a GPIO used as an
interrupt is read, sunxi_pinctrl_gpio_get() then switches the pin to
input and back to SUN4I_FUNC_IRQ, which is function 6. The A733
interrupt function is 14, so after the first read the pin is left on
function 6 and its interrupt no longer fires.

On my board this breaks microSD card detection: the PF6
card-detect line is read at probe, and after that neither removal nor
insertion of the card is noticed.

The A733 data register reports the pin level while the pin is muxed
to the interrupt function, so the switch is not needed. The A523 and
D1 descriptions do not set this flag either. Drop it.

Fixes: 0535bfbfa97b ("pinctrl: sunxi: add support for the Allwinner A733")
Signed-off-by: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
---
Tested on a Cubie A7Z with the pending A733 clock, PMIC and DT series
applied: before this change PF6 read back function 6 and card removal
and insertion were not seen; with it PF6 stays on function 14 and one
removal/insertion cycle was detected.

 drivers/pinctrl/sunxi/pinctrl-sun60i-a733.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sun60i-a733.c b/drivers/pinctrl/sunxi/pinctrl-sun60i-a733.c
index ca82f08a3a65..456d9170c2a2 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun60i-a733.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun60i-a733.c
@@ -23,7 +23,6 @@ static const u8 a733_irq_bank_muxes[SUNXI_PINCTRL_MAX_BANKS] =
 
 static struct sunxi_pinctrl_desc a733_pinctrl_data = {
 	.irq_banks = 10,
-	.irq_read_needs_mux = true,
 	.io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL,
 };
 
-- 
2.43.0


                 reply	other threads:[~2026-11-10 13:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261110130157.112155-1-vinicius.eduardo.pedrosa@gmail.com \
    --to=vinicius.eduardo.pedrosa@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=brgl@kernel.org \
    --cc=enzo.adriano.code@gmail.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=pmazzini@gmail.com \
    --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®