Skip to contentSkip to conversation

SDCA Jack Fixups

PATCH In review Charles Keepax 3 participants 6 messages Dec 15, 2025 – Dec 22, 2025

Subsystems (3)
lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

cover SDCA Jack Fixups

Some fixups to the jack handling, adding some necessary hooks to connect things with the machine driver. I have split these out from the system suspend chain as that has been generating a fair amount of discussion and getting these 3 merged is far more important to get basic functionality working smoothly. I will do a spin of the system suspend stuff soon, if either no new comments pop up, or we reach some consensus on how to proceed.

Thanks,
Charles

Charles Keepax (3):
ASoC: SDCA: Factor out jack handling into new c file
ASoC: SDCA: Add ability to connect SDCA jacks to ASoC jacks
ASoC: SDCA: Add ASoC jack hookup in class driver

 include/sound/sdca_jack.h            |  32 ++++
 sound/soc/sdca/Makefile              |   2 +-
 sound/soc/sdca/sdca_class_function.c |  13 ++
 sound/soc/sdca/sdca_interrupts.c     |  83 +--------
 sound/soc/sdca/sdca_jack.c           | 244 +++++++++++++++++++++++++++
 5 files changed, 297 insertions(+), 77 deletions(-)
 create mode 100644 include/sound/sdca_jack.h
 create mode 100644 sound/soc/sdca/sdca_jack.c
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH RESEND 1/3 ASoC: SDCA: Factor out jack handling into new c file

The jack code is perhaps a bit large for being in the interrupt code directly. Improve the encapsulation by factoring out the jack handling code into a new c file, as is already done for HID and FDL. Whilst doing so also add a jack_state structure to hold the jack state for improved expandability in the future.

---
 include/sound/sdca_jack.h        |  27 ++++++
 sound/soc/sdca/Makefile          |   2 +-
 sound/soc/sdca/sdca_interrupts.c |  83 ++----------------
 sound/soc/sdca/sdca_jack.c       | 140 +++++++++++++++++++++++++++++++
 4 files changed, 175 insertions(+), 77 deletions(-)
 create mode 100644 include/sound/sdca_jack.h
 create mode 100644 sound/soc/sdca/sdca_jack.c
include/sound/sdca_jack.h new file +27 -0
new file mode 100644
index 0000000000000..9fad5f22cbb9e
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * The MIPI SDCA specification is available for public downloads at
+ * https://www.mipi.org/mipi-sdca-v1-0-download
+ *
+ * Copyright (C) 2025 Cirrus Logic, Inc. and
+ *                    Cirrus Logic International Semiconductor Ltd.
+ */
+
+#ifndef __SDCA_JACK_H__
+#define __SDCA_JACK_H__
+
+struct sdca_interrupt;
+struct snd_kcontrol;
+
+/**
+ * struct jack_state - Jack state structure to keep data between interrupts
+ * @kctl: Pointer to the ALSA control attached to this jack
+ */
+struct jack_state {
+	struct snd_kcontrol *kctl;
+};
+
+int sdca_jack_alloc_state(struct sdca_interrupt *interrupt);
+int sdca_jack_process(struct sdca_interrupt *interrupt);
+
+#endif // __SDCA_JACK_H__
sound/soc/sdca/Makefile +1 -1
index f6b73275d9649..b3b0f5d94c8de 100644
@@ -3,7 +3,7 @@
 snd-soc-sdca-y := sdca_functions.o sdca_device.o sdca_function_device.o \
 		  sdca_regmap.o sdca_asoc.o sdca_ump.o
 snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_HID) += sdca_hid.o
-snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_IRQ) += sdca_interrupts.o
+snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_IRQ) += sdca_interrupts.o sdca_jack.o
 snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_FDL) += sdca_fdl.o
 
 snd-soc-sdca-class-y := sdca_class.o
sound/soc/sdca/sdca_interrupts.c +7 -76

109 lines not on this page · raw message

sound/soc/sdca/sdca_jack.c new file +140 -0

140 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#2 lore raw

PATCH RESEND 2/3 ASoC: SDCA: Add ability to connect SDCA jacks to ASoC jacks

In reply to Charles Keepax

Add handling for the ASoC jack API to SDCA to allow user-space to be hooked up normally.

---
 include/sound/sdca_jack.h  |   5 ++
 sound/soc/sdca/sdca_jack.c | 106 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 110 insertions(+), 1 deletion(-)
include/sound/sdca_jack.h +5 -0
index 9fad5f22cbb9e..3ec22046d3ebc 100644
@@ -12,16 +12,21 @@
 
 struct sdca_interrupt;
 struct snd_kcontrol;
+struct snd_soc_jack;
 
 /**
  * struct jack_state - Jack state structure to keep data between interrupts
  * @kctl: Pointer to the ALSA control attached to this jack
+ * @jack: Pointer to the ASoC jack struct for this jack
  */
 struct jack_state {
 	struct snd_kcontrol *kctl;
+	struct snd_soc_jack *jack;
 };
 
 int sdca_jack_alloc_state(struct sdca_interrupt *interrupt);
 int sdca_jack_process(struct sdca_interrupt *interrupt);
+int sdca_jack_set_jack(struct sdca_interrupt_info *info, struct snd_soc_jack *jack);
+int sdca_jack_report(struct sdca_interrupt *interrupt);
 
 #endif // __SDCA_JACK_H__
sound/soc/sdca/sdca_jack.c +105 -1

126 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#3 lore raw

PATCH RESEND 3/3 ASoC: SDCA: Add ASoC jack hookup in class driver

In reply to Charles Keepax

Add the necessary calls to the class driver to connect the ASoC jack from the machine driver.

---
 sound/soc/sdca/sdca_class_function.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
sound/soc/sdca/sdca_class_function.c +13 -0
index 0028482a1e752..416948cfb5cb9 100644
@@ -19,6 +19,7 @@
 #include <sound/sdca_fdl.h>
 #include <sound/sdca_function.h>
 #include <sound/sdca_interrupts.h>
+#include <sound/sdca_jack.h>
 #include <sound/sdca_regmap.h>
 #include <sound/sdw.h>
 #include <sound/soc-component.h>
@@ -195,6 +196,15 @@ static int class_function_component_probe(struct snd_soc_component *component)
 	return sdca_irq_populate(drv->function, component, core->irq_info);
 }
 
+static int class_function_set_jack(struct snd_soc_component *component,
+				   struct snd_soc_jack *jack, void *d)
+{
+	struct class_function_drv *drv = snd_soc_component_get_drvdata(component);
+	struct sdca_class_drv *core = drv->core;
+
+	return sdca_jack_set_jack(core->irq_info, jack);
+}
+
 static const struct snd_soc_component_driver class_function_component_drv = {
 	.probe			= class_function_component_probe,
 	.endianness		= 1,
@@ -351,6 +361,9 @@ static int class_function_probe(struct auxiliary_device *auxdev,
 		return dev_err_probe(dev, PTR_ERR(drv->regmap),
 				     "failed to create regmap");
 
+	if (desc->type == SDCA_FUNCTION_TYPE_UAJ)
+		cmp_drv->set_jack = class_function_set_jack;
+
 	ret = sdca_asoc_populate_component(dev, drv->function, cmp_drv,
 					   &dais, &num_dais,
 					   &class_function_sdw_ops);
Signature · 1 line
2.47.3
reviewer Reviewed-by on the v1 series
#4 lore raw
In reply to Charles Keepax
Quoted 10 lines · Charles Keepax

Some fixups to the jack handling, adding some necessary hooks to connect things with the machine driver. I have split these out from the system suspend chain as that has been generating a fair amount of discussion and getting these 3 merged is far more important to get basic functionality working smoothly. I will do a spin of the system suspend stuff soon, if either no new comments pop up, or we reach some consensus on how to proceed.

Thanks,
Charles

Looks good to me.
For the series:

Quoted 15 lines

Charles Keepax (3):
ASoC: SDCA: Factor out jack handling into new c file
ASoC: SDCA: Add ability to connect SDCA jacks to ASoC jacks
ASoC: SDCA: Add ASoC jack hookup in class driver

 include/sound/sdca_jack.h            |  32 ++++
 sound/soc/sdca/Makefile              |   2 +-
 sound/soc/sdca/sdca_class_function.c |  13 ++
 sound/soc/sdca/sdca_interrupts.c     |  83 +--------
 sound/soc/sdca/sdca_jack.c           | 244 +++++++++++++++++++++++++++
 5 files changed, 297 insertions(+), 77 deletions(-)
 create mode 100644 include/sound/sdca_jack.h
 create mode 100644 sound/soc/sdca/sdca_jack.c
maintainer
#5 lore raw
In reply to Charles Keepax
Quoted 9 lines · Charles Keepax

Some fixups to the jack handling, adding some necessary hooks to connect things with the machine driver. I have split these out from the system suspend chain as that has been generating a fair amount of discussion and getting these 3 merged is far more important to get basic functionality working smoothly. I will do a spin of the system suspend stuff soon, if either no new comments pop up, or we reach some consensus on how to proceed.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: SDCA: Factor out jack handling into new c file

      commit: 3addd63d1fba8d9013e00b06d9420e39271c0c4e
[2/3] ASoC: SDCA: Add ability to connect SDCA jacks to ASoC jacks
      commit: 82e12800f563baf663277ef0017f40a335b8e84c
[3/3] ASoC: SDCA: Add ASoC jack hookup in class driver
      commit: 99a3ef1e81cd1775bc1f8cc2ad188b1fc755d5cd

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark