diff options
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r-- | sound/soc/pxa/corgi.c | 51 | ||||
-rw-r--r-- | sound/soc/pxa/e740_wm9705.c | 29 | ||||
-rw-r--r-- | sound/soc/pxa/e750_wm9705.c | 29 | ||||
-rw-r--r-- | sound/soc/pxa/e800_wm9712.c | 7 | ||||
-rw-r--r-- | sound/soc/pxa/magician.c | 35 | ||||
-rw-r--r-- | sound/soc/pxa/mioa701_wm9713.c | 17 | ||||
-rw-r--r-- | sound/soc/pxa/palm27x.c | 33 | ||||
-rw-r--r-- | sound/soc/pxa/poodle.c | 25 | ||||
-rw-r--r-- | sound/soc/pxa/saarb.c | 17 | ||||
-rw-r--r-- | sound/soc/pxa/spitz.c | 69 | ||||
-rw-r--r-- | sound/soc/pxa/tavorevb3.c | 17 | ||||
-rw-r--r-- | sound/soc/pxa/tosa.c | 37 | ||||
-rw-r--r-- | sound/soc/pxa/z2.c | 15 | ||||
-rw-r--r-- | sound/soc/pxa/zylonite.c | 11 |
14 files changed, 208 insertions, 184 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index 97e9423615c9..810633cc3b6d 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -48,51 +48,53 @@ static int corgi_spk_func; | |||
48 | 48 | ||
49 | static void corgi_ext_control(struct snd_soc_codec *codec) | 49 | static void corgi_ext_control(struct snd_soc_codec *codec) |
50 | { | 50 | { |
51 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
52 | |||
51 | /* set up jack connection */ | 53 | /* set up jack connection */ |
52 | switch (corgi_jack_func) { | 54 | switch (corgi_jack_func) { |
53 | case CORGI_HP: | 55 | case CORGI_HP: |
54 | /* set = unmute headphone */ | 56 | /* set = unmute headphone */ |
55 | gpio_set_value(CORGI_GPIO_MUTE_L, 1); | 57 | gpio_set_value(CORGI_GPIO_MUTE_L, 1); |
56 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); | 58 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); |
57 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 59 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
58 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 60 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
59 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 61 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
60 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 62 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
61 | break; | 63 | break; |
62 | case CORGI_MIC: | 64 | case CORGI_MIC: |
63 | /* reset = mute headphone */ | 65 | /* reset = mute headphone */ |
64 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); | 66 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); |
65 | gpio_set_value(CORGI_GPIO_MUTE_R, 0); | 67 | gpio_set_value(CORGI_GPIO_MUTE_R, 0); |
66 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 68 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
67 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 69 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
68 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 70 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
69 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 71 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
70 | break; | 72 | break; |
71 | case CORGI_LINE: | 73 | case CORGI_LINE: |
72 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); | 74 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); |
73 | gpio_set_value(CORGI_GPIO_MUTE_R, 0); | 75 | gpio_set_value(CORGI_GPIO_MUTE_R, 0); |
74 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 76 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
75 | snd_soc_dapm_enable_pin(codec, "Line Jack"); | 77 | snd_soc_dapm_enable_pin(dapm, "Line Jack"); |
76 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 78 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
77 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 79 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
78 | break; | 80 | break; |
79 | case CORGI_HEADSET: | 81 | case CORGI_HEADSET: |
80 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); | 82 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); |
81 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); | 83 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); |
82 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 84 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
83 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 85 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
84 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 86 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
85 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | 87 | snd_soc_dapm_enable_pin(dapm, "Headset Jack"); |
86 | break; | 88 | break; |
87 | } | 89 | } |
88 | 90 | ||
89 | if (corgi_spk_func == CORGI_SPK_ON) | 91 | if (corgi_spk_func == CORGI_SPK_ON) |
90 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); | 92 | snd_soc_dapm_enable_pin(dapm, "Ext Spk"); |
91 | else | 93 | else |
92 | snd_soc_dapm_disable_pin(codec, "Ext Spk"); | 94 | snd_soc_dapm_disable_pin(dapm, "Ext Spk"); |
93 | 95 | ||
94 | /* signal a DAPM event */ | 96 | /* signal a DAPM event */ |
95 | snd_soc_dapm_sync(codec); | 97 | snd_soc_dapm_sync(dapm); |
96 | } | 98 | } |
97 | 99 | ||
98 | static int corgi_startup(struct snd_pcm_substream *substream) | 100 | static int corgi_startup(struct snd_pcm_substream *substream) |
@@ -274,10 +276,11 @@ static const struct snd_kcontrol_new wm8731_corgi_controls[] = { | |||
274 | static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd) | 276 | static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd) |
275 | { | 277 | { |
276 | struct snd_soc_codec *codec = rtd->codec; | 278 | struct snd_soc_codec *codec = rtd->codec; |
279 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
277 | int err; | 280 | int err; |
278 | 281 | ||
279 | snd_soc_dapm_nc_pin(codec, "LLINEIN"); | 282 | snd_soc_dapm_nc_pin(dapm, "LLINEIN"); |
280 | snd_soc_dapm_nc_pin(codec, "RLINEIN"); | 283 | snd_soc_dapm_nc_pin(dapm, "RLINEIN"); |
281 | 284 | ||
282 | /* Add corgi specific controls */ | 285 | /* Add corgi specific controls */ |
283 | err = snd_soc_add_controls(codec, wm8731_corgi_controls, | 286 | err = snd_soc_add_controls(codec, wm8731_corgi_controls, |
@@ -286,13 +289,13 @@ static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd) | |||
286 | return err; | 289 | return err; |
287 | 290 | ||
288 | /* Add corgi specific widgets */ | 291 | /* Add corgi specific widgets */ |
289 | snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets, | 292 | snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets, |
290 | ARRAY_SIZE(wm8731_dapm_widgets)); | 293 | ARRAY_SIZE(wm8731_dapm_widgets)); |
291 | 294 | ||
292 | /* Set up corgi specific audio path audio_map */ | 295 | /* Set up corgi specific audio path audio_map */ |
293 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 296 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
294 | 297 | ||
295 | snd_soc_dapm_sync(codec); | 298 | snd_soc_dapm_sync(dapm); |
296 | return 0; | 299 | return 0; |
297 | } | 300 | } |
298 | 301 | ||
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index c82cedb602fd..38a84b821ff4 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c | |||
@@ -92,23 +92,24 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
92 | static int e740_ac97_init(struct snd_soc_pcm_runtime *rtd) | 92 | static int e740_ac97_init(struct snd_soc_pcm_runtime *rtd) |
93 | { | 93 | { |
94 | struct snd_soc_codec *codec = rtd->codec; | 94 | struct snd_soc_codec *codec = rtd->codec; |
95 | 95 | struct snd_soc_dapm_context *dapm = &codec->dapm; | |
96 | snd_soc_dapm_nc_pin(codec, "HPOUTL"); | 96 | |
97 | snd_soc_dapm_nc_pin(codec, "HPOUTR"); | 97 | snd_soc_dapm_nc_pin(dapm, "HPOUTL"); |
98 | snd_soc_dapm_nc_pin(codec, "PHONE"); | 98 | snd_soc_dapm_nc_pin(dapm, "HPOUTR"); |
99 | snd_soc_dapm_nc_pin(codec, "LINEINL"); | 99 | snd_soc_dapm_nc_pin(dapm, "PHONE"); |
100 | snd_soc_dapm_nc_pin(codec, "LINEINR"); | 100 | snd_soc_dapm_nc_pin(dapm, "LINEINL"); |
101 | snd_soc_dapm_nc_pin(codec, "CDINL"); | 101 | snd_soc_dapm_nc_pin(dapm, "LINEINR"); |
102 | snd_soc_dapm_nc_pin(codec, "CDINR"); | 102 | snd_soc_dapm_nc_pin(dapm, "CDINL"); |
103 | snd_soc_dapm_nc_pin(codec, "PCBEEP"); | 103 | snd_soc_dapm_nc_pin(dapm, "CDINR"); |
104 | snd_soc_dapm_nc_pin(codec, "MIC2"); | 104 | snd_soc_dapm_nc_pin(dapm, "PCBEEP"); |
105 | 105 | snd_soc_dapm_nc_pin(dapm, "MIC2"); | |
106 | snd_soc_dapm_new_controls(codec, e740_dapm_widgets, | 106 | |
107 | snd_soc_dapm_new_controls(dapm, e740_dapm_widgets, | ||
107 | ARRAY_SIZE(e740_dapm_widgets)); | 108 | ARRAY_SIZE(e740_dapm_widgets)); |
108 | 109 | ||
109 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 110 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
110 | 111 | ||
111 | snd_soc_dapm_sync(codec); | 112 | snd_soc_dapm_sync(dapm); |
112 | 113 | ||
113 | return 0; | 114 | return 0; |
114 | } | 115 | } |
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index 4c143803a75e..2bc97e92446b 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c | |||
@@ -74,23 +74,24 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
74 | static int e750_ac97_init(struct snd_soc_pcm_runtime *rtd) | 74 | static int e750_ac97_init(struct snd_soc_pcm_runtime *rtd) |
75 | { | 75 | { |
76 | struct snd_soc_codec *codec = rtd->codec; | 76 | struct snd_soc_codec *codec = rtd->codec; |
77 | 77 | struct snd_soc_dapm_context *dapm = &codec->dapm; | |
78 | snd_soc_dapm_nc_pin(codec, "LOUT"); | 78 | |
79 | snd_soc_dapm_nc_pin(codec, "ROUT"); | 79 | snd_soc_dapm_nc_pin(dapm, "LOUT"); |
80 | snd_soc_dapm_nc_pin(codec, "PHONE"); | 80 | snd_soc_dapm_nc_pin(dapm, "ROUT"); |
81 | snd_soc_dapm_nc_pin(codec, "LINEINL"); | 81 | snd_soc_dapm_nc_pin(dapm, "PHONE"); |
82 | snd_soc_dapm_nc_pin(codec, "LINEINR"); | 82 | snd_soc_dapm_nc_pin(dapm, "LINEINL"); |
83 | snd_soc_dapm_nc_pin(codec, "CDINL"); | 83 | snd_soc_dapm_nc_pin(dapm, "LINEINR"); |
84 | snd_soc_dapm_nc_pin(codec, "CDINR"); | 84 | snd_soc_dapm_nc_pin(dapm, "CDINL"); |
85 | snd_soc_dapm_nc_pin(codec, "PCBEEP"); | 85 | snd_soc_dapm_nc_pin(dapm, "CDINR"); |
86 | snd_soc_dapm_nc_pin(codec, "MIC2"); | 86 | snd_soc_dapm_nc_pin(dapm, "PCBEEP"); |
87 | 87 | snd_soc_dapm_nc_pin(dapm, "MIC2"); | |
88 | snd_soc_dapm_new_controls(codec, e750_dapm_widgets, | 88 | |
89 | snd_soc_dapm_new_controls(dapm, e750_dapm_widgets, | ||
89 | ARRAY_SIZE(e750_dapm_widgets)); | 90 | ARRAY_SIZE(e750_dapm_widgets)); |
90 | 91 | ||
91 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 92 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
92 | 93 | ||
93 | snd_soc_dapm_sync(codec); | 94 | snd_soc_dapm_sync(dapm); |
94 | 95 | ||
95 | return 0; | 96 | return 0; |
96 | } | 97 | } |
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index d42e5fe832c5..eac846c7bd9c 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c | |||
@@ -75,12 +75,13 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
75 | static int e800_ac97_init(struct snd_soc_pcm_runtime *rtd) | 75 | static int e800_ac97_init(struct snd_soc_pcm_runtime *rtd) |
76 | { | 76 | { |
77 | struct snd_soc_codec *codec = rtd->codec; | 77 | struct snd_soc_codec *codec = rtd->codec; |
78 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
78 | 79 | ||
79 | snd_soc_dapm_new_controls(codec, e800_dapm_widgets, | 80 | snd_soc_dapm_new_controls(dapm, e800_dapm_widgets, |
80 | ARRAY_SIZE(e800_dapm_widgets)); | 81 | ARRAY_SIZE(e800_dapm_widgets)); |
81 | 82 | ||
82 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 83 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
83 | snd_soc_dapm_sync(codec); | 84 | snd_soc_dapm_sync(dapm); |
84 | 85 | ||
85 | return 0; | 86 | return 0; |
86 | } | 87 | } |
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index b8207ced4072..f1acdc57cfd8 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c | |||
@@ -44,27 +44,29 @@ static int magician_in_sel = MAGICIAN_MIC; | |||
44 | 44 | ||
45 | static void magician_ext_control(struct snd_soc_codec *codec) | 45 | static void magician_ext_control(struct snd_soc_codec *codec) |
46 | { | 46 | { |
47 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
48 | |||
47 | if (magician_spk_switch) | 49 | if (magician_spk_switch) |
48 | snd_soc_dapm_enable_pin(codec, "Speaker"); | 50 | snd_soc_dapm_enable_pin(dapm, "Speaker"); |
49 | else | 51 | else |
50 | snd_soc_dapm_disable_pin(codec, "Speaker"); | 52 | snd_soc_dapm_disable_pin(dapm, "Speaker"); |
51 | if (magician_hp_switch) | 53 | if (magician_hp_switch) |
52 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 54 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
53 | else | 55 | else |
54 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 56 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
55 | 57 | ||
56 | switch (magician_in_sel) { | 58 | switch (magician_in_sel) { |
57 | case MAGICIAN_MIC: | 59 | case MAGICIAN_MIC: |
58 | snd_soc_dapm_disable_pin(codec, "Headset Mic"); | 60 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); |
59 | snd_soc_dapm_enable_pin(codec, "Call Mic"); | 61 | snd_soc_dapm_enable_pin(dapm, "Call Mic"); |
60 | break; | 62 | break; |
61 | case MAGICIAN_MIC_EXT: | 63 | case MAGICIAN_MIC_EXT: |
62 | snd_soc_dapm_disable_pin(codec, "Call Mic"); | 64 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); |
63 | snd_soc_dapm_enable_pin(codec, "Headset Mic"); | 65 | snd_soc_dapm_enable_pin(dapm, "Headset Mic"); |
64 | break; | 66 | break; |
65 | } | 67 | } |
66 | 68 | ||
67 | snd_soc_dapm_sync(codec); | 69 | snd_soc_dapm_sync(dapm); |
68 | } | 70 | } |
69 | 71 | ||
70 | static int magician_startup(struct snd_pcm_substream *substream) | 72 | static int magician_startup(struct snd_pcm_substream *substream) |
@@ -395,15 +397,16 @@ static const struct snd_kcontrol_new uda1380_magician_controls[] = { | |||
395 | static int magician_uda1380_init(struct snd_soc_pcm_runtime *rtd) | 397 | static int magician_uda1380_init(struct snd_soc_pcm_runtime *rtd) |
396 | { | 398 | { |
397 | struct snd_soc_codec *codec = rtd->codec; | 399 | struct snd_soc_codec *codec = rtd->codec; |
400 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
398 | int err; | 401 | int err; |
399 | 402 | ||
400 | /* NC codec pins */ | 403 | /* NC codec pins */ |
401 | snd_soc_dapm_nc_pin(codec, "VOUTLHP"); | 404 | snd_soc_dapm_nc_pin(dapm, "VOUTLHP"); |
402 | snd_soc_dapm_nc_pin(codec, "VOUTRHP"); | 405 | snd_soc_dapm_nc_pin(dapm, "VOUTRHP"); |
403 | 406 | ||
404 | /* FIXME: is anything connected here? */ | 407 | /* FIXME: is anything connected here? */ |
405 | snd_soc_dapm_nc_pin(codec, "VINL"); | 408 | snd_soc_dapm_nc_pin(dapm, "VINL"); |
406 | snd_soc_dapm_nc_pin(codec, "VINR"); | 409 | snd_soc_dapm_nc_pin(dapm, "VINR"); |
407 | 410 | ||
408 | /* Add magician specific controls */ | 411 | /* Add magician specific controls */ |
409 | err = snd_soc_add_controls(codec, uda1380_magician_controls, | 412 | err = snd_soc_add_controls(codec, uda1380_magician_controls, |
@@ -412,13 +415,13 @@ static int magician_uda1380_init(struct snd_soc_pcm_runtime *rtd) | |||
412 | return err; | 415 | return err; |
413 | 416 | ||
414 | /* Add magician specific widgets */ | 417 | /* Add magician specific widgets */ |
415 | snd_soc_dapm_new_controls(codec, uda1380_dapm_widgets, | 418 | snd_soc_dapm_new_controls(dapm, uda1380_dapm_widgets, |
416 | ARRAY_SIZE(uda1380_dapm_widgets)); | 419 | ARRAY_SIZE(uda1380_dapm_widgets)); |
417 | 420 | ||
418 | /* Set up magician specific audio path interconnects */ | 421 | /* Set up magician specific audio path interconnects */ |
419 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 422 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
420 | 423 | ||
421 | snd_soc_dapm_sync(codec); | 424 | snd_soc_dapm_sync(dapm); |
422 | return 0; | 425 | return 0; |
423 | } | 426 | } |
424 | 427 | ||
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index f284cc54bc80..f7a1e8f09f9a 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c | |||
@@ -130,13 +130,14 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
130 | static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd) | 130 | static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd) |
131 | { | 131 | { |
132 | struct snd_soc_codec *codec = rtd->codec; | 132 | struct snd_soc_codec *codec = rtd->codec; |
133 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
133 | unsigned short reg; | 134 | unsigned short reg; |
134 | 135 | ||
135 | /* Add mioa701 specific widgets */ | 136 | /* Add mioa701 specific widgets */ |
136 | snd_soc_dapm_new_controls(codec, ARRAY_AND_SIZE(mioa701_dapm_widgets)); | 137 | snd_soc_dapm_new_controls(dapm, ARRAY_AND_SIZE(mioa701_dapm_widgets)); |
137 | 138 | ||
138 | /* Set up mioa701 specific audio path audio_mapnects */ | 139 | /* Set up mioa701 specific audio path audio_mapnects */ |
139 | snd_soc_dapm_add_routes(codec, ARRAY_AND_SIZE(audio_map)); | 140 | snd_soc_dapm_add_routes(dapm, ARRAY_AND_SIZE(audio_map)); |
140 | 141 | ||
141 | /* Prepare GPIO8 for rear speaker amplifier */ | 142 | /* Prepare GPIO8 for rear speaker amplifier */ |
142 | reg = codec->driver->read(codec, AC97_GPIO_CFG); | 143 | reg = codec->driver->read(codec, AC97_GPIO_CFG); |
@@ -146,12 +147,12 @@ static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd) | |||
146 | reg = codec->driver->read(codec, AC97_3D_CONTROL); | 147 | reg = codec->driver->read(codec, AC97_3D_CONTROL); |
147 | codec->driver->write(codec, AC97_3D_CONTROL, reg | 0xc000); | 148 | codec->driver->write(codec, AC97_3D_CONTROL, reg | 0xc000); |
148 | 149 | ||
149 | snd_soc_dapm_enable_pin(codec, "Front Speaker"); | 150 | snd_soc_dapm_enable_pin(dapm, "Front Speaker"); |
150 | snd_soc_dapm_enable_pin(codec, "Rear Speaker"); | 151 | snd_soc_dapm_enable_pin(dapm, "Rear Speaker"); |
151 | snd_soc_dapm_enable_pin(codec, "Front Mic"); | 152 | snd_soc_dapm_enable_pin(dapm, "Front Mic"); |
152 | snd_soc_dapm_enable_pin(codec, "GSM Line In"); | 153 | snd_soc_dapm_enable_pin(dapm, "GSM Line In"); |
153 | snd_soc_dapm_enable_pin(codec, "GSM Line Out"); | 154 | snd_soc_dapm_enable_pin(dapm, "GSM Line Out"); |
154 | snd_soc_dapm_sync(codec); | 155 | snd_soc_dapm_sync(dapm); |
155 | 156 | ||
156 | return 0; | 157 | return 0; |
157 | } | 158 | } |
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 13f6d485d571..530064dd06a9 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c | |||
@@ -77,37 +77,38 @@ static struct snd_soc_card palm27x_asoc; | |||
77 | static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd) | 77 | static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd) |
78 | { | 78 | { |
79 | struct snd_soc_codec *codec = rtd->codec; | 79 | struct snd_soc_codec *codec = rtd->codec; |
80 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
80 | int err; | 81 | int err; |
81 | 82 | ||
82 | /* add palm27x specific widgets */ | 83 | /* add palm27x specific widgets */ |
83 | err = snd_soc_dapm_new_controls(codec, palm27x_dapm_widgets, | 84 | err = snd_soc_dapm_new_controls(dapm, palm27x_dapm_widgets, |
84 | ARRAY_SIZE(palm27x_dapm_widgets)); | 85 | ARRAY_SIZE(palm27x_dapm_widgets)); |
85 | if (err) | 86 | if (err) |
86 | return err; | 87 | return err; |
87 | 88 | ||
88 | /* set up palm27x specific audio path audio_map */ | 89 | /* set up palm27x specific audio path audio_map */ |
89 | err = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 90 | err = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
90 | if (err) | 91 | if (err) |
91 | return err; | 92 | return err; |
92 | 93 | ||
93 | /* connected pins */ | 94 | /* connected pins */ |
94 | if (machine_is_palmld()) | 95 | if (machine_is_palmld()) |
95 | snd_soc_dapm_enable_pin(codec, "MIC1"); | 96 | snd_soc_dapm_enable_pin(dapm, "MIC1"); |
96 | snd_soc_dapm_enable_pin(codec, "HPOUTL"); | 97 | snd_soc_dapm_enable_pin(dapm, "HPOUTL"); |
97 | snd_soc_dapm_enable_pin(codec, "HPOUTR"); | 98 | snd_soc_dapm_enable_pin(dapm, "HPOUTR"); |
98 | snd_soc_dapm_enable_pin(codec, "LOUT2"); | 99 | snd_soc_dapm_enable_pin(dapm, "LOUT2"); |
99 | snd_soc_dapm_enable_pin(codec, "ROUT2"); | 100 | snd_soc_dapm_enable_pin(dapm, "ROUT2"); |
100 | 101 | ||
101 | /* not connected pins */ | 102 | /* not connected pins */ |
102 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 103 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
103 | snd_soc_dapm_nc_pin(codec, "MONOOUT"); | 104 | snd_soc_dapm_nc_pin(dapm, "MONOOUT"); |
104 | snd_soc_dapm_nc_pin(codec, "LINEINL"); | 105 | snd_soc_dapm_nc_pin(dapm, "LINEINL"); |
105 | snd_soc_dapm_nc_pin(codec, "LINEINR"); | 106 | snd_soc_dapm_nc_pin(dapm, "LINEINR"); |
106 | snd_soc_dapm_nc_pin(codec, "PCBEEP"); | 107 | snd_soc_dapm_nc_pin(dapm, "PCBEEP"); |
107 | snd_soc_dapm_nc_pin(codec, "PHONE"); | 108 | snd_soc_dapm_nc_pin(dapm, "PHONE"); |
108 | snd_soc_dapm_nc_pin(codec, "MIC2"); | 109 | snd_soc_dapm_nc_pin(dapm, "MIC2"); |
109 | 110 | ||
110 | err = snd_soc_dapm_sync(codec); | 111 | err = snd_soc_dapm_sync(dapm); |
111 | if (err) | 112 | if (err) |
112 | return err; | 113 | return err; |
113 | 114 | ||
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 | ||
47 | static void poodle_ext_control(struct snd_soc_codec *codec) | 47 | static 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 | ||
75 | static int poodle_startup(struct snd_pcm_substream *substream) | 77 | static int poodle_startup(struct snd_pcm_substream *substream) |
@@ -239,11 +241,12 @@ static const struct snd_kcontrol_new wm8731_poodle_controls[] = { | |||
239 | static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd) | 241 | static 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 | ||
diff --git a/sound/soc/pxa/saarb.c b/sound/soc/pxa/saarb.c index d63cb474b4e1..ee06f9982c09 100644 --- a/sound/soc/pxa/saarb.c +++ b/sound/soc/pxa/saarb.c | |||
@@ -133,20 +133,21 @@ static struct snd_soc_card snd_soc_card_saarb = { | |||
133 | static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd) | 133 | static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd) |
134 | { | 134 | { |
135 | struct snd_soc_codec *codec = rtd->codec; | 135 | struct snd_soc_codec *codec = rtd->codec; |
136 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
136 | int ret; | 137 | int ret; |
137 | 138 | ||
138 | snd_soc_dapm_new_controls(codec, saarb_dapm_widgets, | 139 | snd_soc_dapm_new_controls(dapm, saarb_dapm_widgets, |
139 | ARRAY_SIZE(saarb_dapm_widgets)); | 140 | ARRAY_SIZE(saarb_dapm_widgets)); |
140 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 141 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
141 | 142 | ||
142 | /* connected pins */ | 143 | /* connected pins */ |
143 | snd_soc_dapm_enable_pin(codec, "Ext Speaker"); | 144 | snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); |
144 | snd_soc_dapm_enable_pin(codec, "Ext Mic 1"); | 145 | snd_soc_dapm_enable_pin(dapm, "Ext Mic 1"); |
145 | snd_soc_dapm_enable_pin(codec, "Ext Mic 3"); | 146 | snd_soc_dapm_enable_pin(dapm, "Ext Mic 3"); |
146 | snd_soc_dapm_disable_pin(codec, "Headset Mic 2"); | 147 | snd_soc_dapm_disable_pin(dapm, "Headset Mic 2"); |
147 | snd_soc_dapm_disable_pin(codec, "Headset Stereophone"); | 148 | snd_soc_dapm_disable_pin(dapm, "Headset Stereophone"); |
148 | 149 | ||
149 | ret = snd_soc_dapm_sync(codec); | 150 | ret = snd_soc_dapm_sync(dapm); |
150 | if (ret) | 151 | if (ret) |
151 | return ret; | 152 | return ret; |
152 | 153 | ||
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index f470f360f4dd..0680b11c2685 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -46,61 +46,63 @@ static int spitz_spk_func; | |||
46 | 46 | ||
47 | static void spitz_ext_control(struct snd_soc_codec *codec) | 47 | static void spitz_ext_control(struct snd_soc_codec *codec) |
48 | { | 48 | { |
49 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
50 | |||
49 | if (spitz_spk_func == SPITZ_SPK_ON) | 51 | if (spitz_spk_func == SPITZ_SPK_ON) |
50 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); | 52 | snd_soc_dapm_enable_pin(dapm, "Ext Spk"); |
51 | else | 53 | else |
52 | snd_soc_dapm_disable_pin(codec, "Ext Spk"); | 54 | snd_soc_dapm_disable_pin(dapm, "Ext Spk"); |
53 | 55 | ||
54 | /* set up jack connection */ | 56 | /* set up jack connection */ |
55 | switch (spitz_jack_func) { | 57 | switch (spitz_jack_func) { |
56 | case SPITZ_HP: | 58 | case SPITZ_HP: |
57 | /* enable and unmute hp jack, disable mic bias */ | 59 | /* enable and unmute hp jack, disable mic bias */ |
58 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 60 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
59 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 61 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
60 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 62 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
61 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 63 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
62 | gpio_set_value(SPITZ_GPIO_MUTE_L, 1); | 64 | gpio_set_value(SPITZ_GPIO_MUTE_L, 1); |
63 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); | 65 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); |
64 | break; | 66 | break; |
65 | case SPITZ_MIC: | 67 | case SPITZ_MIC: |
66 | /* enable mic jack and bias, mute hp */ | 68 | /* enable mic jack and bias, mute hp */ |
67 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 69 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
68 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 70 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
69 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 71 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
70 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 72 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
71 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 73 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
72 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); | 74 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
73 | break; | 75 | break; |
74 | case SPITZ_LINE: | 76 | case SPITZ_LINE: |
75 | /* enable line jack, disable mic bias and mute hp */ | 77 | /* enable line jack, disable mic bias and mute hp */ |
76 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 78 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
77 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 79 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
78 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 80 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
79 | snd_soc_dapm_enable_pin(codec, "Line Jack"); | 81 | snd_soc_dapm_enable_pin(dapm, "Line Jack"); |
80 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 82 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
81 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); | 83 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
82 | break; | 84 | break; |
83 | case SPITZ_HEADSET: | 85 | case SPITZ_HEADSET: |
84 | /* enable and unmute headset jack enable mic bias, mute L hp */ | 86 | /* enable and unmute headset jack enable mic bias, mute L hp */ |
85 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 87 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
86 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 88 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
87 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 89 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
88 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | 90 | snd_soc_dapm_enable_pin(dapm, "Headset Jack"); |
89 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 91 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
90 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); | 92 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); |
91 | break; | 93 | break; |
92 | case SPITZ_HP_OFF: | 94 | case SPITZ_HP_OFF: |
93 | 95 | ||
94 | /* jack removed, everything off */ | 96 | /* jack removed, everything off */ |
95 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 97 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
96 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 98 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
97 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 99 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
98 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 100 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
99 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 101 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
100 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); | 102 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
101 | break; | 103 | break; |
102 | } | 104 | } |
103 | snd_soc_dapm_sync(codec); | 105 | snd_soc_dapm_sync(dapm); |
104 | } | 106 | } |
105 | 107 | ||
106 | static int spitz_startup(struct snd_pcm_substream *substream) | 108 | static int spitz_startup(struct snd_pcm_substream *substream) |
@@ -276,16 +278,17 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = { | |||
276 | static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | 278 | static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) |
277 | { | 279 | { |
278 | struct snd_soc_codec *codec = rtd->codec; | 280 | struct snd_soc_codec *codec = rtd->codec; |
281 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
279 | int err; | 282 | int err; |
280 | 283 | ||
281 | /* NC codec pins */ | 284 | /* NC codec pins */ |
282 | snd_soc_dapm_nc_pin(codec, "RINPUT1"); | 285 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); |
283 | snd_soc_dapm_nc_pin(codec, "LINPUT2"); | 286 | snd_soc_dapm_nc_pin(dapm, "LINPUT2"); |
284 | snd_soc_dapm_nc_pin(codec, "RINPUT2"); | 287 | snd_soc_dapm_nc_pin(dapm, "RINPUT2"); |
285 | snd_soc_dapm_nc_pin(codec, "LINPUT3"); | 288 | snd_soc_dapm_nc_pin(dapm, "LINPUT3"); |
286 | snd_soc_dapm_nc_pin(codec, "RINPUT3"); | 289 | snd_soc_dapm_nc_pin(dapm, "RINPUT3"); |
287 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 290 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
288 | snd_soc_dapm_nc_pin(codec, "MONO1"); | 291 | snd_soc_dapm_nc_pin(dapm, "MONO1"); |
289 | 292 | ||
290 | /* Add spitz specific controls */ | 293 | /* Add spitz specific controls */ |
291 | err = snd_soc_add_controls(codec, wm8750_spitz_controls, | 294 | err = snd_soc_add_controls(codec, wm8750_spitz_controls, |
@@ -294,13 +297,13 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
294 | return err; | 297 | return err; |
295 | 298 | ||
296 | /* Add spitz specific widgets */ | 299 | /* Add spitz specific widgets */ |
297 | snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets, | 300 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, |
298 | ARRAY_SIZE(wm8750_dapm_widgets)); | 301 | ARRAY_SIZE(wm8750_dapm_widgets)); |
299 | 302 | ||
300 | /* Set up spitz specific audio paths */ | 303 | /* Set up spitz specific audio paths */ |
301 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 304 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
302 | 305 | ||
303 | snd_soc_dapm_sync(codec); | 306 | snd_soc_dapm_sync(dapm); |
304 | return 0; | 307 | return 0; |
305 | } | 308 | } |
306 | 309 | ||
diff --git a/sound/soc/pxa/tavorevb3.c b/sound/soc/pxa/tavorevb3.c index 248c283fc4df..18cbe0e7c223 100644 --- a/sound/soc/pxa/tavorevb3.c +++ b/sound/soc/pxa/tavorevb3.c | |||
@@ -133,20 +133,21 @@ static struct snd_soc_card snd_soc_card_evb3 = { | |||
133 | static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd) | 133 | static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd) |
134 | { | 134 | { |
135 | struct snd_soc_codec *codec = rtd->codec; | 135 | struct snd_soc_codec *codec = rtd->codec; |
136 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
136 | int ret; | 137 | int ret; |
137 | 138 | ||
138 | snd_soc_dapm_new_controls(codec, evb3_dapm_widgets, | 139 | snd_soc_dapm_new_controls(dapm, evb3_dapm_widgets, |
139 | ARRAY_SIZE(evb3_dapm_widgets)); | 140 | ARRAY_SIZE(evb3_dapm_widgets)); |
140 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 141 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
141 | 142 | ||
142 | /* connected pins */ | 143 | /* connected pins */ |
143 | snd_soc_dapm_enable_pin(codec, "Ext Speaker"); | 144 | snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); |
144 | snd_soc_dapm_enable_pin(codec, "Ext Mic 1"); | 145 | snd_soc_dapm_enable_pin(dapm, "Ext Mic 1"); |
145 | snd_soc_dapm_enable_pin(codec, "Ext Mic 3"); | 146 | snd_soc_dapm_enable_pin(dapm, "Ext Mic 3"); |
146 | snd_soc_dapm_disable_pin(codec, "Headset Mic 2"); | 147 | snd_soc_dapm_disable_pin(dapm, "Headset Mic 2"); |
147 | snd_soc_dapm_disable_pin(codec, "Headset Stereophone"); | 148 | snd_soc_dapm_disable_pin(dapm, "Headset Stereophone"); |
148 | 149 | ||
149 | ret = snd_soc_dapm_sync(codec); | 150 | ret = snd_soc_dapm_sync(dapm); |
150 | if (ret) | 151 | if (ret) |
151 | return ret; | 152 | return ret; |
152 | 153 | ||
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index 73d0edd8ded9..0a9bd68ef749 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
@@ -49,31 +49,33 @@ static int tosa_spk_func; | |||
49 | 49 | ||
50 | static void tosa_ext_control(struct snd_soc_codec *codec) | 50 | static void tosa_ext_control(struct snd_soc_codec *codec) |
51 | { | 51 | { |
52 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
53 | |||
52 | /* set up jack connection */ | 54 | /* set up jack connection */ |
53 | switch (tosa_jack_func) { | 55 | switch (tosa_jack_func) { |
54 | case TOSA_HP: | 56 | case TOSA_HP: |
55 | snd_soc_dapm_disable_pin(codec, "Mic (Internal)"); | 57 | snd_soc_dapm_disable_pin(dapm, "Mic (Internal)"); |
56 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 58 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
57 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 59 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
58 | break; | 60 | break; |
59 | case TOSA_MIC_INT: | 61 | case TOSA_MIC_INT: |
60 | snd_soc_dapm_enable_pin(codec, "Mic (Internal)"); | 62 | snd_soc_dapm_enable_pin(dapm, "Mic (Internal)"); |
61 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 63 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
62 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 64 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
63 | break; | 65 | break; |
64 | case TOSA_HEADSET: | 66 | case TOSA_HEADSET: |
65 | snd_soc_dapm_disable_pin(codec, "Mic (Internal)"); | 67 | snd_soc_dapm_disable_pin(dapm, "Mic (Internal)"); |
66 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 68 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
67 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | 69 | snd_soc_dapm_enable_pin(dapm, "Headset Jack"); |
68 | break; | 70 | break; |
69 | } | 71 | } |
70 | 72 | ||
71 | if (tosa_spk_func == TOSA_SPK_ON) | 73 | if (tosa_spk_func == TOSA_SPK_ON) |
72 | snd_soc_dapm_enable_pin(codec, "Speaker"); | 74 | snd_soc_dapm_enable_pin(dapm, "Speaker"); |
73 | else | 75 | else |
74 | snd_soc_dapm_disable_pin(codec, "Speaker"); | 76 | snd_soc_dapm_disable_pin(dapm, "Speaker"); |
75 | 77 | ||
76 | snd_soc_dapm_sync(codec); | 78 | snd_soc_dapm_sync(dapm); |
77 | } | 79 | } |
78 | 80 | ||
79 | static int tosa_startup(struct snd_pcm_substream *substream) | 81 | static int tosa_startup(struct snd_pcm_substream *substream) |
@@ -186,10 +188,11 @@ static const struct snd_kcontrol_new tosa_controls[] = { | |||
186 | static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd) | 188 | static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd) |
187 | { | 189 | { |
188 | struct snd_soc_codec *codec = rtd->codec; | 190 | struct snd_soc_codec *codec = rtd->codec; |
191 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
189 | int err; | 192 | int err; |
190 | 193 | ||
191 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 194 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
192 | snd_soc_dapm_nc_pin(codec, "MONOOUT"); | 195 | snd_soc_dapm_nc_pin(dapm, "MONOOUT"); |
193 | 196 | ||
194 | /* add tosa specific controls */ | 197 | /* add tosa specific controls */ |
195 | err = snd_soc_add_controls(codec, tosa_controls, | 198 | err = snd_soc_add_controls(codec, tosa_controls, |
@@ -198,13 +201,13 @@ static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd) | |||
198 | return err; | 201 | return err; |
199 | 202 | ||
200 | /* add tosa specific widgets */ | 203 | /* add tosa specific widgets */ |
201 | snd_soc_dapm_new_controls(codec, tosa_dapm_widgets, | 204 | snd_soc_dapm_new_controls(dapm, tosa_dapm_widgets, |
202 | ARRAY_SIZE(tosa_dapm_widgets)); | 205 | ARRAY_SIZE(tosa_dapm_widgets)); |
203 | 206 | ||
204 | /* set up tosa specific audio path audio_map */ | 207 | /* set up tosa specific audio path audio_map */ |
205 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 208 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
206 | 209 | ||
207 | snd_soc_dapm_sync(codec); | 210 | snd_soc_dapm_sync(dapm); |
208 | return 0; | 211 | return 0; |
209 | } | 212 | } |
210 | 213 | ||
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index 4cc841b44182..cacbcd4a55eb 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c | |||
@@ -140,22 +140,23 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
140 | static int z2_wm8750_init(struct snd_soc_pcm_runtime *rtd) | 140 | static int z2_wm8750_init(struct snd_soc_pcm_runtime *rtd) |
141 | { | 141 | { |
142 | struct snd_soc_codec *codec = rtd->codec; | 142 | struct snd_soc_codec *codec = rtd->codec; |
143 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
143 | int ret; | 144 | int ret; |
144 | 145 | ||
145 | /* NC codec pins */ | 146 | /* NC codec pins */ |
146 | snd_soc_dapm_disable_pin(codec, "LINPUT3"); | 147 | snd_soc_dapm_disable_pin(dapm, "LINPUT3"); |
147 | snd_soc_dapm_disable_pin(codec, "RINPUT3"); | 148 | snd_soc_dapm_disable_pin(dapm, "RINPUT3"); |
148 | snd_soc_dapm_disable_pin(codec, "OUT3"); | 149 | snd_soc_dapm_disable_pin(dapm, "OUT3"); |
149 | snd_soc_dapm_disable_pin(codec, "MONO"); | 150 | snd_soc_dapm_disable_pin(dapm, "MONO"); |
150 | 151 | ||
151 | /* Add z2 specific widgets */ | 152 | /* Add z2 specific widgets */ |
152 | snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets, | 153 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, |
153 | ARRAY_SIZE(wm8750_dapm_widgets)); | 154 | ARRAY_SIZE(wm8750_dapm_widgets)); |
154 | 155 | ||
155 | /* Set up z2 specific audio paths */ | 156 | /* Set up z2 specific audio paths */ |
156 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 157 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
157 | 158 | ||
158 | ret = snd_soc_dapm_sync(codec); | 159 | ret = snd_soc_dapm_sync(dapm); |
159 | if (ret) | 160 | if (ret) |
160 | goto err; | 161 | goto err; |
161 | 162 | ||
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index d27e05af7759..c74eac30ebff 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c | |||
@@ -73,21 +73,22 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
73 | static int zylonite_wm9713_init(struct snd_soc_pcm_runtime *rtd) | 73 | static int zylonite_wm9713_init(struct snd_soc_pcm_runtime *rtd) |
74 | { | 74 | { |
75 | struct snd_soc_codec *codec = rtd->codec; | 75 | struct snd_soc_codec *codec = rtd->codec; |
76 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
76 | 77 | ||
77 | if (clk_pout) | 78 | if (clk_pout) |
78 | snd_soc_dai_set_pll(rtd->codec_dai, 0, 0, | 79 | snd_soc_dai_set_pll(rtd->codec_dai, 0, 0, |
79 | clk_get_rate(pout), 0); | 80 | clk_get_rate(pout), 0); |
80 | 81 | ||
81 | snd_soc_dapm_new_controls(codec, zylonite_dapm_widgets, | 82 | snd_soc_dapm_new_controls(dapm, zylonite_dapm_widgets, |
82 | ARRAY_SIZE(zylonite_dapm_widgets)); | 83 | ARRAY_SIZE(zylonite_dapm_widgets)); |
83 | 84 | ||
84 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 85 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
85 | 86 | ||
86 | /* Static setup for now */ | 87 | /* Static setup for now */ |
87 | snd_soc_dapm_enable_pin(codec, "Headphone"); | 88 | snd_soc_dapm_enable_pin(dapm, "Headphone"); |
88 | snd_soc_dapm_enable_pin(codec, "Headset Earpiece"); | 89 | snd_soc_dapm_enable_pin(dapm, "Headset Earpiece"); |
89 | 90 | ||
90 | snd_soc_dapm_sync(codec); | 91 | snd_soc_dapm_sync(dapm); |
91 | return 0; | 92 | return 0; |
92 | } | 93 | } |
93 | 94 | ||