Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: <alsa-devel@alsa-project.org>, <linux-sound@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>,
	"Stefan Binding" <sbinding@opensource.cirrus.com>
Subject: [PATCH v1] ALSA: hda: cs35l41: Stop creating ALSA Controls for firmware coefficients
Date: Tue, 30 Jul 2024 15:37:28 +0100	[thread overview]
Message-ID: <20240730143748.351651-1-sbinding@opensource.cirrus.com> (raw)

Add a kernel parameter to allow coefficients to be exposed as ALSA controls.

When the CS35L41 loads its firmware, it has a number of controls to
affect its behaviour. Currently, these controls are exposed as ALSA
Controls by default.

However, nothing in userspace currently uses them, and is unlikely to
do so in the future, therefore we don't need to create ASLA controls
for them.

These controls can be useful for debug, so we can add a kernel
parameter to re-enable them if necessary.

Disabling these controls would prevent userspace from trying to read
these controls when the CS35L41 is hibernating, which ordinarily
would result in an error message.

Also change the formatting of the other module parameter in
cs35l41_hda.c to match the new parameter.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
 sound/pci/hda/cs35l41_hda.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 4b411ed8c3fe..43d49a69ca14 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -76,8 +76,13 @@ static const struct cirrus_amp_cal_controls cs35l41_calibration_controls = {
 
 static bool firmware_autostart = 1;
 module_param(firmware_autostart, bool, 0444);
-MODULE_PARM_DESC(firmware_autostart, "Allow automatic firmware download on boot"
-			     "(0=Disable, 1=Enable) (default=1); ");
+MODULE_PARM_DESC(firmware_autostart,
+		 "Allow automatic firmware download on boot, (0=Disable, 1=Enable) (default=1)");
+
+static bool expose_dsp_controls;
+module_param(expose_dsp_controls, bool, 0444);
+MODULE_PARM_DESC(expose_dsp_controls,
+		 "Expose DSP controls as ALSA controls on boot, (0=Disable, 1=Enable) (default=0)");
 
 static const struct reg_sequence cs35l41_hda_config[] = {
 	{ CS35L41_PLL_CLK_CTRL,		0x00000430 }, // 3072000Hz, BCLK Input, PLL_REFCLK_EN = 1
@@ -603,7 +608,8 @@ static int cs35l41_init_dsp(struct cs35l41_hda *cs35l41)
 	if (ret)
 		goto err;
 
-	cs35l41_add_controls(cs35l41);
+	if (expose_dsp_controls)
+		cs35l41_add_controls(cs35l41);
 
 	cs35l41_hda_apply_calibration(cs35l41);
 
-- 
2.43.0


             reply	other threads:[~2024-07-30 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 14:37 Stefan Binding [this message]
2024-07-30 14:55 ` [PATCH v1] ALSA: hda: cs35l41: Stop creating ALSA Controls for firmware coefficients Jaroslav Kysela
2024-07-31 10:30   ` Takashi Iwai
2024-07-31 10:36     ` Jaroslav Kysela
2024-07-31 10:44       ` Takashi Iwai
2024-07-31 15:12         ` Stefan Binding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240730143748.351651-1-sbinding@opensource.cirrus.com \
    --to=sbinding@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox