diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-05 07:17:48 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-06 04:04:56 -0500 |
commit | 3d59400fe47e7e8bfb024cd1651433bef42e268e (patch) | |
tree | f3a0162a203e1abb9063f662b623d4972221d752 | |
parent | cdde4ccb14b4959bd1c96a07367bf02b746328d3 (diff) |
ASoC: Move ignore_pmdown_time from CODEC to component
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>
-rw-r--r-- | include/sound/soc.h | 3 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 4 | ||||
-rw-r--r-- | sound/soc/soc-pcm.c | 10 |
3 files changed, 7 insertions, 10 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 0495b4aaeb70..b14acd8228ab 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -663,6 +663,8 @@ struct snd_soc_component { | |||
663 | 663 | ||
664 | unsigned int active; | 664 | unsigned int active; |
665 | 665 | ||
666 | unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ | ||
667 | |||
666 | struct list_head list; | 668 | struct list_head list; |
667 | 669 | ||
668 | struct snd_soc_dai_driver *dai_drv; | 670 | struct snd_soc_dai_driver *dai_drv; |
@@ -715,7 +717,6 @@ struct snd_soc_codec { | |||
715 | 717 | ||
716 | /* dapm */ | 718 | /* dapm */ |
717 | struct snd_soc_dapm_context dapm; | 719 | struct snd_soc_dapm_context dapm; |
718 | unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ | ||
719 | 720 | ||
720 | #ifdef CONFIG_DEBUG_FS | 721 | #ifdef CONFIG_DEBUG_FS |
721 | struct dentry *debugfs_codec_root; | 722 | struct dentry *debugfs_codec_root; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6401e97b2e68..18aecd2841a8 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -4127,6 +4127,8 @@ int snd_soc_register_component(struct device *dev, | |||
4127 | return -ENOMEM; | 4127 | return -ENOMEM; |
4128 | } | 4128 | } |
4129 | 4129 | ||
4130 | cmpnt->ignore_pmdown_time = true; | ||
4131 | |||
4130 | return __snd_soc_register_component(dev, cmpnt, cmpnt_drv, | 4132 | return __snd_soc_register_component(dev, cmpnt, cmpnt_drv, |
4131 | dai_drv, num_dai, true); | 4133 | dai_drv, num_dai, true); |
4132 | } | 4134 | } |
@@ -4325,7 +4327,7 @@ int snd_soc_register_codec(struct device *dev, | |||
4325 | codec->volatile_register = codec_drv->volatile_register; | 4327 | codec->volatile_register = codec_drv->volatile_register; |
4326 | codec->readable_register = codec_drv->readable_register; | 4328 | codec->readable_register = codec_drv->readable_register; |
4327 | codec->writable_register = codec_drv->writable_register; | 4329 | codec->writable_register = codec_drv->writable_register; |
4328 | codec->ignore_pmdown_time = codec_drv->ignore_pmdown_time; | 4330 | codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time; |
4329 | codec->dapm.bias_level = SND_SOC_BIAS_OFF; | 4331 | codec->dapm.bias_level = SND_SOC_BIAS_OFF; |
4330 | codec->dapm.dev = dev; | 4332 | codec->dapm.dev = dev; |
4331 | codec->dapm.codec = codec; | 4333 | codec->dapm.codec = codec; |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 98b46295785d..2cedf09f6d96 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -107,17 +107,11 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream) | |||
107 | */ | 107 | */ |
108 | bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) | 108 | bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) |
109 | { | 109 | { |
110 | bool ignore = true; | ||
111 | |||
112 | if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) | 110 | if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) |
113 | return true; | 111 | return true; |
114 | 112 | ||
115 | if (rtd->cpu_dai->codec) | 113 | return rtd->cpu_dai->component->ignore_pmdown_time && |
116 | ignore &= rtd->cpu_dai->codec->ignore_pmdown_time; | 114 | rtd->codec_dai->component->ignore_pmdown_time; |
117 | |||
118 | ignore &= rtd->codec_dai->codec->ignore_pmdown_time; | ||
119 | |||
120 | return ignore; | ||
121 | } | 115 | } |
122 | 116 | ||
123 | /** | 117 | /** |