[PATCH 0/3] ASoC: wm8962: make GPIO-based HP detection work
From: Laurentiu Mihalcea
Date: Fri Nov 27 2026 - 12:06:20 EST
From: Laurentiu Mihalcea <laurentiu.mihalcea@xxxxxxx>
Hello everyone,
This series contains a little bit of a mix of patches (2 features and 1
bug fix) that are needed to (partially) make the headphone detection
using the GPIO2 and GPIO5 pins work on NXP's MR-NAVQ95 board.
A little bit about the setup:
I'm using a MR-NAVQ95 board. This uses the codec's GPIO5 pin to detect
if the headphones are plugged into the jack and the GPIO2 pin to signal
if a codec interrupt has occurred.
Also, the WM8962 codec has an external XTAL tied to the XTI/MCLK pins and
is configured to use the FLL as the MCLK source.
For this to work, I've confiured GPIO5 as a GPIO input and GPIO2 to
operate in IRQ mode (i.e. IRQ function) using the "gpio-cfg" DT property.
About the patches:
1) ASoC: wm8962: implement GPIO .get callback
- needed because the soc-jack core needs to be able to read the value of
the headphone detection pin (i.e. GPIO5).
2) ASoC: wm8962: add GPIO interrupt controller support
- needed because the soc-jack core needs to be notified whenever an IRQ
was raised by the codec (which would happen if GPIO5 changes its state).
3) ASoC: wm8962: fix interrupt mis-firing during runtime_resume()
- fixes an annoying issue that would cause some unwanted transitions on
the codec's IRQ line. This would sometimes make the downstream IRQ
controller think an interrupt was raised by the codec.
Apart from this, there's still an issue with the FLL lock interrupt, which
I haven't managed to get working right yet. What I've tried is enabling
SYSCLK after configuring and enabling the FLL but this doesn't seem to do
the trick all the time since there's still some cases in which the IRQ
doesn't fire. The datasheet doesn't seem to specify the conditions under
which said interrupt should fire?
Laurentiu Mihalcea (3):
ASoC: wm8962: implement GPIO .get callback
ASoC: wm8962: add GPIO interrupt controller support
ASoC: wm8962: fix interrupt mis-firing during runtime_resume()
sound/soc/codecs/wm8962.c | 201 ++++++++++++++++++++++++++++++++++----
1 file changed, 183 insertions(+), 18 deletions(-)
--
2.53.0