Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d59400f authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent cdde4ccb
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -663,6 +663,8 @@ struct snd_soc_component {


	unsigned int active;
	unsigned int active;


	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */

	struct list_head list;
	struct list_head list;


	struct snd_soc_dai_driver *dai_drv;
	struct snd_soc_dai_driver *dai_drv;
@@ -715,7 +717,6 @@ struct snd_soc_codec {


	/* dapm */
	/* dapm */
	struct snd_soc_dapm_context dapm;
	struct snd_soc_dapm_context dapm;
	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */


#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
	struct dentry *debugfs_codec_root;
	struct dentry *debugfs_codec_root;
+3 −1
Original line number Original line Diff line number Diff line
@@ -4127,6 +4127,8 @@ int snd_soc_register_component(struct device *dev,
		return -ENOMEM;
		return -ENOMEM;
	}
	}


	cmpnt->ignore_pmdown_time = true;

	return __snd_soc_register_component(dev, cmpnt, cmpnt_drv,
	return __snd_soc_register_component(dev, cmpnt, cmpnt_drv,
					    dai_drv, num_dai, true);
					    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->volatile_register = codec_drv->volatile_register;
	codec->readable_register = codec_drv->readable_register;
	codec->readable_register = codec_drv->readable_register;
	codec->writable_register = codec_drv->writable_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.bias_level = SND_SOC_BIAS_OFF;
	codec->dapm.dev = dev;
	codec->dapm.dev = dev;
	codec->dapm.codec = codec;
	codec->dapm.codec = codec;
+2 −8
Original line number Original line Diff line number Diff line
@@ -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 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)
	if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time)
		return true;
		return true;


	if (rtd->cpu_dai->codec)
	return rtd->cpu_dai->component->ignore_pmdown_time &&
		ignore &= rtd->cpu_dai->codec->ignore_pmdown_time;
			rtd->codec_dai->component->ignore_pmdown_time;

	ignore &= rtd->codec_dai->codec->ignore_pmdown_time;

	return ignore;
}
}


/**
/**