2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 14:43:58 +08:00

ASoC: Intel - do not describe I/O configuration in the long card name

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 <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20191204211556.12671-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Jaroslav Kysela 2019-12-04 15:15:46 -06:00 committed by Mark Brown
parent 0d5c818756
commit b5706f8ec2
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 25 additions and 0 deletions

View File

@ -13,6 +13,19 @@ menuconfig SND_SOC_INTEL_MACH
if 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 if SND_SOC_INTEL_HASWELL
config SND_SOC_INTEL_HASWELL_MACH config SND_SOC_INTEL_HASWELL_MACH

View File

@ -360,7 +360,9 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = {
/* SoC card */ /* SoC card */
static char codec_name[SND_ACPI_I2C_ID_LEN]; 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" */ static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */
#endif
static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */ static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */
static int byt_cht_es8316_suspend(struct snd_soc_card *card) 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", (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2",
mic_name[BYT_CHT_ES8316_MAP(quirk)]); mic_name[BYT_CHT_ES8316_MAP(quirk)]);
byt_cht_es8316_card.components = components_string; 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", snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic",
(quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
mic_name[BYT_CHT_ES8316_MAP(quirk)]); mic_name[BYT_CHT_ES8316_MAP(quirk)]);
byt_cht_es8316_card.long_name = long_name; byt_cht_es8316_card.long_name = long_name;
#endif
/* register the soc card */ /* register the soc card */
snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);

View File

@ -1082,7 +1082,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_name[SND_ACPI_I2C_ID_LEN];
static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ 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_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" */ static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */
#endif
static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */ static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */
static int byt_rt5640_suspend(struct snd_soc_card *card) static int byt_rt5640_suspend(struct snd_soc_card *card)
@ -1311,12 +1313,14 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
(byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2", (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2",
map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
byt_rt5640_card.components = byt_rt5640_components; 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), snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
"bytcr-rt5640-%s-spk-%s-mic", "bytcr-rt5640-%s-spk-%s-mic",
(byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ?
"mono" : "stereo", "mono" : "stereo",
map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
byt_rt5640_card.long_name = byt_rt5640_long_name; byt_rt5640_card.long_name = byt_rt5640_long_name;
#endif
/* override plaform name, if required */ /* override plaform name, if required */
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;

View File

@ -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_name[SND_ACPI_I2C_ID_LEN];
static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */ 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_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]" */ 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 char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */
static int byt_rt5651_suspend(struct snd_soc_card *card) 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) ? (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
" cfg-hp:lrswap" : ""); " cfg-hp:lrswap" : "");
byt_rt5651_card.components = byt_rt5651_components; 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), snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
"bytcr-rt5651-%s-spk-%s-mic%s", "bytcr-rt5651-%s-spk-%s-mic%s",
(byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? (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) ? (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
"-hp-swapped" : ""); "-hp-swapped" : "");
byt_rt5651_card.long_name = byt_rt5651_long_name; byt_rt5651_card.long_name = byt_rt5651_long_name;
#endif
/* override plaform name, if required */ /* override plaform name, if required */
platform_name = mach->mach_params.platform; platform_name = mach->mach_params.platform;