All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Mark Brown <broonie@kernel.org>
Cc: "AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	kernel@collabora.com,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Jiaxin Yu" <jiaxin.yu@mediatek.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	alsa-devel@alsa-project.org, "chunxu.li" <chunxu.li@mediatek.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [PATCH 3/6] ASoC: mediatek: mt8186-da7219: Add headset widgets with switches
Date: Thu, 22 Sep 2022 19:59:48 -0400	[thread overview]
Message-ID: <20220922235951.252532-4-nfraprado@collabora.com> (raw)
In-Reply-To: <20220922235951.252532-1-nfraprado@collabora.com>

Add DAPM widgets for headphones and headset microphone, with matching
switches, to allow toggling these paths based on the jack connection
status.

Note that differently from others (mt8192, mt8195 and mt8186-rt5682),
the widget here is named "Headphones" (with an 's'), since "Headphone
Switch" was already registered by da7219.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---

 sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
index 6f93f9dd4623..8d428bc4a3b2 100644
--- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
+++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
@@ -950,6 +950,8 @@ static struct snd_soc_dai_link mt8186_mt6366_da7219_max98357_dai_links[] = {
 static const struct snd_soc_dapm_widget
 mt8186_mt6366_da7219_max98357_widgets[] = {
 	SND_SOC_DAPM_SPK("Speakers", NULL),
+	SND_SOC_DAPM_HP("Headphones", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_OUTPUT("HDMI1"),
 	SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0),
 	SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0),
@@ -961,6 +963,10 @@ static const struct snd_soc_dapm_route
 mt8186_mt6366_da7219_max98357_routes[] = {
 	/* SPK */
 	{ "Speakers", NULL, "Speaker"},
+	/* Headset */
+	{ "Headphones", NULL, "HPL" },
+	{ "Headphones", NULL, "HPR" },
+	{ "MIC", NULL, "Headset Mic" },
 	/* HDMI */
 	{ "HDMI1", NULL, "TX"},
 	/* SOF Uplink */
@@ -976,6 +982,8 @@ mt8186_mt6366_da7219_max98357_routes[] = {
 static const struct snd_kcontrol_new
 mt8186_mt6366_da7219_max98357_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Speakers"),
+	SOC_DAPM_PIN_SWITCH("Headphones"),
+	SOC_DAPM_PIN_SWITCH("Headset Mic"),
 	SOC_DAPM_PIN_SWITCH("HDMI1"),
 };
 
-- 
2.37.3


WARNING: multiple messages have this Message-ID (diff)
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, "chunxu.li" <chunxu.li@mediatek.com>,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	linux-kernel@vger.kernel.org, "Takashi Iwai" <tiwai@suse.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Jiaxin Yu" <jiaxin.yu@mediatek.com>,
	linux-mediatek@lists.infradead.org,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	kernel@collabora.com, linux-arm-kernel@lists.infradead.org,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Subject: [PATCH 3/6] ASoC: mediatek: mt8186-da7219: Add headset widgets with switches
Date: Thu, 22 Sep 2022 19:59:48 -0400	[thread overview]
Message-ID: <20220922235951.252532-4-nfraprado@collabora.com> (raw)
In-Reply-To: <20220922235951.252532-1-nfraprado@collabora.com>

Add DAPM widgets for headphones and headset microphone, with matching
switches, to allow toggling these paths based on the jack connection
status.

Note that differently from others (mt8192, mt8195 and mt8186-rt5682),
the widget here is named "Headphones" (with an 's'), since "Headphone
Switch" was already registered by da7219.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---

 sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
index 6f93f9dd4623..8d428bc4a3b2 100644
--- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
+++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
@@ -950,6 +950,8 @@ static struct snd_soc_dai_link mt8186_mt6366_da7219_max98357_dai_links[] = {
 static const struct snd_soc_dapm_widget
 mt8186_mt6366_da7219_max98357_widgets[] = {
 	SND_SOC_DAPM_SPK("Speakers", NULL),
+	SND_SOC_DAPM_HP("Headphones", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_OUTPUT("HDMI1"),
 	SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0),
 	SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0),
@@ -961,6 +963,10 @@ static const struct snd_soc_dapm_route
 mt8186_mt6366_da7219_max98357_routes[] = {
 	/* SPK */
 	{ "Speakers", NULL, "Speaker"},
+	/* Headset */
+	{ "Headphones", NULL, "HPL" },
+	{ "Headphones", NULL, "HPR" },
+	{ "MIC", NULL, "Headset Mic" },
 	/* HDMI */
 	{ "HDMI1", NULL, "TX"},
 	/* SOF Uplink */
@@ -976,6 +982,8 @@ mt8186_mt6366_da7219_max98357_routes[] = {
 static const struct snd_kcontrol_new
 mt8186_mt6366_da7219_max98357_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Speakers"),
+	SOC_DAPM_PIN_SWITCH("Headphones"),
+	SOC_DAPM_PIN_SWITCH("Headset Mic"),
 	SOC_DAPM_PIN_SWITCH("HDMI1"),
 };
 
-- 
2.37.3


WARNING: multiple messages have this Message-ID (diff)
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Mark Brown <broonie@kernel.org>
Cc: "AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	kernel@collabora.com,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Jiaxin Yu" <jiaxin.yu@mediatek.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	alsa-devel@alsa-project.org, "chunxu.li" <chunxu.li@mediatek.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [PATCH 3/6] ASoC: mediatek: mt8186-da7219: Add headset widgets with switches
Date: Thu, 22 Sep 2022 19:59:48 -0400	[thread overview]
Message-ID: <20220922235951.252532-4-nfraprado@collabora.com> (raw)
In-Reply-To: <20220922235951.252532-1-nfraprado@collabora.com>

Add DAPM widgets for headphones and headset microphone, with matching
switches, to allow toggling these paths based on the jack connection
status.

Note that differently from others (mt8192, mt8195 and mt8186-rt5682),
the widget here is named "Headphones" (with an 's'), since "Headphone
Switch" was already registered by da7219.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---

 sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
index 6f93f9dd4623..8d428bc4a3b2 100644
--- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
+++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
@@ -950,6 +950,8 @@ static struct snd_soc_dai_link mt8186_mt6366_da7219_max98357_dai_links[] = {
 static const struct snd_soc_dapm_widget
 mt8186_mt6366_da7219_max98357_widgets[] = {
 	SND_SOC_DAPM_SPK("Speakers", NULL),
+	SND_SOC_DAPM_HP("Headphones", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_OUTPUT("HDMI1"),
 	SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0),
 	SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0),
@@ -961,6 +963,10 @@ static const struct snd_soc_dapm_route
 mt8186_mt6366_da7219_max98357_routes[] = {
 	/* SPK */
 	{ "Speakers", NULL, "Speaker"},
+	/* Headset */
+	{ "Headphones", NULL, "HPL" },
+	{ "Headphones", NULL, "HPR" },
+	{ "MIC", NULL, "Headset Mic" },
 	/* HDMI */
 	{ "HDMI1", NULL, "TX"},
 	/* SOF Uplink */
@@ -976,6 +982,8 @@ mt8186_mt6366_da7219_max98357_routes[] = {
 static const struct snd_kcontrol_new
 mt8186_mt6366_da7219_max98357_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Speakers"),
+	SOC_DAPM_PIN_SWITCH("Headphones"),
+	SOC_DAPM_PIN_SWITCH("Headset Mic"),
 	SOC_DAPM_PIN_SWITCH("HDMI1"),
 };
 
-- 
2.37.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-09-23  0:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 23:59 [PATCH 0/6] ASoC: mediatek: Allow separate handling of headphone and headset mic jack Nícolas F. R. A. Prado
2022-09-22 23:59 ` Nícolas F. R. A. Prado
2022-09-22 23:59 ` Nícolas F. R. A. Prado
2022-09-22 23:59 ` [PATCH 1/6] ASoC: mediatek: mt8192-mt6359: Expose individual headset jack pins Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-23  8:58   ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-22 23:59 ` [PATCH 2/6] ASoC: mediatek: mt8195: " Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-23  8:58   ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-22 23:59 ` Nícolas F. R. A. Prado [this message]
2022-09-22 23:59   ` [PATCH 3/6] ASoC: mediatek: mt8186-da7219: Add headset widgets with switches Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-23  8:58   ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-22 23:59 ` [PATCH 4/6] ASoC: mediatek: mt8186-da7219: Expose individual headset jack pins Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-23  8:58   ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-22 23:59 ` [PATCH 5/6] ASoC: mediatek: mt8186-rt5682: Add headset widgets with switches Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-23  8:58   ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-22 23:59 ` [PATCH 6/6] ASoC: mediatek: mt8186-rt5682: Expose individual headset jack pins Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-22 23:59   ` Nícolas F. R. A. Prado
2022-09-23  8:58   ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23  8:58     ` AngeloGioacchino Del Regno
2022-09-23 17:07 ` [PATCH 0/6] ASoC: mediatek: Allow separate handling of headphone and headset mic jack Mark Brown
2022-09-23 17:07   ` Mark Brown
2022-09-23 17:07   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220922235951.252532-4-nfraprado@collabora.com \
    --to=nfraprado@collabora.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=chunxu.li@mediatek.com \
    --cc=jiaxin.yu@mediatek.com \
    --cc=kernel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.