Skip to contentSkip to conversation

ASoC: Intel: kbl: Machine driver modifications to support MST Audio

PATCH In review Naveen M 3 participants 6 messages Aug 25, 2017 – Aug 29, 2017

Subsystems (3)
lore
Share & tools
lore

Naveen M

author
#0 lore raw

cover ASoC: Intel: kbl: Machine driver modifications to support MST Audio

Patch modifies dapm routes to enable HDMI Audio and invokes machine pin widget for hdmi port to enable/disable pin, when monitor is connected/disconnected based on the pin status.

Naveen M (2):
ASoC: Intel: kbl: Add MST route change to kbl machine drivers
ASoC: Intel: kbl: Add jack port initialize in kbl machine drivers

 sound/soc/intel/boards/kbl_rt5663_max98927.c        | 15 +++++++++------
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 14 ++++++++------
 2 files changed, 17 insertions(+), 12 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 ASoC: Intel: kbl: Add MST route change to kbl machine drivers

To support MST hdmi audio, modify the current routes to be based on port in rt5663_max98927 & rt5663_rt5514_max98927 machine.

---
 sound/soc/intel/boards/kbl_rt5663_max98927.c        | 8 +++-----
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 7 ++-----
 2 files changed, 5 insertions(+), 10 deletions(-)
sound/soc/intel/boards/kbl_rt5663_max98927.c +3 -5
index 8d2a1c0..24f1d7ca 100644
@@ -74,8 +74,9 @@ enum {
 	SND_SOC_DAPM_SPK("Left Spk", NULL),
 	SND_SOC_DAPM_SPK("Right Spk", NULL),
 	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
-	SND_SOC_DAPM_SPK("DP", NULL),
-	SND_SOC_DAPM_SPK("HDMI", NULL),
+	SND_SOC_DAPM_SPK("HDMI1", NULL),
+	SND_SOC_DAPM_SPK("HDMI2", NULL),
+	SND_SOC_DAPM_SPK("HDMI3", NULL),
 
 };
 
@@ -93,9 +94,6 @@ enum {
 	{ "IN1N", NULL, "Headset Mic" },
 	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
-
 	/* CODEC BE connections */
 	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
 	{ "Right HiFi Playback", NULL, "ssp0 Tx" },
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +2 -5
index 509aeb9..0b8ace5 100644
@@ -85,8 +85,8 @@ enum {
 	SND_SOC_DAPM_SPK("Left Spk", NULL),
 	SND_SOC_DAPM_SPK("Right Spk", NULL),
 	SND_SOC_DAPM_MIC("DMIC", NULL),
-	SND_SOC_DAPM_SPK("DP", NULL),
-	SND_SOC_DAPM_SPK("HDMI", NULL),
+	SND_SOC_DAPM_SPK("HDMI1", NULL),
+	SND_SOC_DAPM_SPK("HDMI2", NULL),
 
 };
 
@@ -103,9 +103,6 @@ enum {
 	{ "IN1P", NULL, "Headset Mic" },
 	{ "IN1N", NULL, "Headset Mic" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
-
 	/* CODEC BE connections */
 	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
 	{ "Right HiFi Playback", NULL, "ssp0 Tx" },
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Applied "ASoC: Intel: kbl: Add MST route change to kbl machine drivers" to the asoc tree

The patch

ASoC: Intel: kbl: Add MST route change to kbl machine drivers

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

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 c20252cf9230eb7abd8bce9fdb2ce9bdd6743689 Mon Sep 17 00:00:00 2001

From: Naveen M <[email protected]>
Date: Sat, 26 Aug 2017 04:04:09 +0530
Subject: [PATCH] ASoC: Intel: kbl: Add MST route change to kbl machine drivers

To support MST hdmi audio, modify the current routes to be based on port in rt5663_max98927 & rt5663_rt5514_max98927 machine.

---
 sound/soc/intel/boards/kbl_rt5663_max98927.c        | 8 +++-----
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 7 ++-----
 2 files changed, 5 insertions(+), 10 deletions(-)
sound/soc/intel/boards/kbl_rt5663_max98927.c +3 -5
index c1442147d138..941480c3e906 100644
@@ -74,8 +74,9 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = {
 	SND_SOC_DAPM_SPK("Left Spk", NULL),
 	SND_SOC_DAPM_SPK("Right Spk", NULL),
 	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
-	SND_SOC_DAPM_SPK("DP", NULL),
-	SND_SOC_DAPM_SPK("HDMI", NULL),
+	SND_SOC_DAPM_SPK("HDMI1", NULL),
+	SND_SOC_DAPM_SPK("HDMI2", NULL),
+	SND_SOC_DAPM_SPK("HDMI3", NULL),
 
 };
 
@@ -93,9 +94,6 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
 	{ "IN1N", NULL, "Headset Mic" },
 	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
-
 	/* CODEC BE connections */
 	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
 	{ "Right HiFi Playback", NULL, "ssp0 Tx" },
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +2 -5
index 69681b04d7fc..d042255235c1 100644
@@ -85,8 +85,8 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = {
 	SND_SOC_DAPM_SPK("Left Spk", NULL),
 	SND_SOC_DAPM_SPK("Right Spk", NULL),
 	SND_SOC_DAPM_MIC("DMIC", NULL),
-	SND_SOC_DAPM_SPK("DP", NULL),
-	SND_SOC_DAPM_SPK("HDMI", NULL),
+	SND_SOC_DAPM_SPK("HDMI1", NULL),
+	SND_SOC_DAPM_SPK("HDMI2", NULL),
 
 };
 
@@ -103,9 +103,6 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
 	{ "IN1P", NULL, "Headset Mic" },
 	{ "IN1N", NULL, "Headset Mic" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
-
 	/* CODEC BE connections */
 	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
 	{ "Right HiFi Playback", NULL, "ssp0 Tx" },
Signature · 1 line
2.13.2
author
#3 lore raw

PATCH 2/2 ASoC: Intel: kbl: Add jack port initialize in kbl machine drivers

In reply to Naveen M

After the pcm jack is created, create and initialize the pin switch widget for each port. For hdmi audio, invoke hdac_hdmi_jack_port_init func() in rt5663_max98927 & rt5663_rt5514_max98927 to enable the pin, when monitor is connected.

---
 sound/soc/intel/boards/kbl_rt5663_max98927.c        | 7 ++++++-
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
sound/soc/intel/boards/kbl_rt5663_max98927.c +6 -1
index 24f1d7ca..7f76074 100644
@@ -772,10 +772,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 {
 	struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(card);
 	struct kbl_hdmi_pcm *pcm;
+	struct snd_soc_codec *codec = NULL;
 	int err, i = 0;
 	char jack_name[NAME_SIZE];
 
 	list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
+		codec = pcm->codec_dai->codec;
 		snprintf(jack_name, sizeof(jack_name),
 			"HDMI/DP, pcm=%d Jack", pcm->device);
 		err = snd_soc_card_jack_new(card, jack_name,
@@ -793,7 +795,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 		i++;
 	}
 
-	return 0;
+	if (!codec)
+		return -EINVAL;
+
+	return hdac_hdmi_jack_port_init(codec, &card->dapm);
 }
 
 /* kabylake audio machine driver for SPT + RT5663 */
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +6 -1
index 0b8ace5..88ff542 100644
@@ -598,10 +598,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 {
 	struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card);
 	struct kbl_hdmi_pcm *pcm;
+	struct snd_soc_codec *codec = NULL;
 	int err, i = 0;
 	char jack_name[NAME_SIZE];
 
 	list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
+		codec = pcm->codec_dai->codec;
 		err = snd_soc_card_jack_new(card, jack_name,
 				SND_JACK_AVOUT, &ctx->kabylake_hdmi[i],
 				NULL, 0);
@@ -615,7 +617,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 		i++;
 	}
 
-	return 0;
+	if (!codec)
+		return -EINVAL;
+
+	return hdac_hdmi_jack_port_init(codec, &card->dapm);
 }
 
 /*
Signature · 1 line
1.9.1
maintainer
#4 lore raw

Applied "ASoC: Intel: kbl: Add jack port initialize in kbl machine drivers" to the asoc tree

The patch

ASoC: Intel: kbl: Add jack port initialize in kbl machine drivers

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

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 3a13347f05fdba9d889891245f154816197868f4 Mon Sep 17 00:00:00 2001

From: Naveen M <[email protected]>
Date: Sat, 26 Aug 2017 04:04:10 +0530
Subject: [PATCH] ASoC: Intel: kbl: Add jack port initialize in kbl machine
drivers

After the pcm jack is created, create and initialize the pin switch widget for each port. For hdmi audio, invoke hdac_hdmi_jack_port_init func() in rt5663_max98927 & rt5663_rt5514_max98927 to enable the pin, when monitor is connected.

---
 sound/soc/intel/boards/kbl_rt5663_max98927.c        | 7 ++++++-
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
sound/soc/intel/boards/kbl_rt5663_max98927.c +6 -1
index 941480c3e906..3fa85c32b9f8 100644
@@ -767,10 +767,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 {
 	struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(card);
 	struct kbl_hdmi_pcm *pcm;
+	struct snd_soc_codec *codec = NULL;
 	int err, i = 0;
 	char jack_name[NAME_SIZE];
 
 	list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
+		codec = pcm->codec_dai->codec;
 		snprintf(jack_name, sizeof(jack_name),
 			"HDMI/DP, pcm=%d Jack", pcm->device);
 		err = snd_soc_card_jack_new(card, jack_name,
@@ -788,7 +790,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 		i++;
 	}
 
-	return 0;
+	if (!codec)
+		return -EINVAL;
+
+	return hdac_hdmi_jack_port_init(codec, &card->dapm);
 }
 
 /* kabylake audio machine driver for SPT + RT5663 */
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +6 -1
index d042255235c1..11bd5ef1e3b2 100644
@@ -600,10 +600,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 {
 	struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card);
 	struct kbl_hdmi_pcm *pcm;
+	struct snd_soc_codec *codec = NULL;
 	int err, i = 0;
 	char jack_name[NAME_SIZE];
 
 	list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
+		codec = pcm->codec_dai->codec;
 		err = snd_soc_card_jack_new(card, jack_name,
 				SND_JACK_AVOUT, &ctx->kabylake_hdmi[i],
 				NULL, 0);
@@ -617,7 +619,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
 		i++;
 	}
 
-	return 0;
+	if (!codec)
+		return -EINVAL;
+
+	return hdac_hdmi_jack_port_init(codec, &card->dapm);
 }
 
 /*
Signature · 1 line
2.13.2
Acked-by on the v1 series
#5 lore raw
In reply to Naveen M
Quoted 3 lines · Naveen M

Patch modifies dapm routes to enable HDMI Audio and invokes machine pin widget for hdmi port to enable/disable pin, when monitor is connected/disconnected based on the pin status.

Quoted 11 lines

Naveen M (2):
ASoC: Intel: kbl: Add MST route change to kbl machine drivers
ASoC: Intel: kbl: Add jack port initialize in kbl machine drivers

 sound/soc/intel/boards/kbl_rt5663_max98927.c        | 15 +++++++++------
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 14 ++++++++------
 2 files changed, 17 insertions(+), 12 deletions(-)
Signature · 1 line
1.9.1
Signature · 1 line
~Vinod