alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack
@ 2021-12-11 23:11 Dmitry Osipenko
  2021-12-11 23:11 ` [PATCH v1 2/2] ASoC: tegra: Restore headphones jack name on Nyan Big Dmitry Osipenko
  2021-12-13 22:42 ` [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2021-12-11 23:11 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Mark Brown, Takashi Iwai,
	Jaroslav Kysela, Liam Girdwood, Thomas Graichen
  Cc: linux-tegra, alsa-devel, linux-kernel

UCM of Acer Chromebook (Nyan) uses DAPM switches of headphones and mic
jack. These switches were lost by accident during unification of the
machine drivers, restore them.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f ("ASoC: tegra: Unify ASoC machine drivers")
Reported-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Tested-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 sound/soc/tegra/tegra_asoc_machine.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index b95438c3dbf7..f3e86bd714b4 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -116,6 +116,8 @@ static const struct snd_kcontrol_new tegra_machine_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Headset Mic"),
 	SOC_DAPM_PIN_SWITCH("Internal Mic 1"),
 	SOC_DAPM_PIN_SWITCH("Internal Mic 2"),
+	SOC_DAPM_PIN_SWITCH("Headphones"),
+	SOC_DAPM_PIN_SWITCH("Mic Jack"),
 };
 
 int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd)
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] ASoC: tegra: Restore headphones jack name on Nyan Big
  2021-12-11 23:11 [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack Dmitry Osipenko
@ 2021-12-11 23:11 ` Dmitry Osipenko
  2021-12-13 22:42 ` [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2021-12-11 23:11 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Mark Brown, Takashi Iwai,
	Jaroslav Kysela, Liam Girdwood, Thomas Graichen
  Cc: linux-tegra, alsa-devel, linux-kernel

UCM of Acer Chromebook (Nyan) uses a different name for the headphones
jack. The name was changed during unification of the machine drivers and
UCM fails now to load because of that. Restore the old jack name.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f ("ASoC: tegra: Unify ASoC machine drivers")
Reported-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Tested-by: Thomas Graichen <thomas.graichen@gmail.com> # T124 Nyan Big
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 sound/soc/tegra/tegra_asoc_machine.c | 9 ++++++++-
 sound/soc/tegra/tegra_asoc_machine.h | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index f3e86bd714b4..a73404879aa1 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -124,10 +124,16 @@ int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
+	const char *jack_name;
 	int err;
 
 	if (machine->gpiod_hp_det && machine->asoc->add_hp_jack) {
-		err = snd_soc_card_jack_new(card, "Headphones Jack",
+		if (machine->asoc->hp_jack_name)
+			jack_name = machine->asoc->hp_jack_name;
+		else
+			jack_name = "Headphones Jack";
+
+		err = snd_soc_card_jack_new(card, jack_name,
 					    SND_JACK_HEADPHONE,
 					    &tegra_machine_hp_jack,
 					    tegra_machine_hp_jack_pins,
@@ -660,6 +666,7 @@ static struct snd_soc_card snd_soc_tegra_max98090 = {
 static const struct tegra_asoc_data tegra_max98090_data = {
 	.mclk_rate = tegra_machine_mclk_rate_12mhz,
 	.card = &snd_soc_tegra_max98090,
+	.hp_jack_name = "Headphones",
 	.add_common_dapm_widgets = true,
 	.add_common_controls = true,
 	.add_common_snd_ops = true,
diff --git a/sound/soc/tegra/tegra_asoc_machine.h b/sound/soc/tegra/tegra_asoc_machine.h
index d6a8d1320551..6f795d7dff7c 100644
--- a/sound/soc/tegra/tegra_asoc_machine.h
+++ b/sound/soc/tegra/tegra_asoc_machine.h
@@ -14,6 +14,7 @@ struct snd_soc_pcm_runtime;
 struct tegra_asoc_data {
 	unsigned int (*mclk_rate)(unsigned int srate);
 	const char *codec_dev_name;
+	const char *hp_jack_name;
 	struct snd_soc_card *card;
 	unsigned int mclk_id;
 	bool hp_jack_gpio_active_low;
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack
  2021-12-11 23:11 [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack Dmitry Osipenko
  2021-12-11 23:11 ` [PATCH v1 2/2] ASoC: tegra: Restore headphones jack name on Nyan Big Dmitry Osipenko
@ 2021-12-13 22:42 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-12-13 22:42 UTC (permalink / raw)
  To: Jaroslav Kysela, Liam Girdwood, Takashi Iwai, Dmitry Osipenko,
	Jonathan Hunter, Thomas Graichen, Thierry Reding
  Cc: linux-tegra, alsa-devel, linux-kernel

On Sun, 12 Dec 2021 02:11:45 +0300, Dmitry Osipenko wrote:
> UCM of Acer Chromebook (Nyan) uses DAPM switches of headphones and mic
> jack. These switches were lost by accident during unification of the
> machine drivers, restore them.
> 
> 

Applied to

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

Thanks!

[1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack
      commit: d341b427c3c3fd6a58263ce01e01700d16861c28
[2/2] ASoC: tegra: Restore headphones jack name on Nyan Big
      commit: db635ba4fadf3ba676d07537f3b3f58166aa7b0e

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-13 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11 23:11 [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack Dmitry Osipenko
2021-12-11 23:11 ` [PATCH v1 2/2] ASoC: tegra: Restore headphones jack name on Nyan Big Dmitry Osipenko
2021-12-13 22:42 ` [PATCH v1 1/2] ASoC: tegra: Add DAPM switches for headphones and mic jack Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).