]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: Move ignore_pmdown_time from CODEC to component
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 5 Mar 2014 12:17:48 +0000 (13:17 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 6 Mar 2014 09:04:56 +0000 (17:04 +0800)
In preparation for componentization move the ignore_pmdown_time field from the
snd_soc_codec struct to the snd_soc_component struct. Set it to true for non
CODEC components for now.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/sound/soc.h
sound/soc/soc-core.c
sound/soc/soc-pcm.c

index 0495b4aaeb7017498047edd713550c3cc3794ee1..b14acd8228ab13044d231588b9cc6a37c398779d 100644 (file)
@@ -663,6 +663,8 @@ struct snd_soc_component {
 
        unsigned int active;
 
+       unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
+
        struct list_head list;
 
        struct snd_soc_dai_driver *dai_drv;
@@ -715,7 +717,6 @@ struct snd_soc_codec {
 
        /* dapm */
        struct snd_soc_dapm_context dapm;
-       unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
 
 #ifdef CONFIG_DEBUG_FS
        struct dentry *debugfs_codec_root;
index 6401e97b2e685ec8e3fe0835d90f64d16fcade04..18aecd2841a8467bef76663dfa436713494e11e2 100644 (file)
@@ -4127,6 +4127,8 @@ int snd_soc_register_component(struct device *dev,
                return -ENOMEM;
        }
 
+       cmpnt->ignore_pmdown_time = true;
+
        return __snd_soc_register_component(dev, cmpnt, cmpnt_drv,
                                            dai_drv, num_dai, true);
 }
@@ -4325,7 +4327,7 @@ int snd_soc_register_codec(struct device *dev,
        codec->volatile_register = codec_drv->volatile_register;
        codec->readable_register = codec_drv->readable_register;
        codec->writable_register = codec_drv->writable_register;
-       codec->ignore_pmdown_time = codec_drv->ignore_pmdown_time;
+       codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time;
        codec->dapm.bias_level = SND_SOC_BIAS_OFF;
        codec->dapm.dev = dev;
        codec->dapm.codec = codec;
index 98b46295785de60d8a337c22c9fa7c3470cf2348..2cedf09f6d9613c7b34bb22888806fde598052c6 100644 (file)
@@ -107,17 +107,11 @@ 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 ignore = true;
-
        if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time)
                return true;
 
-       if (rtd->cpu_dai->codec)
-               ignore &= rtd->cpu_dai->codec->ignore_pmdown_time;
-
-       ignore &= rtd->codec_dai->codec->ignore_pmdown_time;
-
-       return ignore;
+       return rtd->cpu_dai->component->ignore_pmdown_time &&
+                       rtd->codec_dai->component->ignore_pmdown_time;
 }
 
 /**