Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: SDCA: support hardware jack detection on WCD9378
@ 2026-12-05 15:59 Gopi Chandra Sekhar Reddy Kanala
  2026-12-05 15:59 ` [PATCH 1/2] ASoC: SDCA: add jack ops hooks Gopi Chandra Sekhar Reddy Kanala
  2026-12-05 15:59 ` [PATCH 2/2] ASoC: codecs: wcd9378-sdca: enable MBHC jack-detect (GE 35) interrupt Gopi Chandra Sekhar Reddy Kanala
  0 siblings, 2 replies; 5+ messages in thread
From: Gopi Chandra Sekhar Reddy Kanala @ 2026-12-05 15:59 UTC (permalink / raw)
  To: Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
	Srinivas Kandagatla
  Cc: linux-sound, patches, linux-arm-msm,
	Gopi Chandra Sekhar Reddy Kanala

The SDCA class driver arms a Function's jack detection from its static
init_table, which suits parts whose detection hardware is safe to leave
enabled as soon as the device is configured. The WCD9378 is not one of
them: enabling its mechanical detector before the machine driver has
registered the jack raises a detection interrupt that cannot be
reported while the sound card probe is still deferred, and the detector
must be re-armed for the opposite transition direction after every
event.

Patch 1 adds two optional sdca_class_ops hooks for this. set_jack runs
from the class function driver's .set_jack just before the jack is
registered; post_jack_irq_process runs on every jack interrupt, after
the status has been read and before it is applied. Both default to
NULL, so nothing changes for parts that do not need them. The patch
also adds a back-pointer from sdca_interrupt_info to the device-level
sdca_class_drv: sdca_jack_process() runs at Function level and had no
typed route to the device's ops, and reading drvdata back as an
sdca_class_drv only works while that member happens to sit first in the
codec's private struct.

Patch 2 implements both hooks in the WCD9378 driver to enable GE 35
DETECTED_MODE detection, and clears the part's SDCA_CASCADE bit from
its SoundWire interrupt callback. That bit is specified as the
read-only OR of the SDCA interrupt status bits, so the bus driver never
writes it, but on this part it latches: left asserted it holds
SCP_INT1.PORT_0 set and the peripheral never leaves ALERT.

Tested on a Glymur CRD: headset insert and removal are reported during
playback, and an accessory present at boot is reported without waiting
for a transition.

Signed-off-by: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
---
Gopi Chandra Sekhar Reddy Kanala (2):
      ASoC: SDCA: add jack ops hooks
      ASoC: codecs: wcd9378-sdca: enable MBHC jack-detect (GE 35) interrupt

 include/sound/sdca_class.h           |  13 +++
 include/sound/sdca_interrupts.h      |   8 ++
 sound/soc/codecs/wcd9378-sdca.c      | 155 ++++++++++++++++++++++++++++++-----
 sound/soc/codecs/wcd9378-sdca.h      |   2 +
 sound/soc/codecs/wcd9378-sdw.c       |   3 +-
 sound/soc/sdca/sdca_class.c          |   2 +
 sound/soc/sdca/sdca_class_function.c |   8 ++
 sound/soc/sdca/sdca_interrupts.c     |   4 +-
 sound/soc/sdca/sdca_jack.c           |  10 +++
 9 files changed, 181 insertions(+), 24 deletions(-)
---
base-commit: 29beb21c21ada7207692b2d69fc58dcd15dab6e9
change-id: 20261205-b4-sdca-wcd9378-jack-29eb57a1411f

Best regards,
--  
Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-05 16:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 15:59 [PATCH 0/2] ASoC: SDCA: support hardware jack detection on WCD9378 Gopi Chandra Sekhar Reddy Kanala
2026-12-05 15:59 ` [PATCH 1/2] ASoC: SDCA: add jack ops hooks Gopi Chandra Sekhar Reddy Kanala
2026-12-05 16:18   ` sashiko-bot
2026-12-05 15:59 ` [PATCH 2/2] ASoC: codecs: wcd9378-sdca: enable MBHC jack-detect (GE 35) interrupt Gopi Chandra Sekhar Reddy Kanala
2026-12-05 16:24   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox