ASoC: mop500_ab8500: Use card DAPM context to access widgets
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Apr 2015 11:01:02 +0000 (13:01 +0200)
committerMark Brown <broonie@kernel.org>
Sun, 12 Apr 2015 11:43:58 +0000 (12:43 +0100)
The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ux500/mop500_ab8500.c

index aa65370db82aa52fb480871eb06bd5dfed667d3b..b81a7a4c938b80e7f1eb43c2e3cfc56b4aa4488a 100644 (file)
@@ -362,7 +362,7 @@ struct snd_soc_ops mop500_ab8500_ops[] = {
 
 int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_dapm_context *dapm = &rtd->card->dapm;
        struct device *dev = rtd->card->dev;
        struct mop500_ab8500_drvdata *drvdata;
        int ret;
@@ -407,23 +407,23 @@ int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
                return ret;
        }
 
-       ret = snd_soc_dapm_disable_pin(&codec->dapm, "Earpiece");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "Speaker Left");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "Speaker Right");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "LineOut Left");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "LineOut Right");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "Vibra 1");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "Vibra 2");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "Mic 1");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "Mic 2");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "LineIn Left");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "LineIn Right");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "DMic 1");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "DMic 2");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "DMic 3");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "DMic 4");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "DMic 5");
-       ret |= snd_soc_dapm_disable_pin(&codec->dapm, "DMic 6");
+       ret = snd_soc_dapm_disable_pin(dapm, "Earpiece");
+       ret |= snd_soc_dapm_disable_pin(dapm, "Speaker Left");
+       ret |= snd_soc_dapm_disable_pin(dapm, "Speaker Right");
+       ret |= snd_soc_dapm_disable_pin(dapm, "LineOut Left");
+       ret |= snd_soc_dapm_disable_pin(dapm, "LineOut Right");
+       ret |= snd_soc_dapm_disable_pin(dapm, "Vibra 1");
+       ret |= snd_soc_dapm_disable_pin(dapm, "Vibra 2");
+       ret |= snd_soc_dapm_disable_pin(dapm, "Mic 1");
+       ret |= snd_soc_dapm_disable_pin(dapm, "Mic 2");
+       ret |= snd_soc_dapm_disable_pin(dapm, "LineIn Left");
+       ret |= snd_soc_dapm_disable_pin(dapm, "LineIn Right");
+       ret |= snd_soc_dapm_disable_pin(dapm, "DMic 1");
+       ret |= snd_soc_dapm_disable_pin(dapm, "DMic 2");
+       ret |= snd_soc_dapm_disable_pin(dapm, "DMic 3");
+       ret |= snd_soc_dapm_disable_pin(dapm, "DMic 4");
+       ret |= snd_soc_dapm_disable_pin(dapm, "DMic 5");
+       ret |= snd_soc_dapm_disable_pin(dapm, "DMic 6");
 
        return ret;
 }