Re: [PATCH 2/2] ASoc: Intel: board: add BE DAI link for WoV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/24/21 12:52 PM, vamshi.krishna.gopal@xxxxxxxxx wrote:
From: Mac Chiang <mac.chiang@xxxxxxxxx>

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")

Signed-off-by: Mac Chiang <mac.chiang@xxxxxxxxx>
Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@xxxxxxxxx>
Tested-by: Kaiyen Chang <kaiyen.chang@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Tested-by: luke yang <luke_yang@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Tested-by: Grace Kao <grace.kao@xxxxxxxxx>
Tested-by: Kaiyen Chang <kaiyen.chang@xxxxxxxxx>
Reviewed-by: Cheng-Yi Chiang <cychiang@xxxxxxxxxxxx>
---
  sound/soc/intel/boards/kbl_da7219_max98357a.c | 35 +++++++++++++++++++
  1 file changed, 35 insertions(+)

diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c
index 1d6b2855874d..c9d83eebf4a8 100644
--- a/sound/soc/intel/boards/kbl_da7219_max98357a.c
+++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c
@@ -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,
@@ -335,12 +336,36 @@ static struct snd_soc_ops kabylake_dmic_ops = {
  	.startup = kabylake_dmic_startup,
  };
+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 skylaye_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")));
@@ -415,6 +440,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",

Does anyone have a clear definition of what "REF_CP" and "reference" mean? it's not echo reference since there is a separate entry for this, so not sure what the term means.

Half of the SKL/KBL drivers seem to use this FE for "Wake on Voice" and the other half use it for 'Refcap', this doesn't look very consistent.

+		.init = NULL,
+		.dpcm_capture = 1,
+		.nonatomic = 1,
+		.dynamic = 1,
+		.ops = &skylaye_refcap_ops,
+		SND_SOC_DAILINK_REG(reference, dummy, platform),
+	},
  	[KBL_DPCM_AUDIO_DMIC_CP] = {
  		.name = "Kbl Audio DMIC cap",
  		.stream_name = "dmiccap",




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux