From: Cezary Rojewski <cezary.rojewski@intel.com>
To: tiwai@suse.com
Cc: broonie@kernel.org, perex@perex.cz, amade@asmblr.net,
linux-sound@vger.kernel.org,
Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH] ALSA: hda: Allow for codec model selection with module param
Date: Mon, 14 Sep 2026 12:22:53 +0200 [thread overview]
Message-ID: <20260914102253.2969724-1-cezary.rojewski@intel.com> (raw)
Model selection allows for customization of codec behaviour and thus
dealing with various problems on very specific configurations. The
parameter already exists but is part of snd_hda_intel specifically.
Non-Intel HDAudio controllers and DSP-capable drivers cannot benefit
from it.
The common place for all the bus drivers is snd_hda_codec. Add modelname
parameter there and honor it when initializing codec->modelname field.
Link: https://github.com/thesofproject/linux/issues/5683
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
sound/hda/common/codec.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/sound/hda/common/codec.c b/sound/hda/common/codec.c
index 7d17d773cfbf..73b0009a0395 100644
--- a/sound/hda/common/codec.c
+++ b/sound/hda/common/codec.c
@@ -32,6 +32,10 @@
#define codec_has_clkstop(codec) \
((codec)->core.power_caps & AC_PWRST_CLKSTOP)
+static char *modelname[HDA_MAX_CODEC_ADDRESS];
+module_param_array_named(model, modelname, charp, NULL, 0444);
+MODULE_PARM_DESC(model, "Use the given board model.");
+
static int call_exec_verb(struct hda_bus *bus, struct hda_codec *codec,
unsigned int cmd, unsigned int flags,
unsigned int *res)
@@ -966,6 +970,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
bool snddev_managed)
{
char component[31];
+ const char *mname;
hda_nid_t fg;
int err;
static const struct snd_device_ops dev_ops = {
@@ -988,8 +993,9 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
snd_hda_sysfs_init(codec);
- if (codec->bus->modelname) {
- codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
+ mname = bus->modelname ? bus->modelname : modelname[codec_addr];
+ if (mname && strlen(mname)) {
+ codec->modelname = kstrdup(mname, GFP_KERNEL);
if (!codec->modelname)
return -ENOMEM;
}
--
2.34.1
next reply other threads:[~2026-09-14 10:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 10:22 Cezary Rojewski [this message]
2026-09-14 16:01 ` [PATCH] ALSA: hda: Allow for codec model selection with module param Takashi Iwai
2026-09-14 16:29 ` Cezary Rojewski
2026-09-14 16:44 ` Takashi Iwai
2026-09-14 17:58 ` Cezary Rojewski
2026-09-15 11:14 ` Takashi Iwai
2026-09-15 11:26 ` Cezary Rojewski
2026-09-15 16:02 ` Takashi Iwai
2026-09-16 8:29 ` Cezary Rojewski
2026-09-16 10:57 ` Takashi Iwai
2026-09-18 8:33 ` Cezary Rojewski
2026-09-28 11:02 ` Takashi Iwai
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=20260914102253.2969724-1-cezary.rojewski@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amade@asmblr.net \
--cc=broonie@kernel.org \
--cc=linux-sound@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.