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.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index 465ff0f458ef..dba7689c5080 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -52,29 +52,31 @@ static int tosa_spk_func;
52 52
53static void tosa_ext_control(struct snd_soc_codec *codec) 53static void tosa_ext_control(struct snd_soc_codec *codec)
54{ 54{
55 int spk = 0, mic_int = 0, hp = 0, hs = 0;
56
57 /* set up jack connection */ 55 /* set up jack connection */
58 switch (tosa_jack_func) { 56 switch (tosa_jack_func) {
59 case TOSA_HP: 57 case TOSA_HP:
60 hp = 1; 58 snd_soc_dapm_disable_pin(codec, "Mic (Internal)");
59 snd_soc_dapm_enable_pin(codec, "Headphone Jack");
60 snd_soc_dapm_disable_pin(codec, "Headset Jack");
61 break; 61 break;
62 case TOSA_MIC_INT: 62 case TOSA_MIC_INT:
63 mic_int = 1; 63 snd_soc_dapm_enable_pin(codec, "Mic (Internal)");
64 snd_soc_dapm_disable_pin(codec, "Headphone Jack");
65 snd_soc_dapm_disable_pin(codec, "Headset Jack");
64 break; 66 break;
65 case TOSA_HEADSET: 67 case TOSA_HEADSET:
66 hs = 1; 68 snd_soc_dapm_disable_pin(codec, "Mic (Internal)");
69 snd_soc_dapm_disable_pin(codec, "Headphone Jack");
70 snd_soc_dapm_enable_pin(codec, "Headset Jack");
67 break; 71 break;
68 } 72 }
69 73
70 if (tosa_spk_func == TOSA_SPK_ON) 74 if (tosa_spk_func == TOSA_SPK_ON)
71 spk = 1; 75 snd_soc_dapm_enable_pin(codec, "Speaker");
76 else
77 snd_soc_dapm_disable_pin(codec, "Speaker");
72 78
73 snd_soc_dapm_set_endpoint(codec, "Speaker", spk); 79 snd_soc_dapm_sync(codec);
74 snd_soc_dapm_set_endpoint(codec, "Mic (Internal)", mic_int);
75 snd_soc_dapm_set_endpoint(codec, "Headphone Jack", hp);
76 snd_soc_dapm_set_endpoint(codec, "Headset Jack", hs);
77 snd_soc_dapm_sync_endpoints(codec);
78} 80}
79 81
80static int tosa_startup(struct snd_pcm_substream *substream) 82static int tosa_startup(struct snd_pcm_substream *substream)
@@ -191,8 +193,8 @@ static int tosa_ac97_init(struct snd_soc_codec *codec)
191{ 193{
192 int i, err; 194 int i, err;
193 195
194 snd_soc_dapm_set_endpoint(codec, "OUT3", 0); 196 snd_soc_dapm_disable_pin(codec, "OUT3");
195 snd_soc_dapm_set_endpoint(codec, "MONOOUT", 0); 197 snd_soc_dapm_disable_pin(codec, "MONOOUT");
196 198
197 /* add tosa specific controls */ 199 /* add tosa specific controls */
198 for (i = 0; i < ARRAY_SIZE(tosa_controls); i++) { 200 for (i = 0; i < ARRAY_SIZE(tosa_controls); i++) {
@@ -209,7 +211,7 @@ static int tosa_ac97_init(struct snd_soc_codec *codec)
209 /* set up tosa specific audio path audio_map */ 211 /* set up tosa specific audio path audio_map */
210 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 212 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
211 213
212 snd_soc_dapm_sync_endpoints(codec); 214 snd_soc_dapm_sync(codec);
213 return 0; 215 return 0;
214} 216}
215 217