ASoC: Decouple DAPM from CODECs
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / sound / soc / s3c24xx / smdk64xx_wm8580.c
index 052e499b68d161c614133bc596bc62b9afa31b2b..291939cf8483bf5dc822e71fa4b24a8ed86644d8 100644 (file)
@@ -182,21 +182,22 @@ static const struct snd_soc_dapm_route audio_map_rx[] = {
 static int smdk64xx_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_dapm_context *dapm = &codec->dapm;
 
        /* Add smdk64xx specific Capture widgets */
-       snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets_cpt,
+       snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_cpt,
                                  ARRAY_SIZE(wm8580_dapm_widgets_cpt));
 
        /* Set up PAIFTX audio path */
-       snd_soc_dapm_add_routes(codec, audio_map_tx, ARRAY_SIZE(audio_map_tx));
+       snd_soc_dapm_add_routes(dapm, audio_map_tx, ARRAY_SIZE(audio_map_tx));
 
        /* Enabling the microphone requires the fitting of a 0R
         * resistor to connect the line from the microphone jack.
         */
-       snd_soc_dapm_disable_pin(codec, "MicIn");
+       snd_soc_dapm_disable_pin(dapm, "MicIn");
 
        /* signal a DAPM event */
-       snd_soc_dapm_sync(codec);
+       snd_soc_dapm_sync(dapm);
 
        return 0;
 }
@@ -204,16 +205,17 @@ static int smdk64xx_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd)
 static int smdk64xx_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_dapm_context *dapm = &codec->dapm;
 
        /* Add smdk64xx specific Playback widgets */
-       snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets_pbk,
+       snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_pbk,
                                  ARRAY_SIZE(wm8580_dapm_widgets_pbk));
 
        /* Set up PAIFRX audio path */
-       snd_soc_dapm_add_routes(codec, audio_map_rx, ARRAY_SIZE(audio_map_rx));
+       snd_soc_dapm_add_routes(dapm, audio_map_rx, ARRAY_SIZE(audio_map_rx));
 
        /* signal a DAPM event */
-       snd_soc_dapm_sync(codec);
+       snd_soc_dapm_sync(dapm);
 
        return 0;
 }