ASoC: cht_bsw_max98090_ti: Use card DAPM context to access widgets
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 6 Jul 2015 13:38:09 +0000 (15:38 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jul 2015 13:54:31 +0000 (14:54 +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.

While we are at it also remove some extra newlines.

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

index d604ee80eda4be715601db603181e0291cc98747..afcd6baa3cbceacf7e4d0ccc5c77416a408ee166 100644 (file)
@@ -104,21 +104,17 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,
 static int cht_ti_jack_event(struct notifier_block *nb,
                unsigned long event, void *data)
 {
-
        struct snd_soc_jack *jack = (struct snd_soc_jack *)data;
-       struct snd_soc_dai *codec_dai = jack->card->rtd->codec_dai;
-       struct snd_soc_codec *codec = codec_dai->codec;
+       struct snd_soc_dapm_context *dapm = &jack->card->dapm;
 
        if (event & SND_JACK_MICROPHONE) {
-
-               snd_soc_dapm_force_enable_pin(&codec->dapm, "SHDN");
-               snd_soc_dapm_force_enable_pin(&codec->dapm, "MICBIAS");
-               snd_soc_dapm_sync(&codec->dapm);
+               snd_soc_dapm_force_enable_pin(dapm, "SHDN");
+               snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
+               snd_soc_dapm_sync(dapm);
        } else {
-
-               snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS");
-               snd_soc_dapm_disable_pin(&codec->dapm, "SHDN");
-               snd_soc_dapm_sync(&codec->dapm);
+               snd_soc_dapm_disable_pin(dapm, "MICBIAS");
+               snd_soc_dapm_disable_pin(dapm, "SHDN");
+               snd_soc_dapm_sync(dapm);
        }
 
        return 0;
This page took 0.024893 seconds and 5 git commands to generate.