ASoC: Intel: broadwell: use modern dai_link style
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 6 Jun 2019 04:19:40 +0000 (13:19 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 6 Jun 2019 21:11:41 +0000 (22:11 +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/intel/boards/broadwell.c

index 0f18f8964f51fb98361466595cce8a32514863b3..fd8d88550d0bd919e4b56acd8b2adf5b7b2c9cde 100644 (file)
@@ -152,67 +152,72 @@ static int broadwell_rtd_init(struct snd_soc_pcm_runtime *rtd)
 }
 #endif
 
+SND_SOC_DAILINK_DEF(system,
+       DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
+
+SND_SOC_DAILINK_DEF(offload0,
+       DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin")));
+
+SND_SOC_DAILINK_DEF(offload1,
+       DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin")));
+
+SND_SOC_DAILINK_DEF(loopback,
+       DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin")));
+
+SND_SOC_DAILINK_DEF(dummy,
+       DAILINK_COMP_ARRAY(COMP_DUMMY()));
+
+SND_SOC_DAILINK_DEF(platform,
+       DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio")));
+
+SND_SOC_DAILINK_DEF(codec,
+       DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", "rt286-aif1")));
+
 /* broadwell digital audio interface glue - connects codec <--> CPU */
 static struct snd_soc_dai_link broadwell_rt286_dais[] = {
        /* Front End DAI links */
        {
                .name = "System PCM",
                .stream_name = "System Playback/Capture",
-               .cpu_dai_name = "System Pin",
-               .platform_name = "haswell-pcm-audio",
                .dynamic = 1,
-               .codec_name = "snd-soc-dummy",
-               .codec_dai_name = "snd-soc-dummy-dai",
 #if !IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
                .init = broadwell_rtd_init,
 #endif
                .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
                .dpcm_playback = 1,
                .dpcm_capture = 1,
+               SND_SOC_DAILINK_REG(system, dummy, platform),
        },
        {
                .name = "Offload0",
                .stream_name = "Offload0 Playback",
-               .cpu_dai_name = "Offload0 Pin",
-               .platform_name = "haswell-pcm-audio",
                .dynamic = 1,
-               .codec_name = "snd-soc-dummy",
-               .codec_dai_name = "snd-soc-dummy-dai",
                .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
                .dpcm_playback = 1,
+               SND_SOC_DAILINK_REG(offload0, dummy, platform),
        },
        {
                .name = "Offload1",
                .stream_name = "Offload1 Playback",
-               .cpu_dai_name = "Offload1 Pin",
-               .platform_name = "haswell-pcm-audio",
                .dynamic = 1,
-               .codec_name = "snd-soc-dummy",
-               .codec_dai_name = "snd-soc-dummy-dai",
                .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
                .dpcm_playback = 1,
+               SND_SOC_DAILINK_REG(offload1, dummy, platform),
        },
        {
                .name = "Loopback PCM",
                .stream_name = "Loopback",
-               .cpu_dai_name = "Loopback Pin",
-               .platform_name = "haswell-pcm-audio",
                .dynamic = 1,
-               .codec_name = "snd-soc-dummy",
-               .codec_dai_name = "snd-soc-dummy-dai",
                .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
                .dpcm_capture = 1,
+               SND_SOC_DAILINK_REG(loopback, dummy, platform),
        },
        /* Back End DAI links */
        {
                /* SSP0 - Codec */
                .name = "Codec",
                .id = 0,
-               .cpu_dai_name = "snd-soc-dummy-dai",
-               .platform_name = "snd-soc-dummy",
                .no_pcm = 1,
-               .codec_name = "i2c-INT343A:00",
-               .codec_dai_name = "rt286-aif1",
                .init = broadwell_rt286_codec_init,
                .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
                        SND_SOC_DAIFMT_CBS_CFS,
@@ -222,6 +227,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
                .ops = &broadwell_rt286_ops,
                .dpcm_playback = 1,
                .dpcm_capture = 1,
+               SND_SOC_DAILINK_REG(dummy, codec, dummy),
        },
 };