Commit f78bf2c9 authored by Dragan Simic's avatar Dragan Simic Committed by Mark Brown

ASoC: pcm: perform power-down delay checks a bit faster

When checking whether the power-down delay should be ignored for a specific
PCM runtime, there's no need to keep going through all DAI link components
after any of them is found to be configured to use the power-down delay.

While there, fix a small typo in one of the comment blocks.
Signed-off-by: default avatarDragan Simic <dsimic@manjaro.org>
Link: https://msgid.link/r/90ae761a5b99640ece48363a7099ac2cf402bd37.1712684592.git.dsimic@manjaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 56437a56
...@@ -315,23 +315,24 @@ EXPORT_SYMBOL_GPL(snd_soc_runtime_action); ...@@ -315,23 +315,24 @@ EXPORT_SYMBOL_GPL(snd_soc_runtime_action);
* @rtd: The ASoC PCM runtime that should be checked. * @rtd: The ASoC PCM runtime that should be checked.
* *
* This function checks whether the power down delay should be ignored for a * This function checks whether the power down delay should be ignored for a
* specific PCM runtime. Returns true if the delay is 0, if it the DAI link has * specific PCM runtime. Returns true if the delay is 0, if the DAI link has
* been configured to ignore the delay, or if none of the components benefits * been configured to ignore the delay, or if none of the components benefits
* from having the delay. * from having the delay.
*/ */
bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_component *component; struct snd_soc_component *component;
bool ignore = true;
int i; int i;
if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time)
return true; return true;
for_each_rtd_components(rtd, i, component) for_each_rtd_components(rtd, i, component)
ignore &= !component->driver->use_pmdown_time; if (component->driver->use_pmdown_time)
/* No need to go through all components */
return false;
return ignore; return true;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment