Skip to content

Commit a226d08

Browse files
committed
ASoC: Intel: avs: PCM code cleanup
Merge series from Cezary Rojewski <[email protected]>: A set of changes that aims to improve readability of cohesiveness of the pcm code for the avs-driver. Start off with a change that synchronizes DAI open/close - DAIs are started up in ascending order yet their shutdown does not follow the scheme - it is done in the ascending order too, rather than desceding one. This patch is a dependency for the next one in line. To align the HDAudio DAI startup/shutdown with the non-HDAudio equivalents, relocate the code from component to DAI. The reason above is a dependency stems from codec driver requirements - HDAudio code found in sound/pci/hda/ expects substream->runtime->private_data to point to a valid stream (HOST) pointer. With the hard part done, the follow up changes update the existing code to reduce it is complexity - removal of duplicates, renaming of ambiguous functions and adding new fields to DAI-data object so that the number of local variables and casts is reduced.
2 parents 228132b + e85e75b commit a226d08

File tree

3 files changed

+117
-139
lines changed

3 files changed

+117
-139
lines changed

include/sound/soc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,10 @@ struct snd_soc_pcm_runtime {
12351235
((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \
12361236
((dai) = (rtd)->dais[i]); \
12371237
(i)++)
1238+
#define for_each_rtd_dais_reverse(rtd, i, dai) \
1239+
for ((i) = (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs - 1; \
1240+
(i) >= 0 && ((dai) = (rtd)->dais[i]); \
1241+
(i)--)
12381242
#define for_each_rtd_ch_maps(rtd, i, ch_maps) for_each_link_ch_maps(rtd->dai_link, i, ch_maps)
12391243

12401244
void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);

0 commit comments

Comments
 (0)