diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2016-03-02 09:49:06 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-03-04 23:46:06 -0500 |
commit | 05f5afd3f0d915537b67d3cfcb464e6836a65caf (patch) | |
tree | a3da3ee362a5827ee5474f23b9c502816fe56328 | |
parent | 0c71367d35115a7eb24483ffce2fad74f77dc4d0 (diff) |
ASoC: mediatek: address dai link array entries by enum
This should be more robust to future changes than adressing
array entries by index number.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/mediatek/mt8173-rt5650-rt5676.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sound/soc/mediatek/mt8173-rt5650-rt5676.c b/sound/soc/mediatek/mt8173-rt5650-rt5676.c index 50ba538eccb3..5c4c58c69c51 100644 --- a/sound/soc/mediatek/mt8173-rt5650-rt5676.c +++ b/sound/soc/mediatek/mt8173-rt5650-rt5676.c | |||
@@ -131,10 +131,17 @@ static struct snd_soc_dai_link_component mt8173_rt5650_rt5676_codecs[] = { | |||
131 | }, | 131 | }, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | enum { | ||
135 | DAI_LINK_PLAYBACK, | ||
136 | DAI_LINK_CAPTURE, | ||
137 | DAI_LINK_CODEC_I2S, | ||
138 | DAI_LINK_INTERCODEC | ||
139 | }; | ||
140 | |||
134 | /* Digital audio interface glue - connects codec <---> CPU */ | 141 | /* Digital audio interface glue - connects codec <---> CPU */ |
135 | static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { | 142 | static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { |
136 | /* Front End DAI links */ | 143 | /* Front End DAI links */ |
137 | { | 144 | [DAI_LINK_PLAYBACK] = { |
138 | .name = "rt5650_rt5676 Playback", | 145 | .name = "rt5650_rt5676 Playback", |
139 | .stream_name = "rt5650_rt5676 Playback", | 146 | .stream_name = "rt5650_rt5676 Playback", |
140 | .cpu_dai_name = "DL1", | 147 | .cpu_dai_name = "DL1", |
@@ -144,7 +151,7 @@ static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { | |||
144 | .dynamic = 1, | 151 | .dynamic = 1, |
145 | .dpcm_playback = 1, | 152 | .dpcm_playback = 1, |
146 | }, | 153 | }, |
147 | { | 154 | [DAI_LINK_CAPTURE] = { |
148 | .name = "rt5650_rt5676 Capture", | 155 | .name = "rt5650_rt5676 Capture", |
149 | .stream_name = "rt5650_rt5676 Capture", | 156 | .stream_name = "rt5650_rt5676 Capture", |
150 | .cpu_dai_name = "VUL", | 157 | .cpu_dai_name = "VUL", |
@@ -156,7 +163,7 @@ static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { | |||
156 | }, | 163 | }, |
157 | 164 | ||
158 | /* Back End DAI links */ | 165 | /* Back End DAI links */ |
159 | { | 166 | [DAI_LINK_CODEC_I2S] = { |
160 | .name = "Codec", | 167 | .name = "Codec", |
161 | .cpu_dai_name = "I2S", | 168 | .cpu_dai_name = "I2S", |
162 | .no_pcm = 1, | 169 | .no_pcm = 1, |
@@ -170,7 +177,8 @@ static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { | |||
170 | .dpcm_playback = 1, | 177 | .dpcm_playback = 1, |
171 | .dpcm_capture = 1, | 178 | .dpcm_capture = 1, |
172 | }, | 179 | }, |
173 | { /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */ | 180 | /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */ |
181 | [DAI_LINK_INTERCODEC] = { | ||
174 | .name = "rt5650_rt5676 intercodec", | 182 | .name = "rt5650_rt5676 intercodec", |
175 | .stream_name = "rt5650_rt5676 intercodec", | 183 | .stream_name = "rt5650_rt5676 intercodec", |
176 | .cpu_dai_name = "snd-soc-dummy-dai", | 184 | .cpu_dai_name = "snd-soc-dummy-dai", |
@@ -240,7 +248,7 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev) | |||
240 | mt8173_rt5650_rt5676_codec_conf[0].of_node = | 248 | mt8173_rt5650_rt5676_codec_conf[0].of_node = |
241 | mt8173_rt5650_rt5676_codecs[1].of_node; | 249 | mt8173_rt5650_rt5676_codecs[1].of_node; |
242 | 250 | ||
243 | mt8173_rt5650_rt5676_dais[3].codec_of_node = | 251 | mt8173_rt5650_rt5676_dais[DAI_LINK_INTERCODEC].codec_of_node = |
244 | mt8173_rt5650_rt5676_codecs[1].of_node; | 252 | mt8173_rt5650_rt5676_codecs[1].of_node; |
245 | 253 | ||
246 | card->dev = &pdev->dev; | 254 | card->dev = &pdev->dev; |