From patchwork Wed Nov 20 17:56:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 11254587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B349913 for ; Wed, 20 Nov 2019 18:00:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9A0A320878 for ; Wed, 20 Nov 2019 18:00:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SQudsipt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=perex.cz header.i=@perex.cz header.b="U/eBt1bA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A0A320878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=perex.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 7B8FE1736; Wed, 20 Nov 2019 18:59:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7B8FE1736 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574272827; bh=2N/4QdWdIbsSx5rqGz/79ZewSFs1oEaevieiT6E1vs8=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=SQudsiptN6YB3TFS3ykP4NT+P+PXMJtbDQi/EivIMDmfa0GPypjNPofSvh2ogQW/b hW1J7qlQisAnI3eIznDOok3eQPtg6BC8RHSX8/iJv4DdM2AaS/oVBL34KPmp9gPCde TsgsR0KIfgQa8z8uxMV+LIp2mlajUF/4xX61hy6c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 97DECF8015D; Wed, 20 Nov 2019 18:56:58 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B0DBBF80162; Wed, 20 Nov 2019 18:56:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2316FF8013F for ; Wed, 20 Nov 2019 18:56:54 +0100 (CET) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 371C5A003F; Wed, 20 Nov 2019 18:56:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 371C5A003F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1574272613; bh=NyBSsf3hTmcGFkXPqe7QzfqNKOSrb3YgJtkqVpy9sHs=; h=From:To:Cc:Subject:Date:From; b=U/eBt1bA/2MwX3XvHSflkjzeusUsfXMas4KrN7wa1MO2sBCrC1Zuo5MeVSNQZodTK LFrImqRoIhIv17mUFUHME0low8ih5Yh6p7BCdrP1a70cBy9PxR6GeD3XHJ1J92TUS0 h+SYR+PxBu5FGDMo/QBDrOAroKleQTDvzwXopL1g= Received: from p50.perex-int.cz (unknown [192.168.100.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Wed, 20 Nov 2019 18:56:48 +0100 (CET) From: Jaroslav Kysela To: ALSA development Date: Wed, 20 Nov 2019 18:56:43 +0100 Message-Id: <20191120175644.31839-1-perex@perex.cz> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Takashi Iwai , Mark Brown , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH v4 1/2] ASoC: Intel - use control components to describe card config 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" Use the control interface (field 'components' in the info structure) to pass the I/O configuration details. The goal is to replace the card long name with this. Signed-off-by: Jaroslav Kysela Cc: Pierre-Louis Bossart Cc: Mark Brown --- sound/soc/intel/boards/bytcht_es8316.c | 10 +++++++++- sound/soc/intel/boards/bytcr_rt5640.c | 6 ++++++ sound/soc/intel/boards/bytcr_rt5651.c | 18 +++++++++++------- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c index 46612331f5ea..4090550f0fe1 100644 --- a/sound/soc/intel/boards/bytcht_es8316.c +++ b/sound/soc/intel/boards/bytcht_es8316.c @@ -361,6 +361,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = { /* SoC card */ static char codec_name[SND_ACPI_I2C_ID_LEN]; static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */ +static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */ static int byt_cht_es8316_suspend(struct snd_soc_card *card) { @@ -572,17 +573,24 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) } } - /* register the soc card */ + snprintf(components_string, sizeof(components_string), + "cfg-spk:%s cfg-mic:%s", + (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2", + mic_name[BYT_CHT_ES8316_MAP(quirk)]); + byt_cht_es8316_card.components = components_string; snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic", (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", mic_name[BYT_CHT_ES8316_MAP(quirk)]); byt_cht_es8316_card.long_name = long_name; + + /* register the soc card */ snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card); if (ret) { gpiod_put(priv->speaker_en_gpio); dev_err(dev, "snd_soc_register_card failed: %d\n", ret); + return ret; } platform_set_drvdata(pdev, &byt_cht_es8316_card); diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 9c1aa4ec9cba..0170d31e691a 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -1081,6 +1081,7 @@ static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN]; static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */ +static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */ static int byt_rt5640_suspend(struct snd_soc_card *card) { @@ -1303,6 +1304,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) } } + snprintf(byt_rt5640_components, sizeof(byt_rt5640_components), + "cfg-spk:%s cfg-mic:%s", + (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2", + map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); + byt_rt5640_card.components = byt_rt5640_components; snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name), "bytcr-rt5640-%s-spk-%s-mic", (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index 4606f6f582d6..80a5674ddb1b 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -798,6 +798,7 @@ static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN]; static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */ static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */ +static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */ static int byt_rt5651_suspend(struct snd_soc_card *card) { @@ -876,7 +877,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) const char *platform_name; struct acpi_device *adev; struct device *codec_dev; - const char *hp_swapped; bool is_bytcr = false; int ret_val = 0; int dai_index = 0; @@ -1080,16 +1080,20 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) } } - if (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) - hp_swapped = "-hp-swapped"; - else - hp_swapped = ""; - + snprintf(byt_rt5651_components, sizeof(byt_rt5651_components), + "cfg-spk:%s cfg-mic:%s%s", + (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? "1" : "2", + mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], + (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? + " cfg-hp:lrswap" : ""); + byt_rt5651_card.components = byt_rt5651_components; snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name), "bytcr-rt5651-%s-spk-%s-mic%s", (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? "mono" : "stereo", - mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped); + mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], + (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? + "-hp-swapped" : ""); byt_rt5651_card.long_name = byt_rt5651_long_name; /* override plaform name, if required */ From patchwork Wed Nov 20 17:56:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 11254589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97D8A6C1 for ; Wed, 20 Nov 2019 18:01:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 298AE20679 for ; Wed, 20 Nov 2019 18:01:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="F1MolMY3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=perex.cz header.i=@perex.cz header.b="xF9b+XrS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 298AE20679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=perex.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 65BDB1744; Wed, 20 Nov 2019 19:00:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 65BDB1744 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574272878; bh=AksdySU5Qws3HE/U1EDWS+u5FKg02+rrMRPpkwTg1OQ=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F1MolMY3sO1N/srvz8lpKRdEKXKs3zddgvhNOEM0uk0zSH91Sb68ijqAQ0hS7YKa/ 0/n+gVDdjhC22zCVAX3QmhxX/67V13CaQ7e6qTY492cyQqdw0kxd9PjTRmE3Rw8KPR DinyK5ssEyDh27BCvJiB4c2hzwhGD0aEXsGuOH0g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C20D0F801F2; Wed, 20 Nov 2019 18:57:03 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D4E98F801F2; Wed, 20 Nov 2019 18:57:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C81D1F80162 for ; Wed, 20 Nov 2019 18:56:58 +0100 (CET) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 61B68A003F; Wed, 20 Nov 2019 18:56:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 61B68A003F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1574272618; bh=xFun+Ie79Vi+9onsdjOXH1j8M0vtiTw//HtvmorTP70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xF9b+XrSy2GnU9daJPOZM6CLLKQiOSDEUnY+W9ZafUdHldL9Fvb1pGDCTwevdyxa/ Uro4igocdoX9K1yRU+o2LWXQa6J4BbaDQV5g5uBv3LgJeHnuT3OCUYDfA3/T4kMzIT 2+uhQXLhDq4/gjYWab0KWNQlZtpeVIrC2axNMqe0= Received: from p50.perex-int.cz (unknown [192.168.100.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Wed, 20 Nov 2019 18:56:53 +0100 (CET) From: Jaroslav Kysela To: ALSA development Date: Wed, 20 Nov 2019 18:56:44 +0100 Message-Id: <20191120175644.31839-2-perex@perex.cz> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191120175644.31839-1-perex@perex.cz> References: <20191120175644.31839-1-perex@perex.cz> MIME-Version: 1.0 Cc: Takashi Iwai , Mark Brown , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH v4 2/2] ASoC: Intel - do not describe I/O configuration in the long card name 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 long card name might be used in GUI. This information should be hidden. Add CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES configuration option. Signed-off-by: Jaroslav Kysela Cc: Pierre-Louis Bossart Cc: Mark Brown --- sound/soc/intel/boards/Kconfig | 13 +++++++++++++ sound/soc/intel/boards/bytcht_es8316.c | 4 ++++ sound/soc/intel/boards/bytcr_rt5640.c | 4 ++++ sound/soc/intel/boards/bytcr_rt5651.c | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 2702aefee775..16c77718700f 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -13,6 +13,19 @@ menuconfig SND_SOC_INTEL_MACH if SND_SOC_INTEL_MACH +config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES + bool "Use more user friendly long card names" + help + Some drivers report the I/O configuration to userspace through the + soundcard's long card name in the control user space AP. An unfortunate + side effect is that this long name may also be used by the GUI, + confusing users with information they don't need. + This option prevents the long name from being modified, and the I/O + configuration will be provided through a different component interface. + Select Y if userspace like UCM (Use Case Manager) uses the component + interface. + If unsure select N. + if SND_SOC_INTEL_HASWELL config SND_SOC_INTEL_HASWELL_MACH diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c index 4090550f0fe1..42ce94ed7080 100644 --- a/sound/soc/intel/boards/bytcht_es8316.c +++ b/sound/soc/intel/boards/bytcht_es8316.c @@ -360,7 +360,9 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = { /* SoC card */ static char codec_name[SND_ACPI_I2C_ID_LEN]; +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */ +#endif static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */ static int byt_cht_es8316_suspend(struct snd_soc_card *card) @@ -578,10 +580,12 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2", mic_name[BYT_CHT_ES8316_MAP(quirk)]); byt_cht_es8316_card.components = components_string; +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic", (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", mic_name[BYT_CHT_ES8316_MAP(quirk)]); byt_cht_es8316_card.long_name = long_name; +#endif /* register the soc card */ snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 0170d31e691a..fd4088db2fd4 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -1080,7 +1080,9 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = { static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN]; static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */ +#endif static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */ static int byt_rt5640_suspend(struct snd_soc_card *card) @@ -1309,12 +1311,14 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2", map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); byt_rt5640_card.components = byt_rt5640_components; +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name), "bytcr-rt5640-%s-spk-%s-mic", (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "mono" : "stereo", map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); byt_rt5640_card.long_name = byt_rt5640_long_name; +#endif /* override plaform name, if required */ platform_name = mach->mach_params.platform; diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index 80a5674ddb1b..c0d322a859f7 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -797,7 +797,9 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = { static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN]; static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */ static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */ +#endif static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */ static int byt_rt5651_suspend(struct snd_soc_card *card) @@ -1087,6 +1089,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? " cfg-hp:lrswap" : ""); byt_rt5651_card.components = byt_rt5651_components; +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name), "bytcr-rt5651-%s-spk-%s-mic%s", (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? @@ -1095,6 +1098,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ? "-hp-swapped" : ""); byt_rt5651_card.long_name = byt_rt5651_long_name; +#endif /* override plaform name, if required */ platform_name = mach->mach_params.platform;