aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/tosa.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/tosa.c')
-rw-r--r--sound/soc/pxa/tosa.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index 73d0edd8ded9..0a9bd68ef749 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -49,31 +49,33 @@ static int tosa_spk_func;
49 49
50static void tosa_ext_control(struct snd_soc_codec *codec) 50static void tosa_ext_control(struct snd_soc_codec *codec)
51{ 51{
52 struct snd_soc_dapm_context *dapm = &codec->dapm;
53
52 /* set up jack connection */ 54 /* set up jack connection */
53 switch (tosa_jack_func) { 55 switch (tosa_jack_func) {
54 case TOSA_HP: 56 case TOSA_HP:
55 snd_soc_dapm_disable_pin(codec, "Mic (Internal)"); 57 snd_soc_dapm_disable_pin(dapm, "Mic (Internal)");
56 snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 58 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
57 snd_soc_dapm_disable_pin(codec, "Headset Jack"); 59 snd_soc_dapm_disable_pin(dapm, "Headset Jack");
58 break; 60 break;
59 case TOSA_MIC_INT: 61 case TOSA_MIC_INT:
60 snd_soc_dapm_enable_pin(codec, "Mic (Internal)"); 62 snd_soc_dapm_enable_pin(dapm, "Mic (Internal)");
61 snd_soc_dapm_disable_pin(codec, "Headphone Jack"); 63 snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
62 snd_soc_dapm_disable_pin(codec, "Headset Jack"); 64 snd_soc_dapm_disable_pin(dapm, "Headset Jack");
63 break; 65 break;
64 case TOSA_HEADSET: 66 case TOSA_HEADSET:
65 snd_soc_dapm_disable_pin(codec, "Mic (Internal)"); 67 snd_soc_dapm_disable_pin(dapm, "Mic (Internal)");
66 snd_soc_dapm_disable_pin(codec, "Headphone Jack"); 68 snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
67 snd_soc_dapm_enable_pin(codec, "Headset Jack"); 69 snd_soc_dapm_enable_pin(dapm, "Headset Jack");
68 break; 70 break;
69 } 71 }
70 72
71 if (tosa_spk_func == TOSA_SPK_ON) 73 if (tosa_spk_func == TOSA_SPK_ON)
72 snd_soc_dapm_enable_pin(codec, "Speaker"); 74 snd_soc_dapm_enable_pin(dapm, "Speaker");
73 else 75 else
74 snd_soc_dapm_disable_pin(codec, "Speaker"); 76 snd_soc_dapm_disable_pin(dapm, "Speaker");
75 77
76 snd_soc_dapm_sync(codec); 78 snd_soc_dapm_sync(dapm);
77} 79}
78 80
79static int tosa_startup(struct snd_pcm_substream *substream) 81static int tosa_startup(struct snd_pcm_substream *substream)
@@ -186,10 +188,11 @@ static const struct snd_kcontrol_new tosa_controls[] = {
186static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd) 188static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd)
187{ 189{
188 struct snd_soc_codec *codec = rtd->codec; 190 struct snd_soc_codec *codec = rtd->codec;
191 struct snd_soc_dapm_context *dapm = &codec->dapm;
189 int err; 192 int err;
190 193
191 snd_soc_dapm_nc_pin(codec, "OUT3"); 194 snd_soc_dapm_nc_pin(dapm, "OUT3");
192 snd_soc_dapm_nc_pin(codec, "MONOOUT"); 195 snd_soc_dapm_nc_pin(dapm, "MONOOUT");
193 196
194 /* add tosa specific controls */ 197 /* add tosa specific controls */
195 err = snd_soc_add_controls(codec, tosa_controls, 198 err = snd_soc_add_controls(codec, tosa_controls,
@@ -198,13 +201,13 @@ static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd)
198 return err; 201 return err;
199 202
200 /* add tosa specific widgets */ 203 /* add tosa specific widgets */
201 snd_soc_dapm_new_controls(codec, tosa_dapm_widgets, 204 snd_soc_dapm_new_controls(dapm, tosa_dapm_widgets,
202 ARRAY_SIZE(tosa_dapm_widgets)); 205 ARRAY_SIZE(tosa_dapm_widgets));
203 206
204 /* set up tosa specific audio path audio_map */ 207 /* set up tosa specific audio path audio_map */
205 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 208 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
206 209
207 snd_soc_dapm_sync(codec); 210 snd_soc_dapm_sync(dapm);
208 return 0; 211 return 0;
209} 212}
210 213