Skip to contentSkip to conversation

ALSA: hda/hda_cs_dsp_ctl: Delete hda_cs_dsp_ctl module

PATCH Applied Richard Fitzgerald 2 participants 2 messages Apr 24, 2025 – Apr 27, 2025 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/hda_cs_dsp_ctl: Delete hda_cs_dsp_ctl module

Delete the hda_cs_dsp module and move the one array and one function that is used by the cs35l41_hda driver into that driver.

The cs35l41 and cs35l56 drivers stopped creating ALSA controls to wrap firmware controls. The reasons are explained in:

commit 312c04cee408 ("ALSA: hda: cs35l41: Stop creating ALSA Controls for firmware coefficients")

and

commit 34e1b1bb7324 ("ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients")

The cs35l56_hda driver now doesn't use hda_cs_dsp_ctl at all. The cs35l41_hda driver only uses the small array of firmware names and the function to read a control value. All other functions and data in hda_cs_dsp_ctl are unused. There is no need to keep a separate module for such a small amount of data and code that is only used by one driver, so remove the whole module.

---
 MAINTAINERS                    |   1 -
 sound/pci/hda/Kconfig          |   8 --
 sound/pci/hda/Makefile         |   2 -
 sound/pci/hda/cs35l41_hda.c    |  51 +++++--
 sound/pci/hda/cs35l56_hda.c    |   2 -
 sound/pci/hda/hda_cs_dsp_ctl.c | 249 ---------------------------------
 sound/pci/hda/hda_cs_dsp_ctl.h |  39 ------
 7 files changed, 38 insertions(+), 314 deletions(-)
 delete mode 100644 sound/pci/hda/hda_cs_dsp_ctl.c
 delete mode 100644 sound/pci/hda/hda_cs_dsp_ctl.h
MAINTAINERS +0 -1
index f9a9d3dced67..d4886d4f77c2 100644
@@ -5647,7 +5647,6 @@ F:	include/sound/cs*
 F:	sound/pci/hda/cirrus*
 F:	sound/pci/hda/cs*
 F:	sound/pci/hda/hda_component*
-F:	sound/pci/hda/hda_cs_dsp_ctl.*
 F:	sound/soc/codecs/cs*
 
 CIRRUS LOGIC HAPTIC DRIVERS
sound/pci/hda/Kconfig +0 -8
index 9c427270ff4f..15cc46032583 100644
@@ -110,10 +110,6 @@ config SND_HDA_SCODEC_CS35L41
 	select SND_HDA_GENERIC
 	select REGMAP_IRQ
 
-config SND_HDA_CS_DSP_CONTROLS
-	tristate
-	select FW_CS_DSP
-
 config SND_HDA_SCODEC_COMPONENT
 	tristate
 
@@ -125,7 +121,6 @@ config SND_HDA_SCODEC_CS35L41_I2C
 	depends on SND_SOC
 	select SND_SOC_CS35L41_LIB
 	select SND_HDA_SCODEC_CS35L41
-	select SND_HDA_CS_DSP_CONTROLS
 	select SND_SOC_CS_AMP_LIB
 	help
 	  Say Y or M here to include CS35L41 I2C HD-audio side codec support
@@ -142,7 +137,6 @@ config SND_HDA_SCODEC_CS35L41_SPI
 	depends on SND_SOC
 	select SND_SOC_CS35L41_LIB
 	select SND_HDA_SCODEC_CS35L41
-	select SND_HDA_CS_DSP_CONTROLS
 	select SND_SOC_CS_AMP_LIB
 	help
 	  Say Y or M here to include CS35L41 SPI HD-audio side codec support
@@ -165,7 +159,6 @@ config SND_HDA_SCODEC_CS35L56_I2C
 	select SND_SOC_CS35L56_SHARED
 	select SND_HDA_SCODEC_CS35L56
 	select SND_HDA_CIRRUS_SCODEC
-	select SND_HDA_CS_DSP_CONTROLS
 	select SND_SOC_CS_AMP_LIB
 	help
 	  Say Y or M here to include CS35L56 amplifier support with
@@ -182,7 +175,6 @@ config SND_HDA_SCODEC_CS35L56_SPI
 	select SND_SOC_CS35L56_SHARED
 	select SND_HDA_SCODEC_CS35L56
 	select SND_HDA_CIRRUS_SCODEC
-	select SND_HDA_CS_DSP_CONTROLS
 	select SND_SOC_CS_AMP_LIB
 	help
 	  Say Y or M here to include CS35L56 amplifier support with
sound/pci/hda/Makefile +0 -2
index 210c406dfbc5..2953def7db67 100644
@@ -37,7 +37,6 @@ snd-hda-scodec-cs35l41-spi-y :=	cs35l41_hda_spi.o
 snd-hda-scodec-cs35l56-y :=	cs35l56_hda.o
 snd-hda-scodec-cs35l56-i2c-y :=	cs35l56_hda_i2c.o
 snd-hda-scodec-cs35l56-spi-y :=	cs35l56_hda_spi.o
-snd-hda-cs-dsp-ctls-y :=	hda_cs_dsp_ctl.o
 snd-hda-scodec-component-y :=	hda_component.o
 snd-hda-scodec-tas2781-i2c-y :=	tas2781_hda_i2c.o
 snd-hda-scodec-tas2781-spi-y :=	tas2781_hda_spi.o tas2781_spi_fwlib.o
@@ -70,7 +69,6 @@ obj-$(CONFIG_SND_HDA_SCODEC_CS35L41_SPI) += snd-hda-scodec-cs35l41-spi.o
 obj-$(CONFIG_SND_HDA_SCODEC_CS35L56) += snd-hda-scodec-cs35l56.o
 obj-$(CONFIG_SND_HDA_SCODEC_CS35L56_I2C) += snd-hda-scodec-cs35l56-i2c.o
 obj-$(CONFIG_SND_HDA_SCODEC_CS35L56_SPI) += snd-hda-scodec-cs35l56-spi.o
-obj-$(CONFIG_SND_HDA_CS_DSP_CONTROLS) += snd-hda-cs-dsp-ctls.o
 obj-$(CONFIG_SND_HDA_SCODEC_COMPONENT) += snd-hda-scodec-component.o
 obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_I2C) += snd-hda-scodec-tas2781-i2c.o
 obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_SPI) += snd-hda-scodec-tas2781-spi.o
sound/pci/hda/cs35l41_hda.c +38 -13

129 lines not on this page · raw message

sound/pci/hda/cs35l56_hda.c +0 -2
index 235d22049aa9..6f8feac8c012 100644
@@ -20,7 +20,6 @@
 #include "cirrus_scodec.h"
 #include "cs35l56_hda.h"
 #include "hda_component.h"
-#include "hda_cs_dsp_ctl.h"
 #include "hda_generic.h"
 
  /*
@@ -1118,7 +1117,6 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_hda_pm_ops, "SND_HDA_SCODEC_CS35L56");
 MODULE_DESCRIPTION("CS35L56 HDA Driver");
 MODULE_IMPORT_NS("FW_CS_DSP");
 MODULE_IMPORT_NS("SND_HDA_CIRRUS_SCODEC");
-MODULE_IMPORT_NS("SND_HDA_CS_DSP_CONTROLS");
 MODULE_IMPORT_NS("SND_SOC_CS35L56_SHARED");
 MODULE_IMPORT_NS("SND_SOC_CS_AMP_LIB");
 MODULE_AUTHOR("Richard Fitzgerald <[email protected]>");
sound/pci/hda/hda_cs_dsp_ctl.c deleted +0 -249

249 lines not on this page · raw message

sound/pci/hda/hda_cs_dsp_ctl.h deleted +0 -39
deleted file mode 100644
index 2cf93359c4f2..000000000000
@@ -1,39 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * HDA DSP ALSA Control Driver
- *
- * Copyright 2022 Cirrus Logic, Inc.
- *
- * Author: Stefan Binding <[email protected]>
- */
-
-#ifndef __HDA_CS_DSP_CTL_H__
-#define __HDA_CS_DSP_CTL_H__
-
-#include <sound/soc.h>
-#include <linux/firmware/cirrus/cs_dsp.h>
-
-enum hda_cs_dsp_fw_id {
-	HDA_CS_DSP_FW_SPK_PROT,
-	HDA_CS_DSP_FW_SPK_CALI,
-	HDA_CS_DSP_FW_SPK_DIAG,
-	HDA_CS_DSP_FW_MISC,
-	HDA_CS_DSP_NUM_FW
-};
-
-struct hda_cs_dsp_ctl_info {
-	struct snd_card *card;
-	enum hda_cs_dsp_fw_id fw_type;
-	const char *device_name;
-};
-
-extern const char * const hda_cs_dsp_fw_ids[HDA_CS_DSP_NUM_FW];
-
-void hda_cs_dsp_add_controls(struct cs_dsp *dsp, const struct hda_cs_dsp_ctl_info *info);
-void hda_cs_dsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl);
-int hda_cs_dsp_write_ctl(struct cs_dsp *dsp, const char *name, int type,
-			 unsigned int alg, const void *buf, size_t len);
-int hda_cs_dsp_read_ctl(struct cs_dsp *dsp, const char *name, int type,
-			unsigned int alg, void *buf, size_t len);
-
-#endif /*__HDA_CS_DSP_CTL_H__*/
Signature · 1 line
2.43.0
Applied
#1 lore raw
Quoted 15 lines · Richard Fitzgerald

Delete the hda_cs_dsp module and move the one array and one function that is used by the cs35l41_hda driver into that driver.

The cs35l41 and cs35l56 drivers stopped creating ALSA controls to wrap firmware controls. The reasons are explained in:

commit 312c04cee408 ("ALSA: hda: cs35l41: Stop creating ALSA Controls for firmware coefficients")

and

commit 34e1b1bb7324 ("ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients")

Quoted 8 lines

The cs35l56_hda driver now doesn't use hda_cs_dsp_ctl at all. The cs35l41_hda driver only uses the small array of firmware names and the function to read a control value. All other functions and data in hda_cs_dsp_ctl are unused. There is no need to keep a separate module for such a small amount of data and code that is only used by one driver, so remove the whole module.

Thanks, applied now to for-next branch.

Takashi