mirror of https://gitee.com/openkylin/linux.git
ASoc: Intel: board: add BE DAI link for WoV
create dai link in kbl_da7219_max98357a driver for wake on voice functionality. changes picked from broonie's tree commit0c7941a63a
("ASoC: Intel: Skylake: Use refcap device for mono recording") commit2154be362c
("ASoc: Intel: boards: Add WOV as sink for nau88l25_ssm4567 machine") Signed-off-by: Mac Chiang <mac.chiang@intel.com> Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com> Tested-by: Kaiyen Chang <kaiyen.chang@intel.corp-partner.google.com> Tested-by: luke yang <luke_yang@compal.corp-partner.google.com> Tested-by: Grace Kao <grace.kao@intel.com> Tested-by: Kaiyen Chang <kaiyen.chang@intel.com> Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210405124835.71247-3-vamshi.krishna.gopal@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c7c19ec098
commit
74ed9e9bfb
|
@ -44,6 +44,7 @@ struct kbl_codec_private {
|
||||||
enum {
|
enum {
|
||||||
KBL_DPCM_AUDIO_PB = 0,
|
KBL_DPCM_AUDIO_PB = 0,
|
||||||
KBL_DPCM_AUDIO_CP,
|
KBL_DPCM_AUDIO_CP,
|
||||||
|
KBL_DPCM_AUDIO_REF_CP,
|
||||||
KBL_DPCM_AUDIO_DMIC_CP,
|
KBL_DPCM_AUDIO_DMIC_CP,
|
||||||
KBL_DPCM_AUDIO_HDMI1_PB,
|
KBL_DPCM_AUDIO_HDMI1_PB,
|
||||||
KBL_DPCM_AUDIO_HDMI2_PB,
|
KBL_DPCM_AUDIO_HDMI2_PB,
|
||||||
|
@ -338,12 +339,49 @@ static struct snd_soc_ops kabylake_dmic_ops = {
|
||||||
.startup = kabylake_dmic_startup,
|
.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,
|
SND_SOC_DAILINK_DEF(dummy,
|
||||||
DAILINK_COMP_ARRAY(COMP_DUMMY()));
|
DAILINK_COMP_ARRAY(COMP_DUMMY()));
|
||||||
|
|
||||||
SND_SOC_DAILINK_DEF(system,
|
SND_SOC_DAILINK_DEF(system,
|
||||||
DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
|
DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
|
||||||
|
|
||||||
|
SND_SOC_DAILINK_DEF(reference,
|
||||||
|
DAILINK_COMP_ARRAY(COMP_CPU("Reference Pin")));
|
||||||
|
|
||||||
SND_SOC_DAILINK_DEF(dmic,
|
SND_SOC_DAILINK_DEF(dmic,
|
||||||
DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin")));
|
DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin")));
|
||||||
|
|
||||||
|
@ -418,6 +456,16 @@ static struct snd_soc_dai_link kabylake_dais[] = {
|
||||||
.ops = &kabylake_da7219_fe_ops,
|
.ops = &kabylake_da7219_fe_ops,
|
||||||
SND_SOC_DAILINK_REG(system, dummy, platform),
|
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] = {
|
[KBL_DPCM_AUDIO_DMIC_CP] = {
|
||||||
.name = "Kbl Audio DMIC cap",
|
.name = "Kbl Audio DMIC cap",
|
||||||
.stream_name = "dmiccap",
|
.stream_name = "dmiccap",
|
||||||
|
|
Loading…
Reference in New Issue