Commit fbb16563 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: snd_soc_component_driver has pmdown_time

Current snd_soc_runtime_ignore_pmdown_time() tallys all Codec and
CPU's "ignore_pmdown_time". Now, CPU (= via compoent)
ignore_pmdown_time is fixed as "true". Codec's one is copied from Codec
driver. This means Codec side default is "false".

Current all Codec driver will be replaced into Component, thus, we can
use for_each_rtdcom() for this totalization. This patch adds new
"pmdown_time" on Component driver. Its inverted value will be used
for this "ignore" totalizaton.

Of course all existing Component driver doesn't have its settings now,
thus, all existing "pmdown_time" is "false". This means all
Components will ignore pmdown time. This is current CPU behavior.
To keep compatibility, snd_soc_runtime_ignore_pmdown_time() totalize
Component's inverted "pmdown_time" (= total will be true) and
Codec's "ignore_pmdown_time" (= depends on Codec driver settings).
Because It is using AND operation, its result is based on Codec driver
settings only.
This means this operation can keep compatibility and doesn't have
nonconformity.

When we replace Codec to Component, the driver which has
".ignore_pmdown_time = true" will be just removed,
and the driver which doesn't have it will have new
".pmdown_time = true".
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9e7e3738
...@@ -836,6 +836,7 @@ struct snd_soc_component_driver { ...@@ -836,6 +836,7 @@ struct snd_soc_component_driver {
/* bits */ /* bits */
unsigned int idle_bias_on:1; unsigned int idle_bias_on:1;
unsigned int suspend_bias_off:1; unsigned int suspend_bias_off:1;
unsigned int pmdown_time:1; /* care pmdown_time at stop */
}; };
struct snd_soc_component { struct snd_soc_component {
......
...@@ -133,16 +133,25 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream) ...@@ -133,16 +133,25 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream)
*/ */
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_rtdcom_list *rtdcom;
struct snd_soc_component *component;
int i; int i;
bool ignore = true; bool ignore = true;
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_rtdcom(rtd, rtdcom) {
component = rtdcom->component;
ignore &= !component->driver->pmdown_time;
}
/* this will be removed */
for (i = 0; i < rtd->num_codecs; i++) for (i = 0; i < rtd->num_codecs; i++)
ignore &= rtd->codec_dais[i]->component->ignore_pmdown_time; ignore &= rtd->codec_dais[i]->component->ignore_pmdown_time;
return rtd->cpu_dai->component->ignore_pmdown_time && ignore; return ignore;
} }
/** /**
......
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