summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-06-06 00:07:57 -0400
committerMark Brown <broonie@kernel.org>2019-06-06 16:25:12 -0400
commitb664e06d530eba6c5f2f1a9571c2bc78e9fb783f (patch)
treee4893578b2fc4f371114b247f513d353916cdd1a /sound/soc/mediatek
parent9ded5f71114bcf935051db12f0ad1abe4ef497b1 (diff)
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>
Diffstat (limited to 'sound/soc/mediatek')
-rw-r--r--sound/soc/mediatek/mt2701/mt2701-wm8960.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/sound/soc/mediatek/mt2701/mt2701-wm8960.c b/sound/soc/mediatek/mt2701/mt2701-wm8960.c
index 6bc1d3d58e64..8c4c89e4c616 100644
--- a/sound/soc/mediatek/mt2701/mt2701-wm8960.c
+++ b/sound/soc/mediatek/mt2701/mt2701-wm8960.c
@@ -44,41 +44,51 @@ static struct snd_soc_ops mt2701_wm8960_be_ops = {
44 .hw_params = mt2701_wm8960_be_ops_hw_params 44 .hw_params = mt2701_wm8960_be_ops_hw_params
45}; 45};
46 46
47SND_SOC_DAILINK_DEFS(playback,
48 DAILINK_COMP_ARRAY(COMP_CPU("PCMO0")),
49 DAILINK_COMP_ARRAY(COMP_DUMMY()),
50 DAILINK_COMP_ARRAY(COMP_EMPTY()));
51
52SND_SOC_DAILINK_DEFS(capture,
53 DAILINK_COMP_ARRAY(COMP_CPU("PCM0")),
54 DAILINK_COMP_ARRAY(COMP_DUMMY()),
55 DAILINK_COMP_ARRAY(COMP_EMPTY()));
56
57SND_SOC_DAILINK_DEFS(codec,
58 DAILINK_COMP_ARRAY(COMP_CPU("I2S0")),
59 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8960-hifi")),
60 DAILINK_COMP_ARRAY(COMP_EMPTY()));
61
47static struct snd_soc_dai_link mt2701_wm8960_dai_links[] = { 62static struct snd_soc_dai_link mt2701_wm8960_dai_links[] = {
48 /* FE */ 63 /* FE */
49 { 64 {
50 .name = "wm8960-playback", 65 .name = "wm8960-playback",
51 .stream_name = "wm8960-playback", 66 .stream_name = "wm8960-playback",
52 .cpu_dai_name = "PCMO0",
53 .codec_name = "snd-soc-dummy",
54 .codec_dai_name = "snd-soc-dummy-dai",
55 .trigger = {SND_SOC_DPCM_TRIGGER_POST, 67 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
56 SND_SOC_DPCM_TRIGGER_POST}, 68 SND_SOC_DPCM_TRIGGER_POST},
57 .dynamic = 1, 69 .dynamic = 1,
58 .dpcm_playback = 1, 70 .dpcm_playback = 1,
71 SND_SOC_DAILINK_REG(playback),
59 }, 72 },
60 { 73 {
61 .name = "wm8960-capture", 74 .name = "wm8960-capture",
62 .stream_name = "wm8960-capture", 75 .stream_name = "wm8960-capture",
63 .cpu_dai_name = "PCM0",
64 .codec_name = "snd-soc-dummy",
65 .codec_dai_name = "snd-soc-dummy-dai",
66 .trigger = {SND_SOC_DPCM_TRIGGER_POST, 76 .trigger = {SND_SOC_DPCM_TRIGGER_POST,
67 SND_SOC_DPCM_TRIGGER_POST}, 77 SND_SOC_DPCM_TRIGGER_POST},
68 .dynamic = 1, 78 .dynamic = 1,
69 .dpcm_capture = 1, 79 .dpcm_capture = 1,
80 SND_SOC_DAILINK_REG(capture),
70 }, 81 },
71 /* BE */ 82 /* BE */
72 { 83 {
73 .name = "wm8960-codec", 84 .name = "wm8960-codec",
74 .cpu_dai_name = "I2S0",
75 .no_pcm = 1, 85 .no_pcm = 1,
76 .codec_dai_name = "wm8960-hifi",
77 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS 86 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS
78 | SND_SOC_DAIFMT_GATED, 87 | SND_SOC_DAIFMT_GATED,
79 .ops = &mt2701_wm8960_be_ops, 88 .ops = &mt2701_wm8960_be_ops,
80 .dpcm_playback = 1, 89 .dpcm_playback = 1,
81 .dpcm_capture = 1, 90 .dpcm_capture = 1,
91 SND_SOC_DAILINK_REG(codec),
82 }, 92 },
83}; 93};
84 94
@@ -107,9 +117,9 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
107 return -EINVAL; 117 return -EINVAL;
108 } 118 }
109 for_each_card_prelinks(card, i, dai_link) { 119 for_each_card_prelinks(card, i, dai_link) {
110 if (dai_link->platform_name) 120 if (dai_link->platforms->name)
111 continue; 121 continue;
112 dai_link->platform_of_node = platform_node; 122 dai_link->platforms->of_node = platform_node;
113 } 123 }
114 124
115 card->dev = &pdev->dev; 125 card->dev = &pdev->dev;
@@ -122,9 +132,9 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev)
122 return -EINVAL; 132 return -EINVAL;
123 } 133 }
124 for_each_card_prelinks(card, i, dai_link) { 134 for_each_card_prelinks(card, i, dai_link) {
125 if (dai_link->codec_name) 135 if (dai_link->codecs->name)
126 continue; 136 continue;
127 dai_link->codec_of_node = codec_node; 137 dai_link->codecs->of_node = codec_node;
128 } 138 }
129 139
130 ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); 140 ret = snd_soc_of_parse_audio_routing(card, "audio-routing");