[alsa-devel] [PATCH 0/3] 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.
Sathya Prakash M R (2): ASoC: Intel: sof-rt5682: Few minor fixes for AMP SSP and codec button 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(-)
base-commit: d0723c9d845f9a6ff1069e5786ccda8e81566763
From: Sathya Prakash M R sathya.prakash.m.r@intel.com
This fixes: 1. BIT mask for AMP SSP was incorrect. 2. The RT5682 codec button mapping is corrected.
Signed-off-by: Sathya Prakash M R sathya.prakash.m.r@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/intel/boards/sof_rt5682.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index f28fb98cc306..e441dc979966 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -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 | @@ -144,9 +145,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) { @@ -519,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++;
On Sat, May 18, 2019 at 01:30:07PM -0500, Pierre-Louis Bossart wrote:
From: Sathya Prakash M R sathya.prakash.m.r@intel.com
This fixes: 1. BIT mask for AMP SSP was incorrect. 2. The RT5682 codec button mapping is corrected.
Indentation is a bit weird here, and these are really two changes that should be split.
@@ -519,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++;
and this is an unrelated indentation change.
On 5/20/19 7:31 AM, Mark Brown wrote:
On Sat, May 18, 2019 at 01:30:07PM -0500, Pierre-Louis Bossart wrote:
From: Sathya Prakash M R sathya.prakash.m.r@intel.com
This fixes: 1. BIT mask for AMP SSP was incorrect. 2. The RT5682 codec button mapping is corrected.
Indentation is a bit weird here, and these are really two changes that should be split.
@@ -519,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++;
and this is an unrelated indentation change.
ok, I'll send a v2.
From: Sathya Prakash M R sathya.prakash.m.r@intel.com
The selection order of m/c in match table is corrected to use common codec as last in the list.
Signed-off-by: Sathya Prakash M R sathya.prakash.m.r@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c index df7c52cad5c3..c36c0aa4f683 100644 --- a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c @@ -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", },
{},
The patch
ASoC: Intel: soc-acpi: Fix machine selection order
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
From 30d9d4ff53532087bc13ed29d7715df868794b5e Mon Sep 17 00:00:00 2001
From: Sathya Prakash M R sathya.prakash.m.r@intel.com Date: Sat, 18 May 2019 13:30:08 -0500 Subject: [PATCH] ASoC: Intel: soc-acpi: Fix machine selection order
The selection order of m/c in match table is corrected to use common codec as last in the list.
Signed-off-by: Sathya Prakash M R sathya.prakash.m.r@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c index df7c52cad5c3..c36c0aa4f683 100644 --- a/sound/soc/intel/common/soc-acpi-intel-cnl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-cnl-match.c @@ -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", },
{},
From: Yong Zhi yong.zhi@intel.com
Assign button functions based on Android wired headset specs(v1.1).
Signed-off-by: Yong Zhi yong.zhi@intel.com Signed-off-by: Naveen Manohar naveen.m@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/intel/boards/glk_rt5682_max98357a.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/intel/boards/glk_rt5682_max98357a.c b/sound/soc/intel/boards/glk_rt5682_max98357a.c index d17126f7757c..6b677b5bcdcd 100644 --- a/sound/soc/intel/boards/glk_rt5682_max98357a.c +++ b/sound/soc/intel/boards/glk_rt5682_max98357a.c @@ -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) {
The patch
ASoC: Intel: glk_rt5682_max98357a: Remap button control-function
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
From 39f2d114a1c7d73d601f19cbea0a955ade2784c3 Mon Sep 17 00:00:00 2001
From: Yong Zhi yong.zhi@intel.com Date: Sat, 18 May 2019 13:30:09 -0500 Subject: [PATCH] ASoC: Intel: glk_rt5682_max98357a: Remap button control-function
Assign button functions based on Android wired headset specs(v1.1).
Signed-off-by: Yong Zhi yong.zhi@intel.com Signed-off-by: Naveen Manohar naveen.m@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/intel/boards/glk_rt5682_max98357a.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/intel/boards/glk_rt5682_max98357a.c b/sound/soc/intel/boards/glk_rt5682_max98357a.c index d17126f7757c..6b677b5bcdcd 100644 --- a/sound/soc/intel/boards/glk_rt5682_max98357a.c +++ b/sound/soc/intel/boards/glk_rt5682_max98357a.c @@ -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) {
participants (2)
-
Mark Brown
-
Pierre-Louis Bossart