Skip to contentSkip to conversation

ASoC: Intel: fix rt5682-based machine drivers

PATCH In review Pierre-Louis Bossart 2 participants 9 messages May 20, 2019 – May 21, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: Intel: fix rt5682-based machine drivers

We have two machine drivers based on rt5682 and they both need a correction for the mapping of the buttons, the initial mapping taken from the DA7219 is incorrect.

Also fix ACPI tables, quirks as needed, and add newlines for clarity

Changes since v1:
Split first patch in 3 (feedback from Mark). No code changes.

Sathya Prakash M R (4):
ASoC: Intel: sof-rt5682: fix for codec button mapping
ASoC: Intel: sof-rt5682: fix AMP quirk support
ASoC: Intel: sof-rt5682: add newline for clarity
ASoC: Intel: soc-acpi: Fix machine selection order

Yong Zhi (1):
ASoC: Intel: glk_rt5682_max98357a: Remap button control-function

 sound/soc/intel/boards/glk_rt5682_max98357a.c     |  7 ++++---
 sound/soc/intel/boards/sof_rt5682.c               | 12 +++++++-----
 sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 10 +++++-----
 3 files changed, 16 insertions(+), 13 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/5 ASoC: Intel: sof-rt5682: fix for codec button mapping

From: Sathya Prakash M R <[email protected]>

The RT5682 codec button mapping, initially copied from the DA7219 one, needs to be corrected.

---
 sound/soc/intel/boards/sof_rt5682.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/intel/boards/sof_rt5682.c +3 -3
index f28fb98cc306..39ddefec4991 100644
@@ -144,9 +144,9 @@ static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
 	jack = &ctx->sof_headset;
 
 	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
 	ret = snd_soc_component_set_jack(component, jack, NULL);
 
 	if (ret) {
Signature · 1 line
2.20.1
maintainer
#2 lore raw

Applied "ASoC: Intel: sof-rt5682: fix for codec button mapping" to the asoc tree

The patch

ASoC: Intel: sof-rt5682: fix for codec button mapping

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From d5952f34ade5e6034e5eca3617fb77d4395bf492 Mon Sep 17 00:00:00 2001

From: Sathya Prakash M R <[email protected]>
Date: Mon, 20 May 2019 14:46:41 -0500
Subject: [PATCH] ASoC: Intel: sof-rt5682: fix for codec button mapping

The RT5682 codec button mapping, initially copied from the DA7219 one, needs to be corrected.

---
 sound/soc/intel/boards/sof_rt5682.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/intel/boards/sof_rt5682.c +3 -3
index f28fb98cc306..39ddefec4991 100644
@@ -144,9 +144,9 @@ static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
 	jack = &ctx->sof_headset;
 
 	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
 	ret = snd_soc_component_set_jack(component, jack, NULL);
 
 	if (ret) {
Signature · 1 line
2.20.1
#3 lore raw

PATCH v2 2/5 ASoC: Intel: sof-rt5682: fix AMP quirk support

In reply to Pierre-Louis Bossart

From: Sathya Prakash M R <[email protected]>

The use of BIT/GENMASK was incorrect, fix.

---
 sound/soc/intel/boards/sof_rt5682.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_rt5682.c +3 -2
index 39ddefec4991..3343dbcd506f 100644
@@ -29,9 +29,10 @@
 #define SOF_RT5682_MCLK_EN			BIT(3)
 #define SOF_RT5682_MCLK_24MHZ			BIT(4)
 #define SOF_SPEAKER_AMP_PRESENT		BIT(5)
-#define SOF_RT5682_SSP_AMP(quirk)		((quirk) & GENMASK(8, 6))
-#define SOF_RT5682_SSP_AMP_MASK			(GENMASK(8, 6))
 #define SOF_RT5682_SSP_AMP_SHIFT		6
+#define SOF_RT5682_SSP_AMP_MASK                 (GENMASK(8, 6))
+#define SOF_RT5682_SSP_AMP(quirk)	\
+	(((quirk) << SOF_RT5682_SSP_AMP_SHIFT) & SOF_RT5682_SSP_AMP_MASK)
 
 /* Default: MCLK on, MCLK 19.2M, SSP0  */
 static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
Signature · 1 line
2.20.1
maintainer
#4 lore raw

Applied "ASoC: Intel: sof-rt5682: fix AMP quirk support" to the asoc tree

The patch

ASoC: Intel: sof-rt5682: fix AMP quirk support

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From df9366131a452296d040a7a496d93108f1fc240c Mon Sep 17 00:00:00 2001

From: Sathya Prakash M R <[email protected]>
Date: Mon, 20 May 2019 14:46:42 -0500
Subject: [PATCH] ASoC: Intel: sof-rt5682: fix AMP quirk support

The use of BIT/GENMASK was incorrect, fix.

---
 sound/soc/intel/boards/sof_rt5682.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_rt5682.c +3 -2
index 39ddefec4991..3343dbcd506f 100644
@@ -29,9 +29,10 @@
 #define SOF_RT5682_MCLK_EN			BIT(3)
 #define SOF_RT5682_MCLK_24MHZ			BIT(4)
 #define SOF_SPEAKER_AMP_PRESENT		BIT(5)
-#define SOF_RT5682_SSP_AMP(quirk)		((quirk) & GENMASK(8, 6))
-#define SOF_RT5682_SSP_AMP_MASK			(GENMASK(8, 6))
 #define SOF_RT5682_SSP_AMP_SHIFT		6
+#define SOF_RT5682_SSP_AMP_MASK                 (GENMASK(8, 6))
+#define SOF_RT5682_SSP_AMP(quirk)	\
+	(((quirk) << SOF_RT5682_SSP_AMP_SHIFT) & SOF_RT5682_SSP_AMP_MASK)
 
 /* Default: MCLK on, MCLK 19.2M, SSP0  */
 static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
Signature · 1 line
2.20.1
#5 lore raw

PATCH v2 3/5 ASoC: Intel: sof-rt5682: add newline for clarity

In reply to Pierre-Louis Bossart

From: Sathya Prakash M R <[email protected]>

Make sure quirk handling is cleary split from number of links.

---
 sound/soc/intel/boards/sof_rt5682.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/sof_rt5682.c +1 -0
index 3343dbcd506f..e441dc979966 100644
@@ -520,6 +520,7 @@ static int sof_audio_probe(struct platform_device *pdev)
 
 	/* compute number of dai links */
 	sof_audio_card_rt5682.num_links = 1 + dmic_num + hdmi_num;
+
 	if (sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT)
 		sof_audio_card_rt5682.num_links++;
 
Signature · 1 line
2.20.1
maintainer
#6 lore raw

Applied "ASoC: Intel: sof-rt5682: add newline for clarity" to the asoc tree

The patch

ASoC: Intel: sof-rt5682: add newline for clarity

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From b385256eb54f0193f0f595a675409ba6e7282ffe Mon Sep 17 00:00:00 2001

From: Sathya Prakash M R <[email protected]>
Date: Mon, 20 May 2019 14:46:43 -0500
Subject: [PATCH] ASoC: Intel: sof-rt5682: add newline for clarity

Make sure quirk handling is cleary split from number of links.

---
 sound/soc/intel/boards/sof_rt5682.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/boards/sof_rt5682.c +1 -0
index f28fb98cc306..fea42e275326 100644
@@ -519,6 +519,7 @@ static int sof_audio_probe(struct platform_device *pdev)
 
 	/* compute number of dai links */
 	sof_audio_card_rt5682.num_links = 1 + dmic_num + hdmi_num;
+
 	if (sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT)
 		sof_audio_card_rt5682.num_links++;
 
Signature · 1 line
2.20.1
#7 lore raw

PATCH v2 4/5 ASoC: Intel: soc-acpi: Fix machine selection order

In reply to Pierre-Louis Bossart

From: Sathya Prakash M R <[email protected]>

The selection order of m/c in match table is corrected to use common codec as last in the list.

---
 sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
sound/soc/intel/common/soc-acpi-intel-cnl-match.c +5 -5
index df7c52cad5c3..c36c0aa4f683 100644
@@ -29,17 +29,17 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = {
 		.sof_tplg_filename = "sof-cnl-rt274.tplg",
 	},
 	{
-		.id = "10EC5682",
+		.id = "MX98357A",
 		.drv_name = "sof_rt5682",
+		.quirk_data = &cml_codecs,
 		.sof_fw_filename = "sof-cnl.ri",
-		.sof_tplg_filename = "sof-cml-rt5682.tplg",
+		.sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
 	},
 	{
-		.id = "MX98357A",
+		.id = "10EC5682",
 		.drv_name = "sof_rt5682",
-		.quirk_data = &cml_codecs,
 		.sof_fw_filename = "sof-cnl.ri",
-		.sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
+		.sof_tplg_filename = "sof-cml-rt5682.tplg",
 	},
 
 	{},
Signature · 1 line
2.20.1
#8 lore raw

PATCH v2 5/5 ASoC: Intel: glk_rt5682_max98357a: Remap button control-function

In reply to Pierre-Louis Bossart

From: Yong Zhi <[email protected]>

Assign button functions based on Android wired headset specs(v1.1).

---
 sound/soc/intel/boards/glk_rt5682_max98357a.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
sound/soc/intel/boards/glk_rt5682_max98357a.c +4 -3
index d17126f7757c..6b677b5bcdcd 100644
@@ -169,9 +169,10 @@ static int geminilake_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
 	jack = &ctx->geminilake_headset;
 
 	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
+
 	ret = snd_soc_component_set_jack(component, jack, NULL);
 
 	if (ret) {
Signature · 1 line
2.20.1