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/poodle.c | |
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/poodle.c')
-rw-r--r-- | sound/soc/pxa/poodle.c | 24 |
1 files changed, 11 insertions, 13 deletions
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 | ||