Skip to contentSkip to conversation

kbl_da7219_max9357a machine changes for wov and MST

PATCH Superseded [email protected] 2 participants 5 messages Mar 25, 2021 – Apr 5, 2021

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover kbl_da7219_max9357a machine changes for wov and MST

From: Vamshi Krishna Gopal <[email protected]>

Hi all,

This patch series about creating dailink for Wake on voice functionality and also adding MST route changes.

changes in v2
- Add MST route changes to kbl_da7219_max98927.c and kabl_rt5663_max98927.c
- typo corrected in struct skylaye_refcap_ops to skylake_refcap_ops
- Declare constraints_1600 struct and ch_mono variable

v1 is here:

https://patchwork.kernel.org/project/alsa-devel/cover/[email protected]/

Mac Chiang (1):
ASoc: Intel: board: add BE DAI link for WoV

Vamshi Krishna Gopal (1):
ASoC: Intel: kbl: Add MST route change to kbl machine drivers

 sound/soc/intel/boards/kbl_da7219_max98357a.c | 57 ++++++++++++++++++-
 sound/soc/intel/boards/kbl_da7219_max98927.c  |  9 ++-
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |  4 ++
 3 files changed, 64 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

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

From: Vamshi Krishna Gopal <[email protected]>

To support MST hdmi audio, modify the current routes to be based on port in kbl_da7219_max98357a, kbl_da7219_max98927 & kbl_rt5663_max98927.

---
 sound/soc/intel/boards/kbl_da7219_max98357a.c | 9 ++++++---
 sound/soc/intel/boards/kbl_da7219_max98927.c  | 9 ++++++---
 sound/soc/intel/boards/kbl_rt5663_max98927.c  | 4 ++++
 3 files changed, 16 insertions(+), 6 deletions(-)
sound/soc/intel/boards/kbl_da7219_max98357a.c +6 -3
index dc3d897ad280..5c371bb01313 100644
@@ -91,7 +91,9 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = {
 	SND_SOC_DAPM_SPK("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),
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			platform_clock_control, SND_SOC_DAPM_PRE_PMU |
 			SND_SOC_DAPM_POST_PMD),
@@ -108,8 +110,9 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
 	{ "MIC", NULL, "Headset Mic" },
 	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
 
 	/* CODEC BE connections */
 	{ "HiFi Playback", NULL, "ssp0 Tx" },
sound/soc/intel/boards/kbl_da7219_max98927.c +6 -3
index cc9a2509ace2..e8dc291b1749 100644
@@ -112,7 +112,9 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = {
 	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),
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			platform_clock_control, SND_SOC_DAPM_PRE_PMU |
 			SND_SOC_DAPM_POST_PMD),
@@ -126,8 +128,9 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
 	/* other jacks */
 	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
 
 	/* CODEC BE connections */
 	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
sound/soc/intel/boards/kbl_rt5663_max98927.c +4 -0
index 9a4b3d0973f6..cb7990823d35 100644
@@ -151,6 +151,10 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
 	{ "IN1N", NULL, "Headset Mic" },
 	{ "DMic", NULL, "SoC DMIC" },
 
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
+
 	/* CODEC BE connections */
 	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
 	{ "Right HiFi Playback", NULL, "ssp0 Tx" },
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v2 1/2] ASoC: Intel: kbl: Add MST route change to kbl machine drivers

Quoted 18 lines · On 3/25/21 12:43 PM, [email protected] wrote:

From: Vamshi Krishna Gopal <[email protected]>

To support MST hdmi audio, modify the current routes to be based on port in kbl_da7219_max98357a, kbl_da7219_max98927 & kbl_rt5663_max98927.

---
  sound/soc/intel/boards/kbl_da7219_max98357a.c | 9 ++++++---
  sound/soc/intel/boards/kbl_da7219_max98927.c  | 9 ++++++---
  sound/soc/intel/boards/kbl_rt5663_max98927.c  | 4 ++++
  3 files changed, 16 insertions(+), 6 deletions(-)
sound/soc/intel/boards/kbl_da7219_max98357a.c +0 -0
index dc3d897ad280..5c371bb01313 100644

sound/soc/intel/boards/kbl_da7219_max98357a.c static const struct snd_soc_dapm_widget kabylake_widgets[] = { · line 94

Quoted 4 lines
sound/soc/intel/boards/kbl_da7219_max98357a.c +0 -1
@@ -91,7 +91,9 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = {
  	SND_SOC_DAPM_SPK("Spk", NULL),
  	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
  	SND_SOC_DAPM_SPK("DP", NULL),
-	SND_SOC_DAPM_SPK("HDMI", NULL),

so here you keep the DP but remove HDMI

sound/soc/intel/boards/kbl_da7219_max98357a.c static const struct snd_soc_dapm_route kabylake_map[] = { · line 112

Quoted 12 lines
sound/soc/intel/boards/kbl_da7219_max98357a.c +3 -2
+	SND_SOC_DAPM_SPK("HDMI1", NULL),
+	SND_SOC_DAPM_SPK("HDMI2", NULL),
+	SND_SOC_DAPM_SPK("HDMI3", NULL),
  	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
  			platform_clock_control, SND_SOC_DAPM_PRE_PMU |
  			SND_SOC_DAPM_POST_PMD),
@@ -108,8 +110,9 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
  	{ "MIC", NULL, "Headset Mic" },
  	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },

but here you remove both? I guess you forgot to remove DP earlier?

Quoted 38 lines
sound/soc/intel/boards/kbl_da7219_max98357a.c +3 -0
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
 
  	/* CODEC BE connections */
  	{ "HiFi Playback", NULL, "ssp0 Tx" },
sound/soc/intel/boards/kbl_da7219_max98927.c +6 -3
index cc9a2509ace2..e8dc291b1749 100644
@@ -112,7 +112,9 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = {
  	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),
  	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
  			platform_clock_control, SND_SOC_DAPM_PRE_PMU |
  			SND_SOC_DAPM_POST_PMD),
@@ -126,8 +128,9 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
  	/* other jacks */
  	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
 
  	/* CODEC BE connections */
  	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
sound/soc/intel/boards/kbl_rt5663_max98927.c +0 -0
index 9a4b3d0973f6..cb7990823d35 100644

sound/soc/intel/boards/kbl_rt5663_max98927.c static const struct snd_soc_dapm_route kabylake_map[] = { · line 160

Quoted 10 lines
sound/soc/intel/boards/kbl_rt5663_max98927.c +4 -0
@@ -151,6 +151,10 @@ static const struct snd_soc_dapm_route kabylake_map[] = {
  	{ "IN1N", NULL, "Headset Mic" },
  	{ "DMic", NULL, "SoC DMIC" },
 
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
+
  	/* CODEC BE connections */
  	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
  	{ "Right HiFi Playback", NULL, "ssp0 Tx" },

What about the other routing table?

static const struct snd_soc_dapm_widget kabylake_5663_widgets[] = {
	SND_SOC_DAPM_HP("Headphone Jack", NULL),
	SND_SOC_DAPM_MIC("Headset Mic", NULL),
	SND_SOC_DAPM_SPK("DP", NULL),
	SND_SOC_DAPM_SPK("HDMI", NULL),
static const struct snd_soc_dapm_route kabylake_5663_map[] = {
	{ "Headphone Jack", NULL, "Platform Clock" },
	{ "Headphone Jack", NULL, "HPOL" },
	{ "Headphone Jack", NULL, "HPOR" },

	/* other jacks */
	{ "Headset Mic", NULL, "Platform Clock" },
	{ "IN1P", NULL, "Headset Mic" },
	{ "IN1N", NULL, "Headset Mic" },

	{ "HDMI", NULL, "hif5 Output" },
	{ "DP", NULL, "hif6 Output" },

it'd be good to be consistent, wouldn't it?

#3 lore raw

RE: [PATCH v2 1/2] ASoC: Intel: kbl: Add MST route change to kbl machine drivers

Quoted 17 lines

kabylake_widgets[] = {

Review

Quoted 4 lines

SND_SOC_DAPM_SPK("Spk", NULL),
SND_SOC_DAPM_MIC("SoC DMIC", NULL),
SND_SOC_DAPM_SPK("DP", NULL),

(quoted diff) +0 -1
-	SND_SOC_DAPM_SPK("HDMI", NULL),

so here you keep the DP but remove HDMI

sound/soc/intel/boards/kbl_da7219_max98357a.c static const struct snd_soc_dapm_widget kabylake_widgets[] = {

Quoted 5 lines
sound/soc/intel/boards/kbl_da7219_max98357a.c +3 -0
+	SND_SOC_DAPM_SPK("HDMI1", NULL),
+	SND_SOC_DAPM_SPK("HDMI2", NULL),
+	SND_SOC_DAPM_SPK("HDMI3", NULL),
  	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
  			platform_clock_control, SND_SOC_DAPM_PRE_PMU

|

Review static const struct snd_soc_dapm_route

Quoted 2 lines

SND_SOC_DAPM_POST_PMD),

(quoted diff) +0 -0
@@ -108,8 +110,9 @@ static const struct snd_soc_dapm_route

kabylake_map[] = {

Quoted 7 lines

sound/soc/intel/boards/kbl_da7219_max98357a.c static const struct snd_soc_dapm_route kabylake_map[] = { · line 112

Quoted 5 lines
sound/soc/intel/boards/kbl_da7219_max98357a.c +0 -2
  	{ "MIC", NULL, "Headset Mic" },
  	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },

but here you remove both? I guess you forgot to remove DP earlier?

[Gopal, Vamshi Krishna] yes, I forgot to remove DP updated in v3

Quoted 77 lines

sound/soc/intel/boards/kbl_da7219_max98927.c static const struct snd_soc_dapm_widget

Quoted 13 lines
sound/soc/intel/boards/kbl_da7219_max98357a.c +3 -0
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
 
  	/* CODEC BE connections */
  	{ "HiFi Playback", NULL, "ssp0 Tx" }, diff --git

a/sound/soc/intel/boards/kbl_da7219_max98927.c
b/sound/soc/intel/boards/kbl_da7219_max98927.c
index cc9a2509ace2..e8dc291b1749 100644

sound/soc/intel/boards/kbl_da7219_max98927.c +0 -0
@@ -112,7 +112,9 @@ static const struct snd_soc_dapm_widget

kabylake_widgets[] = {

sound/soc/intel/boards/kbl_da7219_max98927.c static const struct snd_soc_dapm_widget kabylake_widgets[] = {

Quoted 9 lines
sound/soc/intel/boards/kbl_da7219_max98927.c +3 -1
  	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),
  	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
  			platform_clock_control, SND_SOC_DAPM_PRE_PMU

|

sound/soc/intel/boards/kbl_da7219_max98927.c static const struct snd_soc_dapm_route

Quoted 2 lines
sound/soc/intel/boards/kbl_da7219_max98927.c +0 -0
  			SND_SOC_DAPM_POST_PMD),
@@ -126,8 +128,9 @@ static const struct snd_soc_dapm_route

kabylake_map[] = {

sound/soc/intel/boards/kbl_rt5663_max98927.c static const struct snd_soc_dapm_route

Quoted 17 lines
sound/soc/intel/boards/kbl_da7219_max98927.c +3 -2
  	/* other jacks */
  	{ "DMic", NULL, "SoC DMIC" },
 
-	{ "HDMI", NULL, "hif5 Output" },
-	{ "DP", NULL, "hif6 Output" },
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
 
  	/* CODEC BE connections */
  	{ "Left HiFi Playback", NULL, "ssp0 Tx" }, diff --git

a/sound/soc/intel/boards/kbl_rt5663_max98927.c
b/sound/soc/intel/boards/kbl_rt5663_max98927.c
index 9a4b3d0973f6..cb7990823d35 100644

sound/soc/intel/boards/kbl_rt5663_max98927.c +0 -0
@@ -151,6 +151,10 @@ static const struct snd_soc_dapm_route

kabylake_map[] = {

sound/soc/intel/boards/kbl_rt5663_max98927.c static const struct snd_soc_dapm_route kabylake_map[] = { · line 160

Quoted 10 lines
sound/soc/intel/boards/kbl_rt5663_max98927.c +4 -0
  	{ "IN1N", NULL, "Headset Mic" },
  	{ "DMic", NULL, "SoC DMIC" },
 
+	{"HDMI1", NULL, "hif5-0 Output"},
+	{"HDMI2", NULL, "hif6-0 Output"},
+	{"HDMI3", NULL, "hif7-0 Output"},
+
  	/* CODEC BE connections */
  	{ "Left HiFi Playback", NULL, "ssp0 Tx" },
  	{ "Right HiFi Playback", NULL, "ssp0 Tx" },

What about the other routing table?

static const struct snd_soc_dapm_widget kabylake_5663_widgets[] = {
	SND_SOC_DAPM_HP("Headphone Jack", NULL),
	SND_SOC_DAPM_MIC("Headset Mic", NULL),
	SND_SOC_DAPM_SPK("DP", NULL),
	SND_SOC_DAPM_SPK("HDMI", NULL),
static const struct snd_soc_dapm_route kabylake_5663_map[] = {
	{ "Headphone Jack", NULL, "Platform Clock" },
	{ "Headphone Jack", NULL, "HPOL" },
	{ "Headphone Jack", NULL, "HPOR" },

	/* other jacks */
	{ "Headset Mic", NULL, "Platform Clock" },
	{ "IN1P", NULL, "Headset Mic" },
	{ "IN1N", NULL, "Headset Mic" },

	{ "HDMI", NULL, "hif5 Output" },
	{ "DP", NULL, "hif6 Output" },
Quoted 1 line

it'd be good to be consistent, wouldn't it?

[Gopal, Vamshi Krishna] yes , my bad I missed the other route table, updated in v3

#4 lore raw

PATCH v2 2/2 ASoc: Intel: board: add BE DAI link for WoV

In reply to [email protected]

From: Mac Chiang <[email protected]>

create dai link in kbl_da7219_max98357a driver for wake on voice functionality.

changes picked from broonie's tree
commit 0c7941a63a0f
("ASoC: Intel: Skylake: Use refcap device for mono recording") commit 2154be362c90
("ASoc: Intel: boards: Add WOV as sink for nau88l25_ssm4567 machine")

---
 sound/soc/intel/boards/kbl_da7219_max98357a.c | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
sound/soc/intel/boards/kbl_da7219_max98357a.c +48 -0
index 5c371bb01313..534ee111e6b2 100644
@@ -44,6 +44,7 @@ struct kbl_codec_private {
 enum {
 	KBL_DPCM_AUDIO_PB = 0,
 	KBL_DPCM_AUDIO_CP,
+	KBL_DPCM_AUDIO_REF_CP,
 	KBL_DPCM_AUDIO_DMIC_CP,
 	KBL_DPCM_AUDIO_HDMI1_PB,
 	KBL_DPCM_AUDIO_HDMI2_PB,
@@ -339,12 +340,49 @@ static struct snd_soc_ops kabylake_dmic_ops = {
 	.startup = kabylake_dmic_startup,
 };
 
+static unsigned int rates_16000[] = {
+        16000,
+};
+
+static const struct snd_pcm_hw_constraint_list constraints_16000 = {
+        .count = ARRAY_SIZE(rates_16000),
+        .list  = rates_16000,
+};
+
+static const unsigned int ch_mono[] = {
+	1,
+};
+
+static const struct snd_pcm_hw_constraint_list constraints_refcap = {
+	.count = ARRAY_SIZE(ch_mono),
+	.list  = ch_mono,
+};
+
+static int kabylake_refcap_startup(struct snd_pcm_substream *substream)
+{
+	substream->runtime->hw.channels_max = 1;
+	snd_pcm_hw_constraint_list(substream->runtime, 0,
+					SNDRV_PCM_HW_PARAM_CHANNELS,
+					&constraints_refcap);
+
+	return snd_pcm_hw_constraint_list(substream->runtime, 0,
+					SNDRV_PCM_HW_PARAM_RATE,
+					&constraints_16000);
+}
+
+static struct snd_soc_ops skylake_refcap_ops = {
+	.startup = kabylake_refcap_startup,
+};
+
 SND_SOC_DAILINK_DEF(dummy,
 	DAILINK_COMP_ARRAY(COMP_DUMMY()));
 
 SND_SOC_DAILINK_DEF(system,
 	DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
 
+SND_SOC_DAILINK_DEF(reference,
+	DAILINK_COMP_ARRAY(COMP_CPU("Reference Pin")));
+
 SND_SOC_DAILINK_DEF(dmic,
 	DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin")));
 
@@ -419,6 +457,16 @@ static struct snd_soc_dai_link kabylake_dais[] = {
 		.ops = &kabylake_da7219_fe_ops,
 		SND_SOC_DAILINK_REG(system, dummy, platform),
 	},
+	[KBL_DPCM_AUDIO_REF_CP] = {
+		.name = "Kbl Audio Reference cap",
+		.stream_name = "Wake on Voice",
+		.init = NULL,
+		.dpcm_capture = 1,
+		.nonatomic = 1,
+		.dynamic = 1,
+		.ops = &skylake_refcap_ops,
+		SND_SOC_DAILINK_REG(reference, dummy, platform),
+	},
 	[KBL_DPCM_AUDIO_DMIC_CP] = {
 		.name = "Kbl Audio DMIC cap",
 		.stream_name = "dmiccap",
Signature · 1 line
2.17.1