mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
	elena.popa@nxp.com, cosmin.stoica@nxp.com,
	patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] ASoC: wm8962: add GPIO interrupt controller support
Date: Wed, 2 Dec 2026 00:35:51 +0200	[thread overview]
Message-ID: <7f7380a6-a05d-4857-9be7-f01b69cbdbe3@gmail.com> (raw)
In-Reply-To: <aw1dQupJ/MdlTDkz@opensource.cirrus.com>


On 11/30/2026 1:25 PM, Charles Keepax wrote:
> On Fri, Nov 27, 2026 at 07:00:38PM +0200, Laurentiu Mihalcea wrote:
>> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>
>> The WM8962 codec provides two GPIO pins: GPIO5/GPIO6 which can act as
>> interrupt sources. Therefore, in the context of Linux, GPIO consumer
>> devices (e.g. in this case, the sound card), could make use of these two
>> pins to handle certain events (e.g. HP detection).
>>
>> Add support for this by modelling the WM8962 codec as a GPIO interrupt
>> controller.
>>
>> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>> ---
> Should this not have some sort of mechanism to enable/disable
> this functionality? This is a fairly old part presumably there
> are many systems that already exist, seems bold to assume all of
> them have connected those GPIOs in this way.


Hm, I think you've raised a very good concern. I think this feature already

depends on the fact that the user has chosen to configure GPIO5/GPIO6

as GPIO inputs (via gpio-cfg). Otherwise, I don't think they should be generating IRQs.


I'm basing this thought on two things:


1) This quote from the datasheet:


"""

GPIO5 and GPIO6 pins can be configured as GPIO inputs can be used to trigger an

Interrupt event.

"""


2) In our case, GPIO6 is configured as DMIC DATA input. So far, I don't remember

seeing any interrupts misfiring? Not sure if this point is valid though as I might

have just missed them?


That being said, I don't think having a mechanism to enable/disable this feature

would be a bad idea as it would give users more control and maybe protect us

against some weird configurations that would somehow end up triggering the

IRQs?


The way I see this being done at the moment is with the IRQ mask()/unmask()/bus_sync()

callbacks. If you're OK with this, I can try to implement this for V2.


Thanks!


  reply	other threads:[~2026-12-01 22:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 17:00 [PATCH 0/3] ASoC: wm8962: make GPIO-based HP detection work Laurentiu Mihalcea
2026-11-27 17:00 ` [PATCH 1/3] ASoC: wm8962: implement GPIO .get callback Laurentiu Mihalcea
2026-11-30 11:18   ` Charles Keepax
2026-12-01 21:36     ` Laurentiu Mihalcea
2026-11-27 17:00 ` [PATCH 2/3] ASoC: wm8962: add GPIO interrupt controller support Laurentiu Mihalcea
2026-11-30 11:25   ` Charles Keepax
2026-12-01 22:35     ` Laurentiu Mihalcea [this message]
2026-11-27 17:00 ` [PATCH 3/3] ASoC: wm8962: fix interrupt mis-firing during runtime_resume() Laurentiu Mihalcea

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=7f7380a6-a05d-4857-9be7-f01b69cbdbe3@gmail.com \
    --to=laurentiumihalcea111@gmail.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=cosmin.stoica@nxp.com \
    --cc=elena.popa@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=sebastian.krzyszkowiak@puri.sm \
    /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®