From patchwork Thu Sep 29 07:35:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16A1DC07E9D for ; Thu, 29 Sep 2022 07:37:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0D8DD161F; Thu, 29 Sep 2022 09:36:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0D8DD161F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437031; bh=wFwH3HagtYKMjlj352JFNByNP5gYt/beqObaDPq5gdg=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=K5xvNVjdWzCexpuPyufT90FfC/LGjEJANXfFmbPd/raBPZu2OOaa8mPBYxM6KP6XZ 7y22rUosSL7p8WmeZCE4TH6hwkeHcqAvVdU79OxgnbaEsWgAbsXWDGPeDsAPSkeQTR UXAjPI9lMBz4t+IoMDqu1mjtHsHmi8yrZHg0GpHM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2A61BF8053A; Thu, 29 Sep 2022 09:36:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D0ACF8053C; Thu, 29 Sep 2022 09:35:58 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6A42BF800AA for ; Thu, 29 Sep 2022 09:35:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6A42BF800AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WnRIR3oW"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="5OPOT4iK" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D930721B9B; Thu, 29 Sep 2022 07:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436951; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ihg9bap9gIGjE0kK7NEFdJh1PD6QWEL0SClbwV/dBcA=; b=WnRIR3oWGpTVAkIgKiODOPqzb9zdmpBR6X2/Gp49Q7cBZIi4nmG9QnNorl+HAJZb/x0RGI NKGfDUynd2yC147vJMkedq0PDbqaoWr1KFVk9Lp99AMbP7VSFRvfoA33tFjKY2CgEZWci2 qT39t5kEUbd+rXvVqSivf7l7HY+KJB4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436951; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ihg9bap9gIGjE0kK7NEFdJh1PD6QWEL0SClbwV/dBcA=; b=5OPOT4iK+kY4hTRpie3MGAzhQ6F827rpb/Pw1KdmGOETyEHdPEYjCc69m1sC4gwIDcnPSL e5HtM8R4wITprKCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B8C281348E; Thu, 29 Sep 2022 07:35:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gPJRLNdKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:51 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 1/8] ALSA: hda/realtek: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:38 +0200 Message-Id: <20220929073545.1085-2-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to Realek codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_realtek.model=foobar or snd_hda_codec_realtek.model=103c:89c6 for applying a quirk. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3dc19174670e..351eb582ad8c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,11 @@ #include "hda_generic.h" #include "hda_component.h" +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); + /* keep halting ALC5505 DSP, for power saving */ #define HALT_REALTEK_ALC5505 @@ -1207,6 +1213,11 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) kfree(spec); return err; } + + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + return 0; } From patchwork Thu Sep 29 07:35:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96204C07E9D for ; Thu, 29 Sep 2022 07:37:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9BF6585D; Thu, 29 Sep 2022 09:36:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9BF6585D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437056; bh=Jzo5+IRAgeILzE6U7oKAiZ8P4/AmWnpvBw/MrybUGIs=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kxrIqgBSpW+gHEg2l0cfAwiKANkVylg8cPDASXRkKztgfzTLP8wJ6FVqeWgkOvfWv HUtEX6OF/cDEmAGSodA6nurCY/HwQ5MmD4nAWtXXutgwftljimk3d7AaW8prZGCZsx v1Gcx3PuToa4L22+s6KriEatlLZHYIfQzW9e5DmQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E0F7BF80519; Thu, 29 Sep 2022 09:36:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 62551F8053B; Thu, 29 Sep 2022 09:35:59 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 42A6AF80095 for ; Thu, 29 Sep 2022 09:35:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 42A6AF80095 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cZuTKJon"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="YCEtSlv5" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BC05E1F8D7; Thu, 29 Sep 2022 07:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436952; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y80Ayjl17PZYBNqDnDHhsBIlrgYlGzp6bV3XVVGLXzw=; b=cZuTKJon0YoHQmxDpiNHoOwlL2DjV8hE0s3Pp4Q1/cERU0XnD7I3HtZ4PcX7/WwZEIKBKI D68V8XgvlqMlKV8wUyuP/eGHsX9S1GmPK/ev+nevKM326OEUHg4hLPuw/spuf1QAtBfIpB +CN6MrAsEu1wmBnHhLBK93aij1izdeY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436952; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y80Ayjl17PZYBNqDnDHhsBIlrgYlGzp6bV3XVVGLXzw=; b=YCEtSlv5J1hFo5zUxfipw0cdeezgyIAnd3VMe6D2lGysQFVPZpB7ZpQV+x04UJAdH8mJ4t 7vxTYpatTsafzzDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A3D3C1348E; Thu, 29 Sep 2022 07:35:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IPJIJ9hKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:52 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 2/8] ALSA: hda/cirrus: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:39 +0200 Message-Id: <20220929073545.1085-3-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to Cirrus codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_cirrus.model=foobar or snd_hda_codec_cirrus.model=106b:5e00 for applying a quirk. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_cirrus.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 6807b4708a17..c70c72c85831 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -17,6 +18,11 @@ #include "hda_jack.h" #include "hda_generic.h" +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); + /* */ @@ -581,6 +587,10 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid) codec->power_save_node = 1; snd_hda_gen_spec_init(&spec->gen); + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + return spec; } From patchwork Thu Sep 29 07:35:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B368C07E9D for ; Thu, 29 Sep 2022 07:38:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 66ACDE11; Thu, 29 Sep 2022 09:37:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 66ACDE11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437108; bh=qFN7jUuOGMkQOaWtoiGhhdtNWyaUS2lH4zLn4LcbPU0=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LaTw8MRBFYL5CEovORjM1sg57glP9mVUQrlhU2ZW0SETIB1Hzi+zUwno653RXBAL/ GfEYIGsW9cgR7Wjw/y6bnLAJFt5dnuQbe2knZ59M6bfDvfKJQiGTM9xl08MoLez+2z 5m4b7fLrGZDW+vCLo8MNsMv3SRrdYdqOSNbYsAmI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3CD70F80559; Thu, 29 Sep 2022 09:36:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0C06FF80552; Thu, 29 Sep 2022 09:36:05 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 39389F8016D for ; Thu, 29 Sep 2022 09:35:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 39389F8016D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="oqxncCfv"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="MsO7N0+T" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 833081F8EF; Thu, 29 Sep 2022 07:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436953; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMq28fUkkr5I3xzrzMWEd0O2MyuxmyzH9Xr7cFN7oiU=; b=oqxncCfvk3eFmpq3qaohLv8pEgG4WhkE4zJtHe/EY8XTlS3qJKJ2mE4dtHEo6cAuHSDCgq G95aYFzTuWaYvZexfwrGQSMowifxd6zCvEn1wzZPMCpLGeRC3+kGKzOHkC/RZm15ce0cbU l88P46qphSSQ4HttPGnGpNF17K8MWMo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436953; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMq28fUkkr5I3xzrzMWEd0O2MyuxmyzH9Xr7cFN7oiU=; b=MsO7N0+TVDIGHJPuKEC1zGKPj+gHjiq8oQzR6DB3U+IQQRqwode/3YMdLLvQu0cVPlzJod r6P5WYbNL3e7bkBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5F1061348E; Thu, 29 Sep 2022 07:35:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MEBqFtlKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:53 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 3/8] ALSA: hda/conexant: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:40 +0200 Message-Id: <20220929073545.1085-4-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to Conexant codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_conexant.model=foobar or snd_hda_codec_conexant.model=17aa:3905 for applying a quirk no matter whether you use snd-hda-intel or SOF. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_conexant.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 7b1a30a551f6..8a4a793740f3 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -21,6 +22,11 @@ #include "hda_jack.h" #include "hda_generic.h" +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); + struct conexant_spec { struct hda_gen_spec gen; @@ -1038,6 +1044,10 @@ static int patch_conexant_auto(struct hda_codec *codec) codec->spec = spec; codec->patch_ops = cx_auto_patch_ops; + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + cx_auto_parse_eapd(codec); spec->gen.own_eapd_ctl = 1; From patchwork Thu Sep 29 07:35:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B502AC07E9D for ; Thu, 29 Sep 2022 07:38:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CAC0C1635; Thu, 29 Sep 2022 09:38:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CAC0C1635 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437133; bh=GfpdYj36xvqhYENPTPuVE9MgIrktoltAjMJddzC8fOY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mSUXamJq7lApGbOxKeoWZC5Q/6+gp3AmtAsBsOe7/hLEQn5xc75G9G3B7rtnlVlsU EIvEWpEUsk5EAfXqkxKiTekPs+oXyri5ZdYsUfo4nDPNA+ZwQRisoTzmbtPLXvYnYi zJCnkcVN5hnf4kKu9UdfECXt4I8BOX0PGP8PpLGI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1278FF80567; Thu, 29 Sep 2022 09:36:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2ED33F80539; Thu, 29 Sep 2022 09:36:05 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A3C14F804F1 for ; Thu, 29 Sep 2022 09:35:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A3C14F804F1 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KzWpOtcz"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="UIMGxHfg" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0E26C1F919; Thu, 29 Sep 2022 07:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436954; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mAfnPHJ1H89TtOAUWzbySJIFphztr6xSuVREkF3uLN8=; b=KzWpOtcz4nO8ub893+H9+/zRDdaayBhTsSStucnBabZE6fIzX2C/hVLB+1nhwXcAbsVS8d MJsv3oTy3rWVSvIV4+9c9vnwd45b0JECVjbWQLbFaaLIWDugg5jBCVqikUZJsuc5Tfi0sq +pJYXcuwejYIk53LlCvd1SDrH5d98mM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436954; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mAfnPHJ1H89TtOAUWzbySJIFphztr6xSuVREkF3uLN8=; b=UIMGxHfgbxhO/uGl000GsLhUv5ZgGPfuQzXRFuF5u7fA+Fd7cgYhQaUy0pwgmGxU6i6Wel gYD6jvz95X3zUrBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EC7B11348E; Thu, 29 Sep 2022 07:35:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UAsWOdlKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:53 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 4/8] ALSA: hda/cs8409: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:41 +0200 Message-Id: <20220929073545.1085-5-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to CS8409 codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_cs8409.model=foobar or snd_hda_codec_cs8409.model=1028:0c43 for applying a quirk no matter whether you use snd-hda-intel or SOF. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_cs8409.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index 754aa8ddd2e4..13aef05383a4 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -9,10 +9,16 @@ #include #include #include +#include #include #include #include +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); + #include "patch_cs8409.h" /****************************************************************************** @@ -66,6 +72,10 @@ static struct cs8409_spec *cs8409_alloc_spec(struct hda_codec *codec) INIT_DELAYED_WORK(&spec->i2c_clk_work, cs8409_disable_i2c_clock_worker); snd_hda_gen_spec_init(&spec->gen); + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + return spec; } From patchwork Thu Sep 29 07:35:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD73EC04A95 for ; Thu, 29 Sep 2022 07:37:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E6B9615CC; Thu, 29 Sep 2022 09:36:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E6B9615CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437063; bh=RbPVhJcqhuKo4Lr3CPR4cpU3xz2CDH+l5VXOkws6klE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=m0iooJroOPFrrh1N6I1s9dgKISNIe9TtuEav4pYSVhxzjuNkt2eKFCSkY57H943kY Y1I15aCRewgC7GaWnOR+DrBsguqU4t0wGWIEmYvZP2EkuyS5oRKBQP/I5M112Gxr6E RzRCXUI07ZbS+eKJA8vojcCwni/uzi5HNPxK6ExI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 78942F80543; Thu, 29 Sep 2022 09:36:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1E22F80542; Thu, 29 Sep 2022 09:36:01 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3F80DF80537 for ; Thu, 29 Sep 2022 09:35:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3F80DF80537 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ep1bZ/RI"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="D+uwLUcp" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9C4E61F8D7; Thu, 29 Sep 2022 07:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436954; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3k0Wu1ao03eUEa03hvfuX+8nm1JAJbHDAanqS0wihNw=; b=ep1bZ/RIkVeJ0oSfgeu5jJPjKOcSpZKqrlNnd14D4tlQtKuP4iYtjZfifEcDFSd1O3I5r2 q1S8WOk3rljhJAl2RwPMP1vBSOMMvwUENaCbQxw0ZjMg/n/YU0t90WvUUpvU8qyfe62xmi N8Ma99r48FWw65BjmPvmeeEP6CqeglU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436954; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3k0Wu1ao03eUEa03hvfuX+8nm1JAJbHDAanqS0wihNw=; b=D+uwLUcpFrM1Sucj9RxXaxtpX9tGGjtZH5N4nIUkpZNX+LhbQecvkyUqxdtDE1g7C5kSG2 LKOdLpOfebty+LAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7FF5D1348E; Thu, 29 Sep 2022 07:35:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gLKGHtpKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:54 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 5/8] ALSA: hda/analog: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:42 +0200 Message-Id: <20220929073545.1085-6-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to Analog codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_analog.model=foobar or snd_hda_codec_analog.model=103c:2a82 for applying a quirk no matter whether you use snd-hda-intel or SOF. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_analog.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 8afe6000f7da..1a6efa79309f 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -18,6 +19,10 @@ #include "hda_jack.h" #include "hda_generic.h" +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); struct ad198x_spec { struct hda_gen_spec gen; @@ -203,6 +208,11 @@ static int alloc_ad_spec(struct hda_codec *codec) codec->spec = spec; snd_hda_gen_spec_init(&spec->gen); codec->patch_ops = ad198x_auto_patch_ops; + + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + return 0; } From patchwork Thu Sep 29 07:35:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3884DC07E9D for ; Thu, 29 Sep 2022 07:38:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 602D31655; Thu, 29 Sep 2022 09:37:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 602D31655 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437121; bh=bNdkDxRXzfWOWhxmB+lqUMZQdW0uIEm9AerSsnfSlLA=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sgwCTAQHlA0jeYH/PWtfOjuxJIvistUgzuhMtuwZk7TapnWOLDuuUte8jQITkHk4p nawgRP7zpyuck87dDrphpV/96YbOmEt+bymmORcXDYzn7KX0NVunWblm2UtEmymD5c dTf+qbYbLOWKkyldKU6NiZTz/NH3CXCw2Gt0CyME= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A0F19F8055B; Thu, 29 Sep 2022 09:36:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 23E2FF80551; Thu, 29 Sep 2022 09:36:05 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 833E4F80539 for ; Thu, 29 Sep 2022 09:35:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 833E4F80539 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="hxlY8TyI"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="gvxpv/+w" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 24A021F92A; Thu, 29 Sep 2022 07:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UuHXkgben/SjRIEmb6r0yxDNy0aRfoQnRqx/MO77mzw=; b=hxlY8TyIV399mVmkgjivptU6RXEyM0cRUl8XF6ltuZPSxpfYBQmVq/NB0lbagVBCFfKW1n fkWb75KL5EbBCEtsgieoWlpHE6cbH5LF+VInviQh+vjaW0Pubm3pyNCCJ7hpSoGXo0I3ZE m2737KbJ03ypg1T4TQ2LTeVG/b6zet4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UuHXkgben/SjRIEmb6r0yxDNy0aRfoQnRqx/MO77mzw=; b=gvxpv/+w76NG4E0u//MS2BcYZxy+mqSTB0YuT8rE1fI9ESPvcpJZyB82Ypu+4HAsWpHVH1 vHAJp6/moHYjnMDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0AFF41348E; Thu, 29 Sep 2022 07:35:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UE7JAdtKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:55 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 6/8] ALSA: hda/sigmatel: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:43 +0200 Message-Id: <20220929073545.1085-7-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to IDT/Sigmatel codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_idt.model=foobar or snd_hda_codec_idt.model=103c:3610 for applying a quirk no matter whether you use snd-hda-intel or SOF. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_sigmatel.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 7f340f18599c..f3143f8b59f0 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,11 @@ #include "hda_jack.h" #include "hda_generic.h" +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); + enum { STAC_REF, STAC_9200_OQO, @@ -4494,6 +4500,11 @@ static int alloc_stac_spec(struct hda_codec *codec) codec->no_trigger_sense = 1; /* seems common with STAC/IDT codecs */ spec->gen.dac_min_mute = true; codec->patch_ops = stac_patch_ops; + + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + return 0; } From patchwork Thu Sep 29 07:35:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A0B9C07E9D for ; Thu, 29 Sep 2022 07:38:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 61B6C1651; Thu, 29 Sep 2022 09:37:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 61B6C1651 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437089; bh=cSWfaDpMIDvPg8HiF1L9wlcJC6sPaO3t6kwnmzNdKTY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FSWttMxVAL5KWGVxMVDhwhSpOdtK46tYkJZqFG+ivQsr72vP1eUshpw3DXxdQ70iM gGLdiDZLh21yPbplqk/ZMExxSrtffZcdYQV9kE3FHo6Um5cdxhxMXKeu364WAr/2j1 rqO+8zUlT3wdcohHsScHFjFGAK9o7wa3IhpjQiyI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D0E66F80539; Thu, 29 Sep 2022 09:36:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3DD87F8053C; Thu, 29 Sep 2022 09:36:03 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5F96FF80519 for ; Thu, 29 Sep 2022 09:35:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5F96FF80519 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="xyGju36m"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="01LFyAgk" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BEAA021B9B; Thu, 29 Sep 2022 07:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5gleWSgupy5Q46T3nfKAh1/GVJjYykvomOG7Wkcqgk=; b=xyGju36mURPXvLESF1z/0o0Zh1D5SRyXNfovivVlifmQgduk/HljkiJbBulPLObty89FGa XfotE//FLleBNAkLjMomOCdk+O9fq2mRhYylKPFzx4RFXgFyCOX8kItsrGz70r0FGzoYCM A+wfS9LucIFloz34q52h9QoD85PJihs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5gleWSgupy5Q46T3nfKAh1/GVJjYykvomOG7Wkcqgk=; b=01LFyAgkDs7aEonOjAGbfspsoNvsuIXbaWB1bDEJXppPeVFonnfVZe/AlTYJFJkFfdTqlK j90pKtHj35hi5kDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9665E1348E; Thu, 29 Sep 2022 07:35:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GNDVI9tKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:55 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 7/8] ALSA: hda/via: Add model option to codec driver, too Date: Thu, 29 Sep 2022 09:35:44 +0200 Message-Id: <20220929073545.1085-8-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The model option of snd-hda-intel or SOF driver is useful for testing / debugging quirks. Since many devices have multiple codecs and the quirk is rather codec-specific, it's often difficult to pass the model to the proper target. This patch adds the equivalent model option to VIA codec driver, so that user can optionally specify the option for the codec instead of snd-hda-intel or SOF drivers. That is, you can pass the boot option like snd_hda_codec_via.model=foobar or snd_hda_codec_via.model=1043:13f7 for applying a quirk no matter whether you use snd-hda-intel or SOF. The model option of snd-hda-intel or SOF is still effective. When the option is given for both, the option for the controller driver wins. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_via.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index aea7fae2ca4b..a60900525d8c 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,11 @@ #include "hda_jack.h" #include "hda_generic.h" +/* codec-specific model option -- equivalent with snd-hda-intel.model option */ +static char *codec_model; +module_param_named(model, codec_model, charp, 0444); +MODULE_PARM_DESC(model, "Use the given board model."); + /* Pin Widget NID */ #define VT1708_HP_PIN_NID 0x20 #define VT1708_CD_PIN_NID 0x24 @@ -119,6 +125,11 @@ static struct via_spec *via_new_spec(struct hda_codec *codec) codec->power_save_node = 1; spec->gen.power_down_unused = 1; codec->patch_ops = via_patch_ops; + + /* assign optional modelname; freed at snd_hda_codec_dev_release() */ + if (!codec->modelname && codec_model) + codec->modelname = kstrdup(codec_model, GFP_KERNEL); + return spec; } From patchwork Thu Sep 29 07:35:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12993648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E9D0C07E9D for ; Thu, 29 Sep 2022 07:37:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5EE6C15E5; Thu, 29 Sep 2022 09:37:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5EE6C15E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664437076; bh=dzaBnOALlS3CAG+weQxNWWRnBcnW5YCaePpnpXn89aY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=X9rkcll0G6WvCejfH9wP81zFwfw8yNy58E5KcKNg3pYfq1ZJNHA7G0ePPDFEEQnds g3NZB3/ipSd3AoxGgwgY7rWwOa9kMrIBVS/mgvROdSeLThjszBzT4d4qHE7aZPVFyS Rya0GrxW9JIC4sGp3VHleDX+aw2p0BtLbKGDEeoc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 149EDF80553; Thu, 29 Sep 2022 09:36:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F1A1F8053D; Thu, 29 Sep 2022 09:36:02 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BEA59F803DD for ; Thu, 29 Sep 2022 09:35:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BEA59F803DD Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bmdt/b9g"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iYOB022E" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6D1531F8D7; Thu, 29 Sep 2022 07:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664436956; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+BtegpzIETTorYe7aMC8jbbXSjGnrxW9s0rmHtCYork=; b=bmdt/b9gF7ml51+6OeVgV32Zad6CVZwkDKj3eheCRCo+OQWUgUwGXtEyS9FE+c9uLfLOEJ 0GjN/U2/X8Jn8cjLGzxGYPVLatl+jvrNjCC5Zvj3rqwNiJiXbI7jMYc5enm1316J9zh9OP 1+Cy00t3wmUlD0wVDRbxbXqnKFRG/dk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664436956; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+BtegpzIETTorYe7aMC8jbbXSjGnrxW9s0rmHtCYork=; b=iYOB022ErMDglceiHPYl+O6HMEivXhtIaespaMO1ZA9InB8mUxm6fzeCn/MYBuQqYIapgg 1TT/EdSF5VPM3wBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4CDA61348E; Thu, 29 Sep 2022 07:35:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yAgYEtxKNWMFfQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 07:35:56 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 8/8] ALSA: doc: Explain more about model option Date: Thu, 29 Sep 2022 09:35:45 +0200 Message-Id: <20220929073545.1085-9-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220929073545.1085-1-tiwai@suse.de> References: <20220929073545.1085-1-tiwai@suse.de> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add a bit more explanation about passing the snd-hda-intel model option at the right place. Also, a brief description about the new codec model option is added along with it. Signed-off-by: Takashi Iwai --- Documentation/sound/hd-audio/notes.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/sound/hd-audio/notes.rst b/Documentation/sound/hd-audio/notes.rst index d118b6fe269b..dc84be14273b 100644 --- a/Documentation/sound/hd-audio/notes.rst +++ b/Documentation/sound/hd-audio/notes.rst @@ -226,6 +226,22 @@ model=103c:8862 will apply the quirk for HP ProBook 445 G8 (which isn't found in the model table as of writing) as long as the device is handled equivalently by the same driver. +The ``model`` option of snd-hda-intel takes an array of strings, +applied one per PCI device. When there are multiple HD-audio +controllers and you want to apply a quirk for a certain one, you have +to pass the option carefully at the right position. +For example, when an on-board analog audio with a Realtek codec is +found at the secondary PCI slot while the first slot is for HDMI/DP +controller, you'll need to pass the option like ``model=,foobar`` +(note the comma before ``foobar``), so that the first entry is +skipped. + +For making this complexity a bit easier, since 6.1 kernel, codec +drivers may take also ``model`` option, too. It works equivalently as +the model option of the controller driver. +In the example case above, you can pass the option to Realtek codec +driver directly; e.g. ``snd_hda_codec_realtek.model=foobar`` on +command line. Speaker and Headphone Output ----------------------------