Skip to contentSkip to conversation

ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients

PATCH Superseded Simon Trimmer 1 participant 2 messages Jul 30, 2024 – Jul 31, 2024 Sound

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients

A number of laptops have gone to market with old firmware versions that export controls that have since been hidden, but we can't just install a newer firmware because the firmware for each product is customized and qualified by the OEM. The issue is that alsactl save and restore has no idea what controls are good to persist which can lead to misconfiguration.

As the ALSA controls for the firmware coefficients are not used in normal operation they can all be hidden, but add a kernel parameter so that they can be re-enabled for debugging.

---
Changes in v2:
- v1 was accidentally the backport version for older kernels instead of the one for v6.11

 sound/pci/hda/cs35l56_hda.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
sound/pci/hda/cs35l56_hda.c +5 -1
index 96d3f13c5abf..f2f623f713d1 100644
@@ -23,6 +23,10 @@
 #include "hda_cs_dsp_ctl.h"
 #include "hda_generic.h"
 
+static bool expose_dsp_controls;
+module_param(expose_dsp_controls, bool, 0444);
+MODULE_PARM_DESC(expose_dsp_controls, "Expose firmware controls as ALSA controls 0=no (default), 1=yes");
+
  /*
   * The cs35l56_hda_dai_config[] reg sequence configures the device as
   *  ASP1_BCLK_FREQ = 3.072 MHz
@@ -613,7 +617,7 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
 	 */
 	if (cs35l56->base.fw_patched)
 		cs_dsp_power_down(&cs35l56->cs_dsp);
-	else
+	else if (expose_dsp_controls)
 		add_dsp_controls_required = true;
 
 	cs35l56->base.fw_patched = false;
Signature · 1 line
2.43.0
#1 lore raw

Takashi - whilst the reasons for not adding the ALSA controls are different to
those of the CS35L41, given the dislike about being able to re-enable them using a kernel parameter for debugging we'll send a V3 that removes all the firmware control support.

Thanks
-Simon

Quoted 58 lines

-----Original Message-----
From: Simon Trimmer <[email protected]>
Sent: Tuesday, July 30, 2024 5:29 PM
To: [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; Simon Trimmer <[email protected]>
Subject: [PATCH v2] ALSA: hda: cs35l56: Stop creating ALSA controls for firmware coefficients

A number of laptops have gone to market with old firmware versions that export controls that have since been hidden, but we can't just install a newer firmware because the firmware for each product is customized and qualified by the OEM. The issue is that alsactl save and restore has no idea what controls are good to persist which can lead to misconfiguration.

As the ALSA controls for the firmware coefficients are not used in normal operation they can all be hidden, but add a kernel parameter so that they can be re-enabled for debugging.

---
Changes in v2:
- v1 was accidentally the backport version for older kernels instead of the one for v6.11

 sound/pci/hda/cs35l56_hda.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
sound/pci/hda/cs35l56_hda.c +4 -0
index 96d3f13c5abf..f2f623f713d1 100644
@@ -23,6 +23,10 @@
 #include "hda_cs_dsp_ctl.h"
 #include "hda_generic.h"
 
+static bool expose_dsp_controls;
+module_param(expose_dsp_controls, bool, 0444);
+MODULE_PARM_DESC(expose_dsp_controls, "Expose firmware controls as
 ALSA controls 0=no (default), 1=yes");
+
  /*
   * The cs35l56_hda_dai_config[] reg sequence configures the device as

* ASP1_BCLK_FREQ = 3.072 MHz

sound/pci/hda/cs35l56_hda.c +1 -1
@@ -613,7 +617,7 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda
 *cs35l56)
 	 */
 	if (cs35l56->base.fw_patched)
 		cs_dsp_power_down(&cs35l56->cs_dsp);
-	else
+	else if (expose_dsp_controls)
 		add_dsp_controls_required = true;
 

cs35l56->base.fw_patched = false;
--
2.43.0