Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Philipp Zabel and committed by
Mark Brown
05f5afd3 0c71367d

+13 -5
+13 -5
sound/soc/mediatek/mt8173-rt5650-rt5676.c
··· 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 141 /* Digital audio interface glue - connects codec <---> CPU */ 135 142 static struct snd_soc_dai_link mt8173_rt5650_rt5676_dais[] = { 136 143 /* Front End DAI links */ 137 - { 144 + [DAI_LINK_PLAYBACK] = { 138 145 .name = "rt5650_rt5676 Playback", 139 146 .stream_name = "rt5650_rt5676 Playback", 140 147 .cpu_dai_name = "DL1", ··· 151 144 .dynamic = 1, 152 145 .dpcm_playback = 1, 153 146 }, 154 - { 147 + [DAI_LINK_CAPTURE] = { 155 148 .name = "rt5650_rt5676 Capture", 156 149 .stream_name = "rt5650_rt5676 Capture", 157 150 .cpu_dai_name = "VUL", ··· 163 156 }, 164 157 165 158 /* Back End DAI links */ 166 - { 159 + [DAI_LINK_CODEC_I2S] = { 167 160 .name = "Codec", 168 161 .cpu_dai_name = "I2S", 169 162 .no_pcm = 1, ··· 177 170 .dpcm_playback = 1, 178 171 .dpcm_capture = 1, 179 172 }, 180 - { /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */ 173 + /* rt5676 <-> rt5650 intercodec link: Sets rt5676 I2S2 as master */ 174 + [DAI_LINK_INTERCODEC] = { 181 175 .name = "rt5650_rt5676 intercodec", 182 176 .stream_name = "rt5650_rt5676 intercodec", 183 177 .cpu_dai_name = "snd-soc-dummy-dai", ··· 248 240 mt8173_rt5650_rt5676_codec_conf[0].of_node = 249 241 mt8173_rt5650_rt5676_codecs[1].of_node; 250 242 251 - mt8173_rt5650_rt5676_dais[3].codec_of_node = 243 + mt8173_rt5650_rt5676_dais[DAI_LINK_INTERCODEC].codec_of_node = 252 244 mt8173_rt5650_rt5676_codecs[1].of_node; 253 245 254 246 card->dev = &pdev->dev;