From 4890140f3888b4a4baef90d84e278858afe45248 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 6 Jul 2015 15:38:11 +0200 Subject: ASoC: Remove snd_soc_codec dapm field There are no more direct users of the snd_soc_codec DAPM field left. So we can finally remove it and switch over to directly using the component DAPM context and remove the dapm_ptr indirection. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'sound/soc/soc-core.c') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3a4a5c0..3747111 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -654,10 +654,12 @@ int snd_soc_suspend(struct device *dev) /* suspend all CODECs */ list_for_each_entry(codec, &card->codec_dev_list, card_list) { + struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); + /* If there are paths active then the CODEC will be held with * bias _ON and should not be suspended. */ if (!codec->suspended) { - switch (codec->dapm.bias_level) { + switch (snd_soc_dapm_get_bias_level(dapm)) { case SND_SOC_BIAS_STANDBY: /* * If the CODEC is capable of idle @@ -665,7 +667,7 @@ int snd_soc_suspend(struct device *dev) * means it's doing something, * otherwise fall through. */ - if (codec->dapm.idle_bias_off) { + if (dapm->idle_bias_off) { dev_dbg(codec->dev, "ASoC: idle_bias_off CODEC on over suspend\n"); break; @@ -2651,10 +2653,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, component->probe = component->driver->probe; component->remove = component->driver->remove; - if (!component->dapm_ptr) - component->dapm_ptr = &component->dapm; - - dapm = component->dapm_ptr; + dapm = &component->dapm; dapm->dev = dev; dapm->component = component; dapm->bias_level = SND_SOC_BIAS_OFF; @@ -3036,6 +3035,7 @@ int snd_soc_register_codec(struct device *dev, struct snd_soc_dai_driver *dai_drv, int num_dai) { + struct snd_soc_dapm_context *dapm; struct snd_soc_codec *codec; struct snd_soc_dai *dai; int ret, i; @@ -3046,7 +3046,6 @@ int snd_soc_register_codec(struct device *dev, if (codec == NULL) return -ENOMEM; - codec->component.dapm_ptr = &codec->dapm; codec->component.codec = codec; ret = snd_soc_component_initialize(&codec->component, @@ -3076,12 +3075,14 @@ int snd_soc_register_codec(struct device *dev, if (codec_drv->read) codec->component.read = snd_soc_codec_drv_read; codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time; - codec->dapm.idle_bias_off = codec_drv->idle_bias_off; - codec->dapm.suspend_bias_off = codec_drv->suspend_bias_off; + + dapm = snd_soc_codec_get_dapm(codec); + dapm->idle_bias_off = codec_drv->idle_bias_off; + dapm->suspend_bias_off = codec_drv->suspend_bias_off; if (codec_drv->seq_notifier) - codec->dapm.seq_notifier = codec_drv->seq_notifier; + dapm->seq_notifier = codec_drv->seq_notifier; if (codec_drv->set_bias_level) - codec->dapm.set_bias_level = snd_soc_codec_set_bias_level; + dapm->set_bias_level = snd_soc_codec_set_bias_level; codec->dev = dev; codec->driver = codec_drv; codec->component.val_bytes = codec_drv->reg_word_size; -- cgit v1.1