ASoC: Intel: glk_rt5682_max98357a: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2019-06-06 13:22:09 +09:00 committed by Mark Brown
parent a78959f407
commit 02c31963d1
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 77 additions and 60 deletions

View File

@ -317,152 +317,180 @@ static const struct snd_soc_ops geminilake_refcap_ops = {
.startup = geminilake_refcap_startup, .startup = geminilake_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(system2,
DAILINK_COMP_ARRAY(COMP_CPU("System Pin2")));
SND_SOC_DAILINK_DEF(echoref,
DAILINK_COMP_ARRAY(COMP_CPU("Echoref 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")));
SND_SOC_DAILINK_DEF(hdmi1,
DAILINK_COMP_ARRAY(COMP_CPU("HDMI1 Pin")));
SND_SOC_DAILINK_DEF(hdmi2,
DAILINK_COMP_ARRAY(COMP_CPU("HDMI2 Pin")));
SND_SOC_DAILINK_DEF(hdmi3,
DAILINK_COMP_ARRAY(COMP_CPU("HDMI3 Pin")));
SND_SOC_DAILINK_DEF(ssp1_pin,
DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin")));
SND_SOC_DAILINK_DEF(ssp1_codec,
DAILINK_COMP_ARRAY(COMP_CODEC(MAXIM_DEV0_NAME,
GLK_MAXIM_CODEC_DAI)));
SND_SOC_DAILINK_DEF(ssp2_pin,
DAILINK_COMP_ARRAY(COMP_CPU("SSP2 Pin")));
SND_SOC_DAILINK_DEF(ssp2_codec,
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00",
GLK_REALTEK_CODEC_DAI)));
SND_SOC_DAILINK_DEF(dmic_pin,
DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin")));
SND_SOC_DAILINK_DEF(dmic_codec,
DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
SND_SOC_DAILINK_DEF(idisp1_pin,
DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin")));
SND_SOC_DAILINK_DEF(idisp1_codec,
DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));
SND_SOC_DAILINK_DEF(idisp2_pin,
DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin")));
SND_SOC_DAILINK_DEF(idisp2_codec,
DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2")));
SND_SOC_DAILINK_DEF(idisp3_pin,
DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin")));
SND_SOC_DAILINK_DEF(idisp3_codec,
DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3")));
SND_SOC_DAILINK_DEF(platform,
DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:0e.0")));
/* geminilake digital audio interface glue - connects codec <--> CPU */ /* geminilake digital audio interface glue - connects codec <--> CPU */
static struct snd_soc_dai_link geminilake_dais[] = { static struct snd_soc_dai_link geminilake_dais[] = {
/* Front End DAI links */ /* Front End DAI links */
[GLK_DPCM_AUDIO_PB] = { [GLK_DPCM_AUDIO_PB] = {
.name = "Glk Audio Port", .name = "Glk Audio Port",
.stream_name = "Audio", .stream_name = "Audio",
.cpu_dai_name = "System Pin",
.platform_name = "0000:00:0e.0",
.dynamic = 1, .dynamic = 1,
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.nonatomic = 1, .nonatomic = 1,
.init = geminilake_rt5682_fe_init, .init = geminilake_rt5682_fe_init,
.trigger = { .trigger = {
SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.dpcm_playback = 1, .dpcm_playback = 1,
SND_SOC_DAILINK_REG(system, dummy, platform),
}, },
[GLK_DPCM_AUDIO_CP] = { [GLK_DPCM_AUDIO_CP] = {
.name = "Glk Audio Capture Port", .name = "Glk Audio Capture Port",
.stream_name = "Audio Record", .stream_name = "Audio Record",
.cpu_dai_name = "System Pin",
.platform_name = "0000:00:0e.0",
.dynamic = 1, .dynamic = 1,
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.nonatomic = 1, .nonatomic = 1,
.trigger = { .trigger = {
SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.dpcm_capture = 1, .dpcm_capture = 1,
SND_SOC_DAILINK_REG(system, dummy, platform),
}, },
[GLK_DPCM_AUDIO_HS_PB] = { [GLK_DPCM_AUDIO_HS_PB] = {
.name = "Glk Audio Headset Playback", .name = "Glk Audio Headset Playback",
.stream_name = "Headset Audio", .stream_name = "Headset Audio",
.cpu_dai_name = "System Pin2",
.platform_name = "0000:00:0e.0",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.dpcm_playback = 1, .dpcm_playback = 1,
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
SND_SOC_DAILINK_REG(system2, dummy, platform),
}, },
[GLK_DPCM_AUDIO_ECHO_REF_CP] = { [GLK_DPCM_AUDIO_ECHO_REF_CP] = {
.name = "Glk Audio Echo Reference cap", .name = "Glk Audio Echo Reference cap",
.stream_name = "Echoreference Capture", .stream_name = "Echoreference Capture",
.cpu_dai_name = "Echoref Pin",
.platform_name = "0000:00:0e.0",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.init = NULL, .init = NULL,
.capture_only = 1, .capture_only = 1,
.nonatomic = 1, .nonatomic = 1,
SND_SOC_DAILINK_REG(echoref, dummy, platform),
}, },
[GLK_DPCM_AUDIO_REF_CP] = { [GLK_DPCM_AUDIO_REF_CP] = {
.name = "Glk Audio Reference cap", .name = "Glk Audio Reference cap",
.stream_name = "Refcap", .stream_name = "Refcap",
.cpu_dai_name = "Reference Pin",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
.init = NULL, .init = NULL,
.dpcm_capture = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
.ops = &geminilake_refcap_ops, .ops = &geminilake_refcap_ops,
SND_SOC_DAILINK_REG(reference, dummy, platform),
}, },
[GLK_DPCM_AUDIO_DMIC_CP] = { [GLK_DPCM_AUDIO_DMIC_CP] = {
.name = "Glk Audio DMIC cap", .name = "Glk Audio DMIC cap",
.stream_name = "dmiccap", .stream_name = "dmiccap",
.cpu_dai_name = "DMIC Pin",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
.init = NULL, .init = NULL,
.dpcm_capture = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
.ops = &geminilake_dmic_ops, .ops = &geminilake_dmic_ops,
SND_SOC_DAILINK_REG(dmic, dummy, platform),
}, },
[GLK_DPCM_AUDIO_HDMI1_PB] = { [GLK_DPCM_AUDIO_HDMI1_PB] = {
.name = "Glk HDMI Port1", .name = "Glk HDMI Port1",
.stream_name = "Hdmi1", .stream_name = "Hdmi1",
.cpu_dai_name = "HDMI1 Pin",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
.dpcm_playback = 1, .dpcm_playback = 1,
.init = NULL, .init = NULL,
.trigger = { .trigger = {
SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
SND_SOC_DAILINK_REG(hdmi1, dummy, platform),
}, },
[GLK_DPCM_AUDIO_HDMI2_PB] = { [GLK_DPCM_AUDIO_HDMI2_PB] = {
.name = "Glk HDMI Port2", .name = "Glk HDMI Port2",
.stream_name = "Hdmi2", .stream_name = "Hdmi2",
.cpu_dai_name = "HDMI2 Pin",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
.dpcm_playback = 1, .dpcm_playback = 1,
.init = NULL, .init = NULL,
.trigger = { .trigger = {
SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
SND_SOC_DAILINK_REG(hdmi2, dummy, platform),
}, },
[GLK_DPCM_AUDIO_HDMI3_PB] = { [GLK_DPCM_AUDIO_HDMI3_PB] = {
.name = "Glk HDMI Port3", .name = "Glk HDMI Port3",
.stream_name = "Hdmi3", .stream_name = "Hdmi3",
.cpu_dai_name = "HDMI3 Pin",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
.trigger = { .trigger = {
SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.dpcm_playback = 1, .dpcm_playback = 1,
.init = NULL, .init = NULL,
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
SND_SOC_DAILINK_REG(hdmi3, dummy, platform),
}, },
/* Back End DAI links */ /* Back End DAI links */
{ {
/* SSP1 - Codec */ /* SSP1 - Codec */
.name = "SSP1-Codec", .name = "SSP1-Codec",
.id = 0, .id = 0,
.cpu_dai_name = "SSP1 Pin",
.platform_name = "0000:00:0e.0",
.no_pcm = 1, .no_pcm = 1,
.codec_name = MAXIM_DEV0_NAME,
.codec_dai_name = GLK_MAXIM_CODEC_DAI,
.dai_fmt = SND_SOC_DAIFMT_I2S | .dai_fmt = SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS, SND_SOC_DAIFMT_CBS_CFS,
.ignore_pmdown_time = 1, .ignore_pmdown_time = 1,
.be_hw_params_fixup = geminilake_ssp_fixup, .be_hw_params_fixup = geminilake_ssp_fixup,
.dpcm_playback = 1, .dpcm_playback = 1,
SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec, platform),
}, },
{ {
/* SSP2 - Codec */ /* SSP2 - Codec */
.name = "SSP2-Codec", .name = "SSP2-Codec",
.id = 1, .id = 1,
.cpu_dai_name = "SSP2 Pin",
.platform_name = "0000:00:0e.0",
.no_pcm = 1, .no_pcm = 1,
.codec_name = "i2c-10EC5682:00",
.codec_dai_name = GLK_REALTEK_CODEC_DAI,
.init = geminilake_rt5682_codec_init, .init = geminilake_rt5682_codec_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS, SND_SOC_DAIFMT_CBS_CFS,
@ -471,51 +499,40 @@ static struct snd_soc_dai_link geminilake_dais[] = {
.ops = &geminilake_rt5682_ops, .ops = &geminilake_rt5682_ops,
.dpcm_playback = 1, .dpcm_playback = 1,
.dpcm_capture = 1, .dpcm_capture = 1,
SND_SOC_DAILINK_REG(ssp2_pin, ssp2_codec, platform),
}, },
{ {
.name = "dmic01", .name = "dmic01",
.id = 2, .id = 2,
.cpu_dai_name = "DMIC01 Pin",
.codec_name = "dmic-codec",
.codec_dai_name = "dmic-hifi",
.platform_name = "0000:00:0e.0",
.ignore_suspend = 1, .ignore_suspend = 1,
.be_hw_params_fixup = geminilake_dmic_fixup, .be_hw_params_fixup = geminilake_dmic_fixup,
.dpcm_capture = 1, .dpcm_capture = 1,
.no_pcm = 1, .no_pcm = 1,
SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform),
}, },
{ {
.name = "iDisp1", .name = "iDisp1",
.id = 3, .id = 3,
.cpu_dai_name = "iDisp1 Pin",
.codec_name = "ehdaudio0D2",
.codec_dai_name = "intel-hdmi-hifi1",
.platform_name = "0000:00:0e.0",
.init = geminilake_hdmi_init, .init = geminilake_hdmi_init,
.dpcm_playback = 1, .dpcm_playback = 1,
.no_pcm = 1, .no_pcm = 1,
SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform),
}, },
{ {
.name = "iDisp2", .name = "iDisp2",
.id = 4, .id = 4,
.cpu_dai_name = "iDisp2 Pin",
.codec_name = "ehdaudio0D2",
.codec_dai_name = "intel-hdmi-hifi2",
.platform_name = "0000:00:0e.0",
.init = geminilake_hdmi_init, .init = geminilake_hdmi_init,
.dpcm_playback = 1, .dpcm_playback = 1,
.no_pcm = 1, .no_pcm = 1,
SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform),
}, },
{ {
.name = "iDisp3", .name = "iDisp3",
.id = 5, .id = 5,
.cpu_dai_name = "iDisp3 Pin",
.codec_name = "ehdaudio0D2",
.codec_dai_name = "intel-hdmi-hifi3",
.platform_name = "0000:00:0e.0",
.init = geminilake_hdmi_init, .init = geminilake_hdmi_init,
.dpcm_playback = 1, .dpcm_playback = 1,
.no_pcm = 1, .no_pcm = 1,
SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform),
}, },
}; };