fanghuilin / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
Pablo Greco d6c4c4
From 89be5f69889f7e9aeab05279869bba3e9e0d2002 Mon Sep 17 00:00:00 2001
Pablo Greco d6c4c4
From: Jaroslav Kysela <perex@perex.cz>
Pablo Greco d6c4c4
Date: Wed, 4 Dec 2019 15:15:45 -0600
Pablo Greco d6c4c4
Subject: [PATCH 2/4] ASoC: Intel - use control components to describe card
Pablo Greco d6c4c4
 config
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Use the control interface (field 'components' in the info structure)
Pablo Greco d6c4c4
to pass the I/O configuration details. The goal is to replace
Pablo Greco d6c4c4
the card long name with this.
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Pablo Greco d6c4c4
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Pablo Greco d6c4c4
Cc: Mark Brown <broonie@kernel.org>
Pablo Greco d6c4c4
Link: https://lore.kernel.org/r/20191204211556.12671-3-pierre-louis.bossart@linux.intel.com
Pablo Greco d6c4c4
Signed-off-by: Mark Brown <broonie@kernel.org>
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
Pablo Greco d6c4c4
(cherry picked from commit 0d5c8187562848b619a35f2ffc5e18ce703e9f3d)
Pablo Greco d6c4c4
Bugzilla: 1772498
Pablo Greco d6c4c4
---
Pablo Greco d6c4c4
 sound/soc/intel/boards/bytcht_es8316.c |  9 ++++++++-
Pablo Greco d6c4c4
 sound/soc/intel/boards/bytcr_rt5640.c  |  6 ++++++
Pablo Greco d6c4c4
 sound/soc/intel/boards/bytcr_rt5651.c  | 18 +++++++++++-------
Pablo Greco d6c4c4
 3 files changed, 25 insertions(+), 8 deletions(-)
Pablo Greco d6c4c4
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
Pablo Greco d6c4c4
index 46612331f5ea..efa33f30dcac 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/bytcht_es8316.c
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/bytcht_es8316.c
Pablo Greco d6c4c4
@@ -361,6 +361,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = {
Pablo Greco d6c4c4
 /* SoC card */
Pablo Greco d6c4c4
 static char codec_name[SND_ACPI_I2C_ID_LEN];
Pablo Greco d6c4c4
 static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */
Pablo Greco d6c4c4
+static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 static int byt_cht_es8316_suspend(struct snd_soc_card *card)
Pablo Greco d6c4c4
 {
Pablo Greco d6c4c4
@@ -572,11 +573,17 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		}
Pablo Greco d6c4c4
 	}
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
-	/* register the soc card */
Pablo Greco d6c4c4
+	snprintf(components_string, sizeof(components_string),
Pablo Greco d6c4c4
+		 "cfg-spk:%s cfg-mic:%s",
Pablo Greco d6c4c4
+		 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2",
Pablo Greco d6c4c4
+		 mic_name[BYT_CHT_ES8316_MAP(quirk)]);
Pablo Greco d6c4c4
+	byt_cht_es8316_card.components = components_string;
Pablo Greco d6c4c4
 	snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic",
Pablo Greco d6c4c4
 		 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
Pablo Greco d6c4c4
 		 mic_name[BYT_CHT_ES8316_MAP(quirk)]);
Pablo Greco d6c4c4
 	byt_cht_es8316_card.long_name = long_name;
Pablo Greco d6c4c4
+
Pablo Greco d6c4c4
+	/* register the soc card */
Pablo Greco d6c4c4
 	snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 	ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card);
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
Pablo Greco d6c4c4
index dd2b5ad08659..7bc6d3cec94c 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/bytcr_rt5640.c
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
Pablo Greco d6c4c4
@@ -1083,6 +1083,7 @@ static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
Pablo Greco d6c4c4
 static char byt_rt5640_codec_aif_name[12]; /*  = "rt5640-aif[1|2]" */
Pablo Greco d6c4c4
 static char byt_rt5640_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
Pablo Greco d6c4c4
 static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */
Pablo Greco d6c4c4
+static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 static int byt_rt5640_suspend(struct snd_soc_card *card)
Pablo Greco d6c4c4
 {
Pablo Greco d6c4c4
@@ -1305,6 +1306,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		}
Pablo Greco d6c4c4
 	}
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
+	snprintf(byt_rt5640_components, sizeof(byt_rt5640_components),
Pablo Greco d6c4c4
+		 "cfg-spk:%s cfg-mic:%s",
Pablo Greco d6c4c4
+		 (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2",
Pablo Greco d6c4c4
+		 map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
Pablo Greco d6c4c4
+	byt_rt5640_card.components = byt_rt5640_components;
Pablo Greco d6c4c4
 	snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
Pablo Greco d6c4c4
 		 "bytcr-rt5640-%s-spk-%s-mic",
Pablo Greco d6c4c4
 		 (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ?
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
Pablo Greco d6c4c4
index 4606f6f582d6..80a5674ddb1b 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/bytcr_rt5651.c
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
Pablo Greco d6c4c4
@@ -798,6 +798,7 @@ static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
Pablo Greco d6c4c4
 static char byt_rt5651_codec_aif_name[12]; /*  = "rt5651-aif[1|2]" */
Pablo Greco d6c4c4
 static char byt_rt5651_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
Pablo Greco d6c4c4
 static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
Pablo Greco d6c4c4
+static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 static int byt_rt5651_suspend(struct snd_soc_card *card)
Pablo Greco d6c4c4
 {
Pablo Greco d6c4c4
@@ -876,7 +877,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 	const char *platform_name;
Pablo Greco d6c4c4
 	struct acpi_device *adev;
Pablo Greco d6c4c4
 	struct device *codec_dev;
Pablo Greco d6c4c4
-	const char *hp_swapped;
Pablo Greco d6c4c4
 	bool is_bytcr = false;
Pablo Greco d6c4c4
 	int ret_val = 0;
Pablo Greco d6c4c4
 	int dai_index = 0;
Pablo Greco d6c4c4
@@ -1080,16 +1080,20 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		}
Pablo Greco d6c4c4
 	}
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
-	if (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED)
Pablo Greco d6c4c4
-		hp_swapped = "-hp-swapped";
Pablo Greco d6c4c4
-	else
Pablo Greco d6c4c4
-		hp_swapped = "";
Pablo Greco d6c4c4
-
Pablo Greco d6c4c4
+	snprintf(byt_rt5651_components, sizeof(byt_rt5651_components),
Pablo Greco d6c4c4
+		 "cfg-spk:%s cfg-mic:%s%s",
Pablo Greco d6c4c4
+		 (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ? "1" : "2",
Pablo Greco d6c4c4
+		 mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)],
Pablo Greco d6c4c4
+		 (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
Pablo Greco d6c4c4
+			" cfg-hp:lrswap" : "");
Pablo Greco d6c4c4
+	byt_rt5651_card.components = byt_rt5651_components;
Pablo Greco d6c4c4
 	snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
Pablo Greco d6c4c4
 		 "bytcr-rt5651-%s-spk-%s-mic%s",
Pablo Greco d6c4c4
 		 (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ?
Pablo Greco d6c4c4
 			"mono" : "stereo",
Pablo Greco d6c4c4
-		 mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped);
Pablo Greco d6c4c4
+		 mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)],
Pablo Greco d6c4c4
+		 (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
Pablo Greco d6c4c4
+			"-hp-swapped" : "");
Pablo Greco d6c4c4
 	byt_rt5651_card.long_name = byt_rt5651_long_name;
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 	/* override plaform name, if required */
Pablo Greco d6c4c4
-- 
Pablo Greco d6c4c4
2.20.1
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Pablo Greco d6c4c4
From 36c175e19e9cbb685708519d41e27cd803206737 Mon Sep 17 00:00:00 2001
Pablo Greco d6c4c4
From: Jaroslav Kysela <perex@perex.cz>
Pablo Greco d6c4c4
Date: Wed, 4 Dec 2019 15:15:46 -0600
Pablo Greco d6c4c4
Subject: [PATCH 3/4] ASoC: Intel - do not describe I/O configuration in the
Pablo Greco d6c4c4
 long card name
Pablo Greco d6c4c4
Pablo Greco d6c4c4
The long card name might be used in GUI. This information should be hidden.
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Add CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES configuration option.
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Pablo Greco d6c4c4
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Pablo Greco d6c4c4
Cc: Mark Brown <broonie@kernel.org>
Pablo Greco d6c4c4
Link: https://lore.kernel.org/r/20191204211556.12671-4-pierre-louis.bossart@linux.intel.com
Pablo Greco d6c4c4
Signed-off-by: Mark Brown <broonie@kernel.org>
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
Pablo Greco d6c4c4
(cherry picked from commit b5706f8ec29fb461571d25e3e813ede121fe31cd)
Pablo Greco d6c4c4
Bugzilla: 1772498
Pablo Greco d6c4c4
---
Pablo Greco d6c4c4
 sound/soc/intel/boards/Kconfig         | 13 +++++++++++++
Pablo Greco d6c4c4
 sound/soc/intel/boards/bytcht_es8316.c |  4 ++++
Pablo Greco d6c4c4
 sound/soc/intel/boards/bytcr_rt5640.c  |  4 ++++
Pablo Greco d6c4c4
 sound/soc/intel/boards/bytcr_rt5651.c  |  4 ++++
Pablo Greco d6c4c4
 4 files changed, 25 insertions(+)
Pablo Greco d6c4c4
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig
Pablo Greco d6c4c4
index ef20316e83d1..145eb55bd691 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/Kconfig
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/Kconfig
Pablo Greco d6c4c4
@@ -13,6 +13,19 @@ menuconfig SND_SOC_INTEL_MACH
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 if SND_SOC_INTEL_MACH
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
+config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES
Pablo Greco d6c4c4
+	bool "Use more user friendly long card names"
Pablo Greco d6c4c4
+	help
Pablo Greco d6c4c4
+	  Some drivers report the I/O configuration to userspace through the
Pablo Greco d6c4c4
+	  soundcard's long card name in the control user space AP. An unfortunate
Pablo Greco d6c4c4
+	  side effect is that this long name may also be used by the GUI,
Pablo Greco d6c4c4
+	  confusing users with information they don't need.
Pablo Greco d6c4c4
+	  This option prevents the long name from being modified, and the I/O
Pablo Greco d6c4c4
+	  configuration will be provided through a different component interface.
Pablo Greco d6c4c4
+	  Select Y if userspace like UCM (Use Case Manager) uses the component
Pablo Greco d6c4c4
+	  interface.
Pablo Greco d6c4c4
+	  If unsure select N.
Pablo Greco d6c4c4
+
Pablo Greco d6c4c4
 if SND_SOC_INTEL_HASWELL
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 config SND_SOC_INTEL_HASWELL_MACH
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
Pablo Greco d6c4c4
index efa33f30dcac..12a1c5255484 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/bytcht_es8316.c
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/bytcht_es8316.c
Pablo Greco d6c4c4
@@ -360,7 +360,9 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = {
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 /* SoC card */
Pablo Greco d6c4c4
 static char codec_name[SND_ACPI_I2C_ID_LEN];
Pablo Greco d6c4c4
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
Pablo Greco d6c4c4
 static char long_name[50]; /* = "bytcht-es8316-*-spk-*-mic" */
Pablo Greco d6c4c4
+#endif
Pablo Greco d6c4c4
 static char components_string[32]; /* = "cfg-spk:* cfg-mic:* */
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 static int byt_cht_es8316_suspend(struct snd_soc_card *card)
Pablo Greco d6c4c4
@@ -578,10 +580,12 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "1" : "2",
Pablo Greco d6c4c4
 		 mic_name[BYT_CHT_ES8316_MAP(quirk)]);
Pablo Greco d6c4c4
 	byt_cht_es8316_card.components = components_string;
Pablo Greco d6c4c4
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
Pablo Greco d6c4c4
 	snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic",
Pablo Greco d6c4c4
 		 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
Pablo Greco d6c4c4
 		 mic_name[BYT_CHT_ES8316_MAP(quirk)]);
Pablo Greco d6c4c4
 	byt_cht_es8316_card.long_name = long_name;
Pablo Greco d6c4c4
+#endif
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 	/* register the soc card */
Pablo Greco d6c4c4
 	snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
Pablo Greco d6c4c4
index 7bc6d3cec94c..648fcc1d07b5 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/bytcr_rt5640.c
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
Pablo Greco d6c4c4
@@ -1082,7 +1082,9 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
Pablo Greco d6c4c4
 static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
Pablo Greco d6c4c4
 static char byt_rt5640_codec_aif_name[12]; /*  = "rt5640-aif[1|2]" */
Pablo Greco d6c4c4
 static char byt_rt5640_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
Pablo Greco d6c4c4
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
Pablo Greco d6c4c4
 static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */
Pablo Greco d6c4c4
+#endif
Pablo Greco d6c4c4
 static char byt_rt5640_components[32]; /* = "cfg-spk:* cfg-mic:*" */
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 static int byt_rt5640_suspend(struct snd_soc_card *card)
Pablo Greco d6c4c4
@@ -1311,12 +1313,14 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		 (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ? "1" : "2",
Pablo Greco d6c4c4
 		 map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
Pablo Greco d6c4c4
 	byt_rt5640_card.components = byt_rt5640_components;
Pablo Greco d6c4c4
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
Pablo Greco d6c4c4
 	snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
Pablo Greco d6c4c4
 		 "bytcr-rt5640-%s-spk-%s-mic",
Pablo Greco d6c4c4
 		 (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ?
Pablo Greco d6c4c4
 			"mono" : "stereo",
Pablo Greco d6c4c4
 		 map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
Pablo Greco d6c4c4
 	byt_rt5640_card.long_name = byt_rt5640_long_name;
Pablo Greco d6c4c4
+#endif
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 	/* override plaform name, if required */
Pablo Greco d6c4c4
 	platform_name = mach->mach_params.platform;
Pablo Greco d6c4c4
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
Pablo Greco d6c4c4
index 80a5674ddb1b..c0d322a859f7 100644
Pablo Greco d6c4c4
--- a/sound/soc/intel/boards/bytcr_rt5651.c
Pablo Greco d6c4c4
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
Pablo Greco d6c4c4
@@ -797,7 +797,9 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
Pablo Greco d6c4c4
 static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
Pablo Greco d6c4c4
 static char byt_rt5651_codec_aif_name[12]; /*  = "rt5651-aif[1|2]" */
Pablo Greco d6c4c4
 static char byt_rt5651_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
Pablo Greco d6c4c4
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
Pablo Greco d6c4c4
 static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
Pablo Greco d6c4c4
+#endif
Pablo Greco d6c4c4
 static char byt_rt5651_components[50]; /* = "cfg-spk:* cfg-mic:*" */
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 static int byt_rt5651_suspend(struct snd_soc_card *card)
Pablo Greco d6c4c4
@@ -1087,6 +1089,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		 (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
Pablo Greco d6c4c4
 			" cfg-hp:lrswap" : "");
Pablo Greco d6c4c4
 	byt_rt5651_card.components = byt_rt5651_components;
Pablo Greco d6c4c4
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
Pablo Greco d6c4c4
 	snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
Pablo Greco d6c4c4
 		 "bytcr-rt5651-%s-spk-%s-mic%s",
Pablo Greco d6c4c4
 		 (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ?
Pablo Greco d6c4c4
@@ -1095,6 +1098,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
Pablo Greco d6c4c4
 		 (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) ?
Pablo Greco d6c4c4
 			"-hp-swapped" : "");
Pablo Greco d6c4c4
 	byt_rt5651_card.long_name = byt_rt5651_long_name;
Pablo Greco d6c4c4
+#endif
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 	/* override plaform name, if required */
Pablo Greco d6c4c4
 	platform_name = mach->mach_params.platform;
Pablo Greco d6c4c4
-- 
Pablo Greco d6c4c4
2.20.1
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Pablo Greco d6c4c4
From 9aa9b367e35494f2d02112ca440a78908f645a04 Mon Sep 17 00:00:00 2001
Pablo Greco d6c4c4
From: Jaroslav Kysela <perex@perex.cz>
Pablo Greco d6c4c4
Date: Fri, 22 Nov 2019 09:31:03 +0100
Pablo Greco d6c4c4
Subject: [PATCH 4/4] ASoC: SOF - topology - do not change the link triger
Pablo Greco d6c4c4
 order for old firmare
Pablo Greco d6c4c4
Pablo Greco d6c4c4
This is patch for SOF v1.3 firmware. The DSP firmware will crash
Pablo Greco d6c4c4
without this patch. The 1.4.1 firmare has this issue fixed.
Pablo Greco d6c4c4
Pablo Greco d6c4c4
BugLink: https://github.com/thesofproject/sof/issues/2102
Pablo Greco d6c4c4
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Pablo Greco d6c4c4
---
Pablo Greco d6c4c4
 sound/soc/sof/topology.c | 10 +++++++---
Pablo Greco d6c4c4
 1 file changed, 7 insertions(+), 3 deletions(-)
Pablo Greco d6c4c4
Pablo Greco d6c4c4
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
Pablo Greco d6c4c4
index d82ab981e840..cbbbf96416ef 100644
Pablo Greco d6c4c4
--- a/sound/soc/sof/topology.c
Pablo Greco d6c4c4
+++ b/sound/soc/sof/topology.c
Pablo Greco d6c4c4
@@ -2971,6 +2971,7 @@ static int sof_link_load(struct snd_soc_component *scomp, int index,
Pablo Greco d6c4c4
 	struct snd_soc_tplg_private *private = &cfg->priv;
Pablo Greco d6c4c4
 	struct sof_ipc_dai_config config;
Pablo Greco d6c4c4
 	struct snd_soc_tplg_hw_config *hw_config;
Pablo Greco d6c4c4
+	struct sof_ipc_fw_version *v = &sdev->fw_ready.version;
Pablo Greco d6c4c4
 	int num_hw_configs;
Pablo Greco d6c4c4
 	int ret;
Pablo Greco d6c4c4
 	int i = 0;
Pablo Greco d6c4c4
@@ -2988,9 +2989,12 @@ static int sof_link_load(struct snd_soc_component *scomp, int index,
Pablo Greco d6c4c4
 	if (!link->no_pcm) {
Pablo Greco d6c4c4
 		link->nonatomic = true;
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
-		/* set trigger order */
Pablo Greco d6c4c4
-		link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST;
Pablo Greco d6c4c4
-		link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST;
Pablo Greco d6c4c4
+		/* this causes DSP panic on firmware v1.3 */
Pablo Greco d6c4c4
+		if (SOF_ABI_VER(v->major, v->minor, v->micro) > SOF_ABI_VER(3, 7, 0)) {
Pablo Greco d6c4c4
+			/* set trigger order */
Pablo Greco d6c4c4
+			link->trigger[0] = SND_SOC_DPCM_TRIGGER_POST;
Pablo Greco d6c4c4
+			link->trigger[1] = SND_SOC_DPCM_TRIGGER_POST;
Pablo Greco d6c4c4
+		}
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 		/* nothing more to do for FE dai links */
Pablo Greco d6c4c4
 		return 0;
Pablo Greco d6c4c4
-- 
Pablo Greco d6c4c4
2.20.1
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Pablo Greco d6c4c4
From 264fe78e03d860f8bbf92f250cd22f54cabca59b Mon Sep 17 00:00:00 2001
Pablo Greco d6c4c4
From: Fedora Kernel Team <kernel-team@fedoraproject.org>
Pablo Greco d6c4c4
Date: Tue, 21 Jan 2020 11:57:17 -0500
Pablo Greco d6c4c4
Subject: [PATCH] Force the DSP driver for Intel DSP to "legacy" by default
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Signed-off-by: Fedora Kernel Team <kernel-team@fedoraproject.org>
Pablo Greco d6c4c4
---
Pablo Greco d6c4c4
 sound/hda/intel-dsp-config.c | 2 +-
Pablo Greco d6c4c4
 1 file changed, 1 insertion(+), 1 deletion(-)
Pablo Greco d6c4c4
Pablo Greco d6c4c4
diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
Pablo Greco d6c4c4
index be1df80..2167ae3 100644
Pablo Greco d6c4c4
--- a/sound/hda/intel-dsp-config.c
Pablo Greco d6c4c4
+++ b/sound/hda/intel-dsp-config.c
Pablo Greco d6c4c4
@@ -9,7 +9,7 @@
Pablo Greco d6c4c4
 #include <sound/intel-dsp-config.h>
Pablo Greco d6c4c4
 #include <sound/intel-nhlt.h>
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
-static int dsp_driver;
Pablo Greco d6c4c4
+static int dsp_driver = 1;
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
 module_param(dsp_driver, int, 0444);
Pablo Greco d6c4c4
 MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF)");
Pablo Greco d6c4c4
-- 
Pablo Greco d6c4c4
2.24.1
Pablo Greco d6c4c4