diff options
author | Mark Brown <broonie@kernel.org> | 2024-04-30 17:35:00 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-04-30 17:35:00 +0300 |
commit | a226d08a362f3ebc09b0fa3105282984155eeab4 (patch) | |
tree | 596b4494e49ffbcc587c371a9ac1008e577a7489 /include/sound | |
parent | 228132b4d848cf4318f7df8b9c0ad39e22ca6039 (diff) | |
parent | e85e75b67993c1fb0c80306783c31266261170d4 (diff) | |
download | linux-a226d08a362f3ebc09b0fa3105282984155eeab4.tar.xz |
ASoC: Intel: avs: PCM code cleanup
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
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.
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 2a1b6c198547..8aa6ddb7ee1e 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1235,6 +1235,10 @@ struct snd_soc_pcm_runtime { ((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \ ((dai) = (rtd)->dais[i]); \ (i)++) +#define for_each_rtd_dais_reverse(rtd, i, dai) \ + for ((i) = (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs - 1; \ + (i) >= 0 && ((dai) = (rtd)->dais[i]); \ + (i)--) #define for_each_rtd_ch_maps(rtd, i, ch_maps) for_each_link_ch_maps(rtd->dai_link, i, ch_maps) void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd); |