ASoC: mediatek: mt2701-wm8960: 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:07:57 +09:00 committed by Mark Brown
parent 9ded5f7111
commit b664e06d53
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 22 additions and 12 deletions

View File

@ -44,41 +44,51 @@ static struct snd_soc_ops mt2701_wm8960_be_ops = {
.hw_params = mt2701_wm8960_be_ops_hw_params
};
SND_SOC_DAILINK_DEFS(playback,
DAILINK_COMP_ARRAY(COMP_CPU("PCMO0")),
DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(capture,
DAILINK_COMP_ARRAY(COMP_CPU("PCM0")),
DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(codec,
DAILINK_COMP_ARRAY(COMP_CPU("I2S0")),
DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8960-hifi")),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
static struct snd_soc_dai_link mt2701_wm8960_dai_links[] = {
/* FE */
{
.name = "wm8960-playback",
.stream_name = "wm8960-playback",
.cpu_dai_name = "PCMO0",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.dynamic = 1,
.dpcm_playback = 1,
SND_SOC_DAILINK_REG(playback),
},
{
.name = "wm8960-capture",
.stream_name = "wm8960-capture",
.cpu_dai_name = "PCM0",
.codec_name = "snd-soc-dummy",
.codec_dai_name = "snd-soc-dummy-dai",
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.dynamic = 1,
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(capture),
},
/* BE */
{
.name = "wm8960-codec",
.cpu_dai_name = "I2S0",
.no_pcm = 1,
.codec_dai_name = "wm8960-hifi",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS
| SND_SOC_DAIFMT_GATED,
.ops = &mt2701_wm8960_be_ops,
.dpcm_playback = 1,
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(codec),
},
};
@ -107,9 +117,9 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
return -EINVAL;
}
for_each_card_prelinks(card, i, dai_link) {
if (dai_link->platform_name)
if (dai_link->platforms->name)
continue;
dai_link->platform_of_node = platform_node;
dai_link->platforms->of_node = platform_node;
}
card->dev = &pdev->dev;
@ -122,9 +132,9 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
return -EINVAL;
}
for_each_card_prelinks(card, i, dai_link) {
if (dai_link->codec_name)
if (dai_link->codecs->name)
continue;
dai_link->codec_of_node = codec_node;
dai_link->codecs->of_node = codec_node;
}
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");