ASoC: mediatek: mt2701-wm8960: use modern dai_link style
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 6 Jun 2019 04:07:57 +0000 (13:07 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 6 Jun 2019 20:25:12 +0000 (21:25 +0100)
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>
sound/soc/mediatek/mt2701/mt2701-wm8960.c

index 6bc1d3d58e6453b583c6bfaed9b22d2cd1e30ac6..8c4c89e4c616ff9e0f983258df349b07a9c167f4 100644 (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");