aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/n810.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/omap/n810.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/omap/n810.c')
-rw-r--r--sound/soc/omap/n810.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 767b39f339a8..74f4599b4d7e 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -50,11 +50,22 @@ static int n810_dmic_func;
50 50
51static void n810_ext_control(struct snd_soc_codec *codec) 51static void n810_ext_control(struct snd_soc_codec *codec)
52{ 52{
53 snd_soc_dapm_set_endpoint(codec, "Ext Spk", n810_spk_func); 53 if (n810_spk_func)
54 snd_soc_dapm_set_endpoint(codec, "Headphone Jack", n810_jack_func); 54 snd_soc_dapm_enable_pin(codec, "Ext Spk");
55 snd_soc_dapm_set_endpoint(codec, "DMic", n810_dmic_func); 55 else
56 snd_soc_dapm_disable_pin(codec, "Ext Spk");
57
58 if (n810_jack_func)
59 snd_soc_dapm_enable_pin(codec, "Headphone Jack");
60 else
61 snd_soc_dapm_disable_pin(codec, "Headphone Jack");
62
63 if (n810_dmic_func)
64 snd_soc_dapm_enable_pin(codec, "DMic");
65 else
66 snd_soc_dapm_disable_pin(codec, "DMic);
56 67
57 snd_soc_dapm_sync_endpoints(codec); 68 snd_soc_dapm_sync(codec);
58} 69}
59 70
60static int n810_startup(struct snd_pcm_substream *substream) 71static int n810_startup(struct snd_pcm_substream *substream)
@@ -236,9 +247,9 @@ static int n810_aic33_init(struct snd_soc_codec *codec)
236 int i, err; 247 int i, err;
237 248
238 /* Not connected */ 249 /* Not connected */
239 snd_soc_dapm_set_endpoint(codec, "MONO_LOUT", 0); 250 snd_soc_dapm_disable_pin(codec, "MONO_LOUT");
240 snd_soc_dapm_set_endpoint(codec, "HPLCOM", 0); 251 snd_soc_dapm_disable_pin(codec, "HPLCOM");
241 snd_soc_dapm_set_endpoint(codec, "HPRCOM", 0); 252 snd_soc_dapm_disable_pin(codec, "HPRCOM");
242 253
243 /* Add N810 specific controls */ 254 /* Add N810 specific controls */
244 for (i = 0; i < ARRAY_SIZE(aic33_n810_controls); i++) { 255 for (i = 0; i < ARRAY_SIZE(aic33_n810_controls); i++) {
@@ -255,7 +266,7 @@ static int n810_aic33_init(struct snd_soc_codec *codec)
255 /* Set up N810 specific audio path audio_map */ 266 /* Set up N810 specific audio path audio_map */
256 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 267 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
257 268
258 snd_soc_dapm_sync_endpoints(codec); 269 snd_soc_dapm_sync(codec);
259 270
260 return 0; 271 return 0;
261} 272}