aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/poodle.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/poodle.c')
-rw-r--r--sound/soc/pxa/poodle.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index af84ee9c5e11..7353ee5034fe 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -46,6 +46,8 @@ static int poodle_spk_func;
46 46
47static void poodle_ext_control(struct snd_soc_codec *codec) 47static void poodle_ext_control(struct snd_soc_codec *codec)
48{ 48{
49 struct snd_soc_dapm_context *dapm = &codec->dapm;
50
49 /* set up jack connection */ 51 /* set up jack connection */
50 if (poodle_jack_func == POODLE_HP) { 52 if (poodle_jack_func == POODLE_HP) {
51 /* set = unmute headphone */ 53 /* set = unmute headphone */
@@ -53,23 +55,23 @@ static void poodle_ext_control(struct snd_soc_codec *codec)
53 POODLE_LOCOMO_GPIO_MUTE_L, 1); 55 POODLE_LOCOMO_GPIO_MUTE_L, 1);
54 locomo_gpio_write(&poodle_locomo_device.dev, 56 locomo_gpio_write(&poodle_locomo_device.dev,
55 POODLE_LOCOMO_GPIO_MUTE_R, 1); 57 POODLE_LOCOMO_GPIO_MUTE_R, 1);
56 snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 58 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
57 } else { 59 } else {
58 locomo_gpio_write(&poodle_locomo_device.dev, 60 locomo_gpio_write(&poodle_locomo_device.dev,
59 POODLE_LOCOMO_GPIO_MUTE_L, 0); 61 POODLE_LOCOMO_GPIO_MUTE_L, 0);
60 locomo_gpio_write(&poodle_locomo_device.dev, 62 locomo_gpio_write(&poodle_locomo_device.dev,
61 POODLE_LOCOMO_GPIO_MUTE_R, 0); 63 POODLE_LOCOMO_GPIO_MUTE_R, 0);
62 snd_soc_dapm_disable_pin(codec, "Headphone Jack"); 64 snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
63 } 65 }
64 66
65 /* set the enpoints to their new connetion states */ 67 /* set the enpoints to their new connetion states */
66 if (poodle_spk_func == POODLE_SPK_ON) 68 if (poodle_spk_func == POODLE_SPK_ON)
67 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 69 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
68 else 70 else
69 snd_soc_dapm_disable_pin(codec, "Ext Spk"); 71 snd_soc_dapm_disable_pin(dapm, "Ext Spk");
70 72
71 /* signal a DAPM event */ 73 /* signal a DAPM event */
72 snd_soc_dapm_sync(codec); 74 snd_soc_dapm_sync(dapm);
73} 75}
74 76
75static int poodle_startup(struct snd_pcm_substream *substream) 77static int poodle_startup(struct snd_pcm_substream *substream)
@@ -239,11 +241,12 @@ static const struct snd_kcontrol_new wm8731_poodle_controls[] = {
239static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd) 241static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd)
240{ 242{
241 struct snd_soc_codec *codec = rtd->codec; 243 struct snd_soc_codec *codec = rtd->codec;
244 struct snd_soc_dapm_context *dapm = &codec->dapm;
242 int err; 245 int err;
243 246
244 snd_soc_dapm_nc_pin(codec, "LLINEIN"); 247 snd_soc_dapm_nc_pin(dapm, "LLINEIN");
245 snd_soc_dapm_nc_pin(codec, "RLINEIN"); 248 snd_soc_dapm_nc_pin(dapm, "RLINEIN");
246 snd_soc_dapm_enable_pin(codec, "MICIN"); 249 snd_soc_dapm_enable_pin(dapm, "MICIN");
247 250
248 /* Add poodle specific controls */ 251 /* Add poodle specific controls */
249 err = snd_soc_add_controls(codec, wm8731_poodle_controls, 252 err = snd_soc_add_controls(codec, wm8731_poodle_controls,
@@ -252,13 +255,13 @@ static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd)
252 return err; 255 return err;
253 256
254 /* Add poodle specific widgets */ 257 /* Add poodle specific widgets */
255 snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets, 258 snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets,
256 ARRAY_SIZE(wm8731_dapm_widgets)); 259 ARRAY_SIZE(wm8731_dapm_widgets));
257 260
258 /* Set up poodle specific audio path audio_map */ 261 /* Set up poodle specific audio path audio_map */
259 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 262 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
260 263
261 snd_soc_dapm_sync(codec); 264 snd_soc_dapm_sync(dapm);
262 return 0; 265 return 0;
263} 266}
264 267