aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2017-10-10 21:38:08 -0400
committerMark Brown <broonie@kernel.org>2017-10-23 05:28:02 -0400
commitfbb16563c6c2b7fc4944adc49f93c1dc6fe25770 (patch)
tree24a32253119dbcd9eb34ece70d54107afd23316f
parent9e7e3738ab0e908c72dae4ff45481a0568924e62 (diff)
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc.h1
-rw-r--r--sound/soc/soc-pcm.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index ae0a27fdc016..44fab951b686 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -836,6 +836,7 @@ struct snd_soc_component_driver {
836 /* bits */ 836 /* bits */
837 unsigned int idle_bias_on:1; 837 unsigned int idle_bias_on:1;
838 unsigned int suspend_bias_off:1; 838 unsigned int suspend_bias_off:1;
839 unsigned int pmdown_time:1; /* care pmdown_time at stop */
839}; 840};
840 841
841struct snd_soc_component { 842struct snd_soc_component {
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index daaa670ee9b7..8075856668c2 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -133,16 +133,25 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream)
133 */ 133 */
134bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) 134bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd)
135{ 135{
136 struct snd_soc_rtdcom_list *rtdcom;
137 struct snd_soc_component *component;
136 int i; 138 int i;
137 bool ignore = true; 139 bool ignore = true;
138 140
139 if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) 141 if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time)
140 return true; 142 return true;
141 143
144 for_each_rtdcom(rtd, rtdcom) {
145 component = rtdcom->component;
146
147 ignore &= !component->driver->pmdown_time;
148 }
149
150 /* this will be removed */
142 for (i = 0; i < rtd->num_codecs; i++) 151 for (i = 0; i < rtd->num_codecs; i++)
143 ignore &= rtd->codec_dais[i]->component->ignore_pmdown_time; 152 ignore &= rtd->codec_dais[i]->component->ignore_pmdown_time;
144 153
145 return rtd->cpu_dai->component->ignore_pmdown_time && ignore; 154 return ignore;
146} 155}
147 156
148/** 157/**