Skip to contentSkip to conversation

Update SDCA Kconfig

PATCH Superseded Charles Keepax 2 participants 7 messages Jul 10, 2025 – Jul 11, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

cover Update SDCA Kconfig

Tidy up a bunch of makefile and Kconfig things, and pull the HID and IRQ into the main SDCA module.

Charles Keepax (2):
ASoC: SDCA: Kconfig/Makefile fixups
ASoC: SDCA: Pull HID and IRQ into the primary SDCA module

 sound/soc/sdca/Kconfig           | 15 ++++++++++-----
 sound/soc/sdca/Makefile          | 14 +++++++-------
 sound/soc/sdca/sdca_functions.c  |  1 -
 sound/soc/sdca/sdca_hid.c        |  2 +-
 sound/soc/sdca/sdca_interrupts.c |  8 ++++----
 5 files changed, 22 insertions(+), 18 deletions(-)
Signature · 1 line
2.39.5
author maintainer
#1 lore raw

PATCH 1/2 ASoC: SDCA: Kconfig/Makefile fixups

Tidy up a few bits of the SDCA Kconfig. Make the primary SDCA symbol visible again, whilst this is selected directly in current Intel systems it is not a given that is how other systems will use the subsystem and a user can not directly disable the symbol if it is being selected anyway.

Default both HID and IRQ to enabled, since typically if one wants SDCA all the functionality will be expected.

Finally, update the IRQ support to match the changes made to the HID support.

---
 sound/soc/sdca/Kconfig  | 15 ++++++++++-----
 sound/soc/sdca/Makefile | 10 ++++++----
 2 files changed, 16 insertions(+), 9 deletions(-)
sound/soc/sdca/Kconfig +10 -5
index 2253a300dcc3..7fd4cbba87bf 100644
@@ -2,25 +2,30 @@
 menu "SoundWire (SDCA)"
 
 config SND_SOC_SDCA
-	tristate
+	tristate "SDCA support"
 	depends on ACPI
 	help
 	  This option enables support for the MIPI SoundWire Device
 	  Class for Audio (SDCA).
 
-config SND_SOC_SDCA_OPTIONAL
-	def_tristate SND_SOC_SDCA || !SND_SOC_SDCA
-
 config SND_SOC_SDCA_HID
 	bool "SDCA HID support"
 	depends on SND_SOC_SDCA
 	depends on HID=y || HID=SND_SOC_SDCA
+	default y
+	help
+	  This option enables support for audio jack button reporting using HID.
 
 config SND_SOC_SDCA_IRQ
-	tristate
+	bool "SDCA IRQ support"
 	select REGMAP
 	select REGMAP_IRQ
+	depends on SND_SOC_SDCA
+	default y
 	help
 	  This option enables support for SDCA IRQs.
 
+config SND_SOC_SDCA_OPTIONAL
+	def_tristate SND_SOC_SDCA || !SND_SOC_SDCA
+
 endmenu
sound/soc/sdca/Makefile +6 -4
index 1efc869c6cbc..58a8f3ef3feb 100644
@@ -1,11 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-snd-soc-sdca-y	:= sdca_functions.o sdca_device.o sdca_regmap.o sdca_asoc.o
+snd-soc-sdca-y := sdca_functions.o sdca_device.o sdca_regmap.o sdca_asoc.o
 snd-soc-sdca-hid-y := sdca_hid.o
 snd-soc-sdca-irq-y := sdca_interrupts.o
 
-obj-$(CONFIG_SND_SOC_SDCA)	+= snd-soc-sdca.o
+obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca.o
 ifdef CONFIG_SND_SOC_SDCA_HID
-obj-$(CONFIG_SND_SOC_SDCA)	+= snd-soc-sdca-hid.o
+obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-hid.o
+endif
+ifdef CONFIG_SND_SOC_SDCA_IRQ
+obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-irq.o
 endif
-obj-$(CONFIG_SND_SOC_SDCA_IRQ)	+= snd-soc-sdca-irq.o
Signature · 1 line
2.39.5
#2 lore raw

Re: [PATCH 1/2] ASoC: SDCA: Kconfig/Makefile fixups

Quoted 5 lines · Charles Keepax

Tidy up a few bits of the SDCA Kconfig. Make the primary SDCA symbol visible again, whilst this is selected directly in current Intel systems it is not a given that is how other systems will use the subsystem and a user can not directly disable the symbol if it is being selected anyway.

I'm not sure that making this one visible is a good idea even if I don't see any immediate bug as a result.
In general, I think symbols should be either user-visible or get selected by other drivers, mixing the two tends to cause additional problems.

Would it be possible to just not select SND_SOC_SDCA from drivers that can use it and require users to enable it manually, or does that not work? I assume there would be a link failure with SND_SOC_ACPI_INTEL_SDCA_QUIRKS=y and SND_SOC_SDCA=m?

Arnd

author maintainer
#3 lore raw

Re: [PATCH 1/2] ASoC: SDCA: Kconfig/Makefile fixups

Quoted 13 lines · Arnd Bergmann
Quoted 5 lines · Charles Keepax

Tidy up a few bits of the SDCA Kconfig. Make the primary SDCA symbol visible again, whilst this is selected directly in current Intel systems it is not a given that is how other systems will use the subsystem and a user can not directly disable the symbol if it is being selected anyway.

I'm not sure that making this one visible is a good idea even if I don't see any immediate bug as a result.
In general, I think symbols should be either user-visible or get selected by other drivers, mixing the two tends to cause additional problems.

Quoted 5 lines

Would it be possible to just not select SND_SOC_SDCA from drivers that can use it and require users to enable it manually, or does that not work? I assume there would be a link failure with SND_SOC_ACPI_INTEL_SDCA_QUIRKS=y and SND_SOC_SDCA=m?

Certainly nothing needs it right now, so I will drop that part of the patch for v2.

Thanks,
Charles

author maintainer
#4 lore raw

PATCH 2/2 ASoC: SDCA: Pull HID and IRQ into the primary SDCA module

In reply to Charles Keepax

If the HID or the IRQ are selected as options they will always require loading alongside the main SDCA module. Since it will never be possible to run without them the value of keeping them as separate modules is fairly limited. Pull them into the main SDCA module to simplify things still further.

---
 sound/soc/sdca/Makefile          | 10 ++++------
 sound/soc/sdca/sdca_functions.c  |  1 -
 sound/soc/sdca/sdca_hid.c        |  2 +-
 sound/soc/sdca/sdca_interrupts.c |  8 ++++----
 4 files changed, 9 insertions(+), 12 deletions(-)
sound/soc/sdca/Makefile +4 -6
index 58a8f3ef3feb..08f87eb6746d 100644
@@ -1,13 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 snd-soc-sdca-y := sdca_functions.o sdca_device.o sdca_regmap.o sdca_asoc.o
-snd-soc-sdca-hid-y := sdca_hid.o
-snd-soc-sdca-irq-y := sdca_interrupts.o
-
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca.o
 ifdef CONFIG_SND_SOC_SDCA_HID
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-hid.o
+snd-soc-sdca-y += sdca_hid.o
 endif
 ifdef CONFIG_SND_SOC_SDCA_IRQ
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-irq.o
+snd-soc-sdca-y += sdca_interrupts.o
 endif
+
+obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca.o
sound/soc/sdca/sdca_functions.c +0 -1
index c34f3bf62983..be09b7a34102 100644
@@ -1943,4 +1943,3 @@ EXPORT_SYMBOL_NS(sdca_parse_function, "SND_SOC_SDCA");
 
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_DESCRIPTION("SDCA library");
-MODULE_IMPORT_NS("SND_SOC_SDCA_HID");
sound/soc/sdca/sdca_hid.c +1 -1
index b227ad94d08f..2224ade59aff 100644
@@ -121,7 +121,7 @@ int sdca_add_hid_device(struct device *dev, struct sdca_entity *entity)
 
 	return 0;
 }
-EXPORT_SYMBOL_NS(sdca_add_hid_device, "SND_SOC_SDCA_HID");
+EXPORT_SYMBOL_NS(sdca_add_hid_device, "SND_SOC_SDCA");
 
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_DESCRIPTION("SDCA HID library");
sound/soc/sdca/sdca_interrupts.c +4 -4
index edb045c7ebb0..2f85fcc6e544 100644
@@ -279,7 +279,7 @@ int sdca_irq_request(struct device *dev, struct sdca_interrupt_info *info,
 
 	return 0;
 }
-EXPORT_SYMBOL_NS_GPL(sdca_irq_request, "SND_SOC_SDCA_IRQ");
+EXPORT_SYMBOL_NS_GPL(sdca_irq_request, "SND_SOC_SDCA");
 
 /**
  * sdca_irq_data_populate - Populate common interrupt data
@@ -313,7 +313,7 @@ int sdca_irq_data_populate(struct snd_soc_component *component,
 
 	return 0;
 }
-EXPORT_SYMBOL_NS_GPL(sdca_irq_data_populate, "SND_SOC_SDCA_IRQ");
+EXPORT_SYMBOL_NS_GPL(sdca_irq_data_populate, "SND_SOC_SDCA");
 
 /**
  * sdca_irq_populate - Request all the individual IRQs for an SDCA Function
@@ -393,7 +393,7 @@ int sdca_irq_populate(struct sdca_function_data *function,
 
 	return 0;
 }
-EXPORT_SYMBOL_NS_GPL(sdca_irq_populate, "SND_SOC_SDCA_IRQ");
+EXPORT_SYMBOL_NS_GPL(sdca_irq_populate, "SND_SOC_SDCA");
 
 /**
  * sdca_irq_allocate - allocate an SDCA interrupt structure for a device
@@ -433,7 +433,7 @@ struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev,
 
 	return info;
 }
-EXPORT_SYMBOL_NS_GPL(sdca_irq_allocate, "SND_SOC_SDCA_IRQ");
+EXPORT_SYMBOL_NS_GPL(sdca_irq_allocate, "SND_SOC_SDCA");
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SDCA IRQ library");
Signature · 1 line
2.39.5
#5 lore raw

Re: [PATCH 2/2] ASoC: SDCA: Pull HID and IRQ into the primary SDCA module

sound/soc/sdca/Makefile line 9

Quoted 9 lines · Charles Keepax
sound/soc/sdca/Makefile +2 -3
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca.o
 ifdef CONFIG_SND_SOC_SDCA_HID
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-hid.o
+snd-soc-sdca-y += sdca_hid.o
 endif
 ifdef CONFIG_SND_SOC_SDCA_IRQ
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-irq.o
+snd-soc-sdca-y += sdca_interrupts.o
 endif

Since these are now both 'bool' options, you could write this more concisely as

snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_HID) += sdca_hid.o snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_IRQ) += sdca_interrupts.o

Arnd

author maintainer
#6 lore raw

Re: [PATCH 2/2] ASoC: SDCA: Pull HID and IRQ into the primary SDCA module

Quoted 14 lines · Arnd Bergmann

sound/soc/sdca/Makefile line 9

Quoted 9 lines · Charles Keepax
sound/soc/sdca/Makefile +2 -3
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca.o
 ifdef CONFIG_SND_SOC_SDCA_HID
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-hid.o
+snd-soc-sdca-y += sdca_hid.o
 endif
 ifdef CONFIG_SND_SOC_SDCA_IRQ
-obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-irq.o
+snd-soc-sdca-y += sdca_interrupts.o
 endif

Since these are now both 'bool' options, you could write this more concisely as

Quoted 2 lines

snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_HID) += sdca_hid.o snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_IRQ) += sdca_interrupts.o

Thanks, yeah I will update for v2.

Thanks,
Charles