diff options
author | Liam Girdwood <lg@opensource.wolfsonmicro.com> | 2008-07-07 08:35:17 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-07-10 03:32:30 -0400 |
commit | a5302181e5321664047f75715242aac4e0bbd17c (patch) | |
tree | eb5b8a618062099981b65eeaca4cdb9b1fe7c826 /sound/soc/pxa | |
parent | be321a890c25272965129ffe4b3b59a519fcf583 (diff) |
ALSA: asoc: core - refactored DAPM pin control API.
Refactored snd_soc_dapm_set_endpoint() to snd_soc_dapm_enable_pin() and
snd_soc_dapm_disable_pin().
Renamed snd_soc_dapm_sync_endpoints() to snd_soc_dapm_sync().
Renamed snd_soc_dapm_get_endpoint_status() to
snd_soc_dapm_get_pin_status().
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r-- | sound/soc/pxa/corgi.c | 42 | ||||
-rw-r--r-- | sound/soc/pxa/poodle.c | 24 | ||||
-rw-r--r-- | sound/soc/pxa/spitz.c | 62 | ||||
-rw-r--r-- | sound/soc/pxa/tosa.c | 30 |
4 files changed, 81 insertions, 77 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index edeea63e80e8..db18ef68b691 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -50,47 +50,51 @@ static int corgi_spk_func; | |||
50 | 50 | ||
51 | static void corgi_ext_control(struct snd_soc_codec *codec) | 51 | static void corgi_ext_control(struct snd_soc_codec *codec) |
52 | { | 52 | { |
53 | int spk = 0, mic = 0, line = 0, hp = 0, hs = 0; | ||
54 | |||
55 | /* set up jack connection */ | 53 | /* set up jack connection */ |
56 | switch (corgi_jack_func) { | 54 | switch (corgi_jack_func) { |
57 | case CORGI_HP: | 55 | case CORGI_HP: |
58 | hp = 1; | ||
59 | /* set = unmute headphone */ | 56 | /* set = unmute headphone */ |
60 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 57 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); |
61 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 58 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); |
59 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | ||
60 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | ||
61 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | ||
62 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | ||
62 | break; | 63 | break; |
63 | case CORGI_MIC: | 64 | case CORGI_MIC: |
64 | mic = 1; | ||
65 | /* reset = mute headphone */ | 65 | /* reset = mute headphone */ |
66 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 66 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); |
67 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 67 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); |
68 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | ||
69 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | ||
70 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | ||
71 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | ||
68 | break; | 72 | break; |
69 | case CORGI_LINE: | 73 | case CORGI_LINE: |
70 | line = 1; | ||
71 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 74 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); |
72 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 75 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); |
76 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | ||
77 | snd_soc_dapm_enable_pin(codec, "Line Jack"); | ||
78 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | ||
79 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | ||
73 | break; | 80 | break; |
74 | case CORGI_HEADSET: | 81 | case CORGI_HEADSET: |
75 | hs = 1; | ||
76 | mic = 1; | ||
77 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 82 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); |
78 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 83 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); |
84 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | ||
85 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | ||
86 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | ||
87 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | ||
79 | break; | 88 | break; |
80 | } | 89 | } |
81 | 90 | ||
82 | if (corgi_spk_func == CORGI_SPK_ON) | 91 | if (corgi_spk_func == CORGI_SPK_ON) |
83 | spk = 1; | 92 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); |
84 | 93 | else | |
85 | /* set the enpoints to their new connetion states */ | 94 | snd_soc_dapm_disable_pin(codec, "Ext Spk"); |
86 | snd_soc_dapm_set_endpoint(codec, "Ext Spk", spk); | ||
87 | snd_soc_dapm_set_endpoint(codec, "Mic Jack", mic); | ||
88 | snd_soc_dapm_set_endpoint(codec, "Line Jack", line); | ||
89 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", hp); | ||
90 | snd_soc_dapm_set_endpoint(codec, "Headset Jack", hs); | ||
91 | 95 | ||
92 | /* signal a DAPM event */ | 96 | /* signal a DAPM event */ |
93 | snd_soc_dapm_sync_endpoints(codec); | 97 | snd_soc_dapm_sync(codec); |
94 | } | 98 | } |
95 | 99 | ||
96 | static int corgi_startup(struct snd_pcm_substream *substream) | 100 | static int corgi_startup(struct snd_pcm_substream *substream) |
@@ -285,8 +289,8 @@ static int corgi_wm8731_init(struct snd_soc_codec *codec) | |||
285 | { | 289 | { |
286 | int i, err; | 290 | int i, err; |
287 | 291 | ||
288 | snd_soc_dapm_set_endpoint(codec, "LLINEIN", 0); | 292 | snd_soc_dapm_disable_pin(codec, "LLINEIN"); |
289 | snd_soc_dapm_set_endpoint(codec, "RLINEIN", 0); | 293 | snd_soc_dapm_disable_pin(codec, "RLINEIN"); |
290 | 294 | ||
291 | /* Add corgi specific controls */ | 295 | /* Add corgi specific controls */ |
292 | for (i = 0; i < ARRAY_SIZE(wm8731_corgi_controls); i++) { | 296 | for (i = 0; i < ARRAY_SIZE(wm8731_corgi_controls); i++) { |
@@ -303,7 +307,7 @@ static int corgi_wm8731_init(struct snd_soc_codec *codec) | |||
303 | /* Set up corgi specific audio path audio_map */ | 307 | /* Set up corgi specific audio path audio_map */ |
304 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 308 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); |
305 | 309 | ||
306 | snd_soc_dapm_sync_endpoints(codec); | 310 | snd_soc_dapm_sync(codec); |
307 | return 0; | 311 | return 0; |
308 | } | 312 | } |
309 | 313 | ||
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index 810f1fe158ab..36cbf69f5f82 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c | |||
@@ -48,8 +48,6 @@ static int poodle_spk_func; | |||
48 | 48 | ||
49 | static void poodle_ext_control(struct snd_soc_codec *codec) | 49 | static void poodle_ext_control(struct snd_soc_codec *codec) |
50 | { | 50 | { |
51 | int spk = 0; | ||
52 | |||
53 | /* set up jack connection */ | 51 | /* set up jack connection */ |
54 | if (poodle_jack_func == POODLE_HP) { | 52 | if (poodle_jack_func == POODLE_HP) { |
55 | /* set = unmute headphone */ | 53 | /* set = unmute headphone */ |
@@ -57,23 +55,23 @@ static void poodle_ext_control(struct snd_soc_codec *codec) | |||
57 | POODLE_LOCOMO_GPIO_MUTE_L, 1); | 55 | POODLE_LOCOMO_GPIO_MUTE_L, 1); |
58 | locomo_gpio_write(&poodle_locomo_device.dev, | 56 | locomo_gpio_write(&poodle_locomo_device.dev, |
59 | POODLE_LOCOMO_GPIO_MUTE_R, 1); | 57 | POODLE_LOCOMO_GPIO_MUTE_R, 1); |
60 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 1); | 58 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); |
61 | } else { | 59 | } else { |
62 | locomo_gpio_write(&poodle_locomo_device.dev, | 60 | locomo_gpio_write(&poodle_locomo_device.dev, |
63 | POODLE_LOCOMO_GPIO_MUTE_L, 0); | 61 | POODLE_LOCOMO_GPIO_MUTE_L, 0); |
64 | locomo_gpio_write(&poodle_locomo_device.dev, | 62 | locomo_gpio_write(&poodle_locomo_device.dev, |
65 | POODLE_LOCOMO_GPIO_MUTE_R, 0); | 63 | POODLE_LOCOMO_GPIO_MUTE_R, 0); |
66 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 0); | 64 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
67 | } | 65 | } |
68 | 66 | ||
69 | if (poodle_spk_func == POODLE_SPK_ON) | ||
70 | spk = 1; | ||
71 | |||
72 | /* set the enpoints to their new connetion states */ | 67 | /* set the enpoints to their new connetion states */ |
73 | snd_soc_dapm_set_endpoint(codec, "Ext Spk", spk); | 68 | if (poodle_spk_func == POODLE_SPK_ON) |
69 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); | ||
70 | else | ||
71 | snd_soc_dapm_disable_pin(codec, "Ext Spk"); | ||
74 | 72 | ||
75 | /* signal a DAPM event */ | 73 | /* signal a DAPM event */ |
76 | snd_soc_dapm_sync_endpoints(codec); | 74 | snd_soc_dapm_sync(codec); |
77 | } | 75 | } |
78 | 76 | ||
79 | static int poodle_startup(struct snd_pcm_substream *substream) | 77 | static int poodle_startup(struct snd_pcm_substream *substream) |
@@ -248,9 +246,9 @@ static int poodle_wm8731_init(struct snd_soc_codec *codec) | |||
248 | { | 246 | { |
249 | int i, err; | 247 | int i, err; |
250 | 248 | ||
251 | snd_soc_dapm_set_endpoint(codec, "LLINEIN", 0); | 249 | snd_soc_dapm_disable_pin(codec, "LLINEIN"); |
252 | snd_soc_dapm_set_endpoint(codec, "RLINEIN", 0); | 250 | snd_soc_dapm_disable_pin(codec, "RLINEIN"); |
253 | snd_soc_dapm_set_endpoint(codec, "MICIN", 1); | 251 | snd_soc_dapm_enable_pin(codec, "MICIN"); |
254 | 252 | ||
255 | /* Add poodle specific controls */ | 253 | /* Add poodle specific controls */ |
256 | for (i = 0; i < ARRAY_SIZE(wm8731_poodle_controls); i++) { | 254 | for (i = 0; i < ARRAY_SIZE(wm8731_poodle_controls); i++) { |
@@ -267,7 +265,7 @@ static int poodle_wm8731_init(struct snd_soc_codec *codec) | |||
267 | /* Set up poodle specific audio path audio_map */ | 265 | /* Set up poodle specific audio path audio_map */ |
268 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 266 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); |
269 | 267 | ||
270 | snd_soc_dapm_sync_endpoints(codec); | 268 | snd_soc_dapm_sync(codec); |
271 | return 0; | 269 | return 0; |
272 | } | 270 | } |
273 | 271 | ||
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index 092b5c776b40..ec18163fdddd 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -51,60 +51,60 @@ static int spitz_spk_func; | |||
51 | static void spitz_ext_control(struct snd_soc_codec *codec) | 51 | static void spitz_ext_control(struct snd_soc_codec *codec) |
52 | { | 52 | { |
53 | if (spitz_spk_func == SPITZ_SPK_ON) | 53 | if (spitz_spk_func == SPITZ_SPK_ON) |
54 | snd_soc_dapm_set_endpoint(codec, "Ext Spk", 1); | 54 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); |
55 | else | 55 | else |
56 | snd_soc_dapm_set_endpoint(codec, "Ext Spk", 0); | 56 | snd_soc_dapm_disable_pin(codec, "Ext Spk"); |
57 | 57 | ||
58 | /* set up jack connection */ | 58 | /* set up jack connection */ |
59 | switch (spitz_jack_func) { | 59 | switch (spitz_jack_func) { |
60 | case SPITZ_HP: | 60 | case SPITZ_HP: |
61 | /* enable and unmute hp jack, disable mic bias */ | 61 | /* enable and unmute hp jack, disable mic bias */ |
62 | snd_soc_dapm_set_endpoint(codec, "Headset Jack", 0); | 62 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
63 | snd_soc_dapm_set_endpoint(codec, "Mic Jack", 0); | 63 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
64 | snd_soc_dapm_set_endpoint(codec, "Line Jack", 0); | 64 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
65 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 1); | 65 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); |
66 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 66 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); |
67 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 67 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); |
68 | break; | 68 | break; |
69 | case SPITZ_MIC: | 69 | case SPITZ_MIC: |
70 | /* enable mic jack and bias, mute hp */ | 70 | /* enable mic jack and bias, mute hp */ |
71 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 0); | 71 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
72 | snd_soc_dapm_set_endpoint(codec, "Headset Jack", 0); | 72 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
73 | snd_soc_dapm_set_endpoint(codec, "Line Jack", 0); | 73 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
74 | snd_soc_dapm_set_endpoint(codec, "Mic Jack", 1); | 74 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); |
75 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 75 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); |
76 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 76 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); |
77 | break; | 77 | break; |
78 | case SPITZ_LINE: | 78 | case SPITZ_LINE: |
79 | /* enable line jack, disable mic bias and mute hp */ | 79 | /* enable line jack, disable mic bias and mute hp */ |
80 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 0); | 80 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
81 | snd_soc_dapm_set_endpoint(codec, "Headset Jack", 0); | 81 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
82 | snd_soc_dapm_set_endpoint(codec, "Mic Jack", 0); | 82 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
83 | snd_soc_dapm_set_endpoint(codec, "Line Jack", 1); | 83 | snd_soc_dapm_enable_pin(codec, "Line Jack"); |
84 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 84 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); |
85 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 85 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); |
86 | break; | 86 | break; |
87 | case SPITZ_HEADSET: | 87 | case SPITZ_HEADSET: |
88 | /* enable and unmute headset jack enable mic bias, mute L hp */ | 88 | /* enable and unmute headset jack enable mic bias, mute L hp */ |
89 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 0); | 89 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
90 | snd_soc_dapm_set_endpoint(codec, "Mic Jack", 1); | 90 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); |
91 | snd_soc_dapm_set_endpoint(codec, "Line Jack", 0); | 91 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
92 | snd_soc_dapm_set_endpoint(codec, "Headset Jack", 1); | 92 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); |
93 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 93 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); |
94 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 94 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); |
95 | break; | 95 | break; |
96 | case SPITZ_HP_OFF: | 96 | case SPITZ_HP_OFF: |
97 | 97 | ||
98 | /* jack removed, everything off */ | 98 | /* jack removed, everything off */ |
99 | snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 0); | 99 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
100 | snd_soc_dapm_set_endpoint(codec, "Headset Jack", 0); | 100 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
101 | snd_soc_dapm_set_endpoint(codec, "Mic Jack", 0); | 101 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
102 | snd_soc_dapm_set_endpoint(codec, "Line Jack", 0); | 102 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
103 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 103 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); |
104 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 104 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); |
105 | break; | 105 | break; |
106 | } | 106 | } |
107 | snd_soc_dapm_sync_endpoints(codec); | 107 | snd_soc_dapm_sync(codec); |
108 | } | 108 | } |
109 | 109 | ||
110 | static int spitz_startup(struct snd_pcm_substream *substream) | 110 | static int spitz_startup(struct snd_pcm_substream *substream) |
@@ -291,13 +291,13 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec) | |||
291 | int i, err; | 291 | int i, err; |
292 | 292 | ||
293 | /* NC codec pins */ | 293 | /* NC codec pins */ |
294 | snd_soc_dapm_set_endpoint(codec, "RINPUT1", 0); | 294 | snd_soc_dapm_disable_pin(codec, "RINPUT1"); |
295 | snd_soc_dapm_set_endpoint(codec, "LINPUT2", 0); | 295 | snd_soc_dapm_disable_pin(codec, "LINPUT2"); |
296 | snd_soc_dapm_set_endpoint(codec, "RINPUT2", 0); | 296 | snd_soc_dapm_disable_pin(codec, "RINPUT2"); |
297 | snd_soc_dapm_set_endpoint(codec, "LINPUT3", 0); | 297 | snd_soc_dapm_disable_pin(codec, "LINPUT3"); |
298 | snd_soc_dapm_set_endpoint(codec, "RINPUT3", 0); | 298 | snd_soc_dapm_disable_pin(codec, "RINPUT3"); |
299 | snd_soc_dapm_set_endpoint(codec, "OUT3", 0); | 299 | snd_soc_dapm_disable_pin(codec, "OUT3"); |
300 | snd_soc_dapm_set_endpoint(codec, "MONO", 0); | 300 | snd_soc_dapm_disable_pin(codec, "MONO"); |
301 | 301 | ||
302 | /* Add spitz specific controls */ | 302 | /* Add spitz specific controls */ |
303 | for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) { | 303 | for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) { |
@@ -314,7 +314,7 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec) | |||
314 | /* Set up spitz specific audio paths */ | 314 | /* Set up spitz specific audio paths */ |
315 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 315 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); |
316 | 316 | ||
317 | snd_soc_dapm_sync_endpoints(codec); | 317 | snd_soc_dapm_sync(codec); |
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
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 | ||
53 | static void tosa_ext_control(struct snd_soc_codec *codec) | 53 | static 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 | ||
80 | static int tosa_startup(struct snd_pcm_substream *substream) | 82 | static 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 | ||