From: Alexander Kochetkov <al.kochet@gmail.com>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org, Siarhei Volkau <lis8215@gmail.com>
Subject: [RFC] Input: matrix_keypad: fix interrupt regression introduced by commit 01c84b03d80a
Date: Wed, 8 Jul 2026 16:30:14 +0300 [thread overview]
Message-ID: <4130C026-2A83-408B-836A-ECA044491C47@gmail.com> (raw)
Hi everyone,
I found a commit [1] that breaks the matrix_keypad behavior on the Allwinner A64.
I have a PINE A64-LTS board with a connected keypad polled by matrix_keypad.
This commit caused interrupts to stop arriving at the matrix_keypad driver entirely.
An explicit call to gpiod_direction_input() disables interrupt reception on all chips
where the GPIO input mode and GPIO interrupt input mode are configured via
the pinmux register. Interrupt reception is guaranteed to break on Allwinner
(A64, H3, H6, etc.), Broadcom (BCM2835/2711), and some Rockchip SoCs. It
does not break on NXP i.MX (i.MX6, i.MX8), STMicroelectronics (STM32MP1),
TI Sitara (AM335x), or Intel/AMD.
Furthermore, the assumption that enable_row_irqs() restores the interrupt mode is
also specific to the Ingenic pinctrl. In the vast majority of drivers, enable_row_irqs() is
supposed to simply set the interrupt enable mask without changing the pinmux.
Commit [1] was introduced to work around a hardware limitation in Ingenic's JZ4755.
This specific behavior is unique to Ingenic and a small number of specialized chips.
The majority of SoCs (around 90%) allow reading a GPIO input that is currently configured
as an interrupt source.
In my opinion, the correct approach would be to revert this commit and fix the behavior of
ingenic_gpio_get_value() inside pinctrl-ingenic.c instead. However, I do not own an Ingenic
board, so I won't be able to test such a patch.
Alternatively, I could introduce a DTS property like read-gpio-quirk in matrix_keypad to restore
the original driver behavior by default, and add this property to qi_lb60.dts so as not to break
the Ingenic platform.
What do you think? What is the best way to proceed here?
Best regards,
Alexander Kochetkov
[1] commit 01c84b03d80aab9f04c4e3e1f9085f4202ff7c29 ("Input: matrix_keypad - force switch rows to input mode")
next reply other threads:[~2026-07-08 13:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 13:30 Alexander Kochetkov [this message]
2026-07-08 15:59 ` [RFC] Input: matrix_keypad: fix interrupt regression introduced by commit 01c84b03d80a Siarhei Volkau
2026-07-09 10:25 ` Paul Cercueil
2026-07-09 15:51 ` Siarhei Volkau
2026-07-11 10:59 ` Siarhei Volkau
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=4130C026-2A83-408B-836A-ECA044491C47@gmail.com \
--to=al.kochet@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lis8215@gmail.com \
/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