aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/spitz.c
diff options
context:
space:
mode:
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>2008-07-07 08:35:17 -0400
committerJaroslav Kysela <perex@perex.cz>2008-07-10 03:32:30 -0400
commita5302181e5321664047f75715242aac4e0bbd17c (patch)
treeeb5b8a618062099981b65eeaca4cdb9b1fe7c826 /sound/soc/pxa/spitz.c
parentbe321a890c25272965129ffe4b3b59a519fcf583 (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/spitz.c')
-rw-r--r--sound/soc/pxa/spitz.c62
1 files changed, 31 insertions, 31 deletions
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;
51static void spitz_ext_control(struct snd_soc_codec *codec) 51static 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
110static int spitz_startup(struct snd_pcm_substream *substream) 110static 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