aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/am3517evm.c14
-rw-r--r--sound/soc/omap/ams-delta.c82
-rw-r--r--sound/soc/omap/igep0020.c1
-rw-r--r--sound/soc/omap/n810.c44
-rw-r--r--sound/soc/omap/omap-mcbsp.c35
-rw-r--r--sound/soc/omap/omap-mcbsp.h4
-rw-r--r--sound/soc/omap/omap2evm.c1
-rw-r--r--sound/soc/omap/omap3beagle.c1
-rw-r--r--sound/soc/omap/omap3evm.c1
-rw-r--r--sound/soc/omap/omap3pandora.c45
-rw-r--r--sound/soc/omap/osk5912.c14
-rw-r--r--sound/soc/omap/overo.c1
-rw-r--r--sound/soc/omap/rx51.c27
-rw-r--r--sound/soc/omap/sdp3430.c44
-rw-r--r--sound/soc/omap/sdp4430.c57
-rw-r--r--sound/soc/omap/zoom2.c36
16 files changed, 238 insertions, 169 deletions
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index 979dd508305f..161750443ebc 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -22,7 +22,6 @@
22#include <sound/core.h> 22#include <sound/core.h>
23#include <sound/pcm.h> 23#include <sound/pcm.h>
24#include <sound/soc.h> 24#include <sound/soc.h>
25#include <sound/soc-dapm.h>
26 25
27#include <asm/mach-types.h> 26#include <asm/mach-types.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
@@ -114,20 +113,21 @@ static const struct snd_soc_dapm_route audio_map[] = {
114static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd) 113static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd)
115{ 114{
116 struct snd_soc_codec *codec = rtd->codec; 115 struct snd_soc_codec *codec = rtd->codec;
116 struct snd_soc_dapm_context *dapm = &codec->dapm;
117 117
118 /* Add am3517-evm specific widgets */ 118 /* Add am3517-evm specific widgets */
119 snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets, 119 snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
120 ARRAY_SIZE(tlv320aic23_dapm_widgets)); 120 ARRAY_SIZE(tlv320aic23_dapm_widgets));
121 121
122 /* Set up davinci-evm specific audio path audio_map */ 122 /* Set up davinci-evm specific audio path audio_map */
123 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 123 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
124 124
125 /* always connected */ 125 /* always connected */
126 snd_soc_dapm_enable_pin(codec, "Line Out"); 126 snd_soc_dapm_enable_pin(dapm, "Line Out");
127 snd_soc_dapm_enable_pin(codec, "Line In"); 127 snd_soc_dapm_enable_pin(dapm, "Line In");
128 snd_soc_dapm_enable_pin(codec, "Mic In"); 128 snd_soc_dapm_enable_pin(dapm, "Mic In");
129 129
130 snd_soc_dapm_sync(codec); 130 snd_soc_dapm_sync(dapm);
131 131
132 return 0; 132 return 0;
133} 133}
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 438146addbb8..2101bdcee21f 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -26,7 +26,7 @@
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/tty.h> 27#include <linux/tty.h>
28 28
29#include <sound/soc-dapm.h> 29#include <sound/soc.h>
30#include <sound/jack.h> 30#include <sound/jack.h>
31 31
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
@@ -94,6 +94,7 @@ static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol,
94 struct snd_ctl_elem_value *ucontrol) 94 struct snd_ctl_elem_value *ucontrol)
95{ 95{
96 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 96 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
97 struct snd_soc_dapm_context *dapm = &codec->dapm;
97 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value; 98 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value;
98 unsigned short pins; 99 unsigned short pins;
99 int pin, changed = 0; 100 int pin, changed = 0;
@@ -112,48 +113,48 @@ static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol,
112 113
113 /* Setup pins after corresponding bits if changed */ 114 /* Setup pins after corresponding bits if changed */
114 pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE)); 115 pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE));
115 if (pin != snd_soc_dapm_get_pin_status(codec, "Mouthpiece")) { 116 if (pin != snd_soc_dapm_get_pin_status(dapm, "Mouthpiece")) {
116 changed = 1; 117 changed = 1;
117 if (pin) 118 if (pin)
118 snd_soc_dapm_enable_pin(codec, "Mouthpiece"); 119 snd_soc_dapm_enable_pin(dapm, "Mouthpiece");
119 else 120 else
120 snd_soc_dapm_disable_pin(codec, "Mouthpiece"); 121 snd_soc_dapm_disable_pin(dapm, "Mouthpiece");
121 } 122 }
122 pin = !!(pins & (1 << AMS_DELTA_EARPIECE)); 123 pin = !!(pins & (1 << AMS_DELTA_EARPIECE));
123 if (pin != snd_soc_dapm_get_pin_status(codec, "Earpiece")) { 124 if (pin != snd_soc_dapm_get_pin_status(dapm, "Earpiece")) {
124 changed = 1; 125 changed = 1;
125 if (pin) 126 if (pin)
126 snd_soc_dapm_enable_pin(codec, "Earpiece"); 127 snd_soc_dapm_enable_pin(dapm, "Earpiece");
127 else 128 else
128 snd_soc_dapm_disable_pin(codec, "Earpiece"); 129 snd_soc_dapm_disable_pin(dapm, "Earpiece");
129 } 130 }
130 pin = !!(pins & (1 << AMS_DELTA_MICROPHONE)); 131 pin = !!(pins & (1 << AMS_DELTA_MICROPHONE));
131 if (pin != snd_soc_dapm_get_pin_status(codec, "Microphone")) { 132 if (pin != snd_soc_dapm_get_pin_status(dapm, "Microphone")) {
132 changed = 1; 133 changed = 1;
133 if (pin) 134 if (pin)
134 snd_soc_dapm_enable_pin(codec, "Microphone"); 135 snd_soc_dapm_enable_pin(dapm, "Microphone");
135 else 136 else
136 snd_soc_dapm_disable_pin(codec, "Microphone"); 137 snd_soc_dapm_disable_pin(dapm, "Microphone");
137 } 138 }
138 pin = !!(pins & (1 << AMS_DELTA_SPEAKER)); 139 pin = !!(pins & (1 << AMS_DELTA_SPEAKER));
139 if (pin != snd_soc_dapm_get_pin_status(codec, "Speaker")) { 140 if (pin != snd_soc_dapm_get_pin_status(dapm, "Speaker")) {
140 changed = 1; 141 changed = 1;
141 if (pin) 142 if (pin)
142 snd_soc_dapm_enable_pin(codec, "Speaker"); 143 snd_soc_dapm_enable_pin(dapm, "Speaker");
143 else 144 else
144 snd_soc_dapm_disable_pin(codec, "Speaker"); 145 snd_soc_dapm_disable_pin(dapm, "Speaker");
145 } 146 }
146 pin = !!(pins & (1 << AMS_DELTA_AGC)); 147 pin = !!(pins & (1 << AMS_DELTA_AGC));
147 if (pin != ams_delta_audio_agc) { 148 if (pin != ams_delta_audio_agc) {
148 ams_delta_audio_agc = pin; 149 ams_delta_audio_agc = pin;
149 changed = 1; 150 changed = 1;
150 if (pin) 151 if (pin)
151 snd_soc_dapm_enable_pin(codec, "AGCIN"); 152 snd_soc_dapm_enable_pin(dapm, "AGCIN");
152 else 153 else
153 snd_soc_dapm_disable_pin(codec, "AGCIN"); 154 snd_soc_dapm_disable_pin(dapm, "AGCIN");
154 } 155 }
155 if (changed) 156 if (changed)
156 snd_soc_dapm_sync(codec); 157 snd_soc_dapm_sync(dapm);
157 158
158 mutex_unlock(&codec->mutex); 159 mutex_unlock(&codec->mutex);
159 160
@@ -164,19 +165,20 @@ static int ams_delta_get_audio_mode(struct snd_kcontrol *kcontrol,
164 struct snd_ctl_elem_value *ucontrol) 165 struct snd_ctl_elem_value *ucontrol)
165{ 166{
166 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 167 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
168 struct snd_soc_dapm_context *dapm = &codec->dapm;
167 unsigned short pins, mode; 169 unsigned short pins, mode;
168 170
169 pins = ((snd_soc_dapm_get_pin_status(codec, "Mouthpiece") << 171 pins = ((snd_soc_dapm_get_pin_status(dapm, "Mouthpiece") <<
170 AMS_DELTA_MOUTHPIECE) | 172 AMS_DELTA_MOUTHPIECE) |
171 (snd_soc_dapm_get_pin_status(codec, "Earpiece") << 173 (snd_soc_dapm_get_pin_status(dapm, "Earpiece") <<
172 AMS_DELTA_EARPIECE)); 174 AMS_DELTA_EARPIECE));
173 if (pins) 175 if (pins)
174 pins |= (snd_soc_dapm_get_pin_status(codec, "Microphone") << 176 pins |= (snd_soc_dapm_get_pin_status(dapm, "Microphone") <<
175 AMS_DELTA_MICROPHONE); 177 AMS_DELTA_MICROPHONE);
176 else 178 else
177 pins = ((snd_soc_dapm_get_pin_status(codec, "Microphone") << 179 pins = ((snd_soc_dapm_get_pin_status(dapm, "Microphone") <<
178 AMS_DELTA_MICROPHONE) | 180 AMS_DELTA_MICROPHONE) |
179 (snd_soc_dapm_get_pin_status(codec, "Speaker") << 181 (snd_soc_dapm_get_pin_status(dapm, "Speaker") <<
180 AMS_DELTA_SPEAKER) | 182 AMS_DELTA_SPEAKER) |
181 (ams_delta_audio_agc << AMS_DELTA_AGC)); 183 (ams_delta_audio_agc << AMS_DELTA_AGC));
182 184
@@ -300,6 +302,7 @@ static int cx81801_open(struct tty_struct *tty)
300static void cx81801_close(struct tty_struct *tty) 302static void cx81801_close(struct tty_struct *tty)
301{ 303{
302 struct snd_soc_codec *codec = tty->disc_data; 304 struct snd_soc_codec *codec = tty->disc_data;
305 struct snd_soc_dapm_context *dapm = &codec->dapm;
303 306
304 del_timer_sync(&cx81801_timer); 307 del_timer_sync(&cx81801_timer);
305 308
@@ -312,12 +315,12 @@ static void cx81801_close(struct tty_struct *tty)
312 v253_ops.close(tty); 315 v253_ops.close(tty);
313 316
314 /* Revert back to default audio input/output constellation */ 317 /* Revert back to default audio input/output constellation */
315 snd_soc_dapm_disable_pin(codec, "Mouthpiece"); 318 snd_soc_dapm_disable_pin(dapm, "Mouthpiece");
316 snd_soc_dapm_enable_pin(codec, "Earpiece"); 319 snd_soc_dapm_enable_pin(dapm, "Earpiece");
317 snd_soc_dapm_enable_pin(codec, "Microphone"); 320 snd_soc_dapm_enable_pin(dapm, "Microphone");
318 snd_soc_dapm_disable_pin(codec, "Speaker"); 321 snd_soc_dapm_disable_pin(dapm, "Speaker");
319 snd_soc_dapm_disable_pin(codec, "AGCIN"); 322 snd_soc_dapm_disable_pin(dapm, "AGCIN");
320 snd_soc_dapm_sync(codec); 323 snd_soc_dapm_sync(dapm);
321} 324}
322 325
323/* Line discipline .hangup() */ 326/* Line discipline .hangup() */
@@ -432,16 +435,16 @@ static int ams_delta_set_bias_level(struct snd_soc_card *card,
432 case SND_SOC_BIAS_ON: 435 case SND_SOC_BIAS_ON:
433 case SND_SOC_BIAS_PREPARE: 436 case SND_SOC_BIAS_PREPARE:
434 case SND_SOC_BIAS_STANDBY: 437 case SND_SOC_BIAS_STANDBY:
435 if (codec->bias_level == SND_SOC_BIAS_OFF) 438 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
436 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, 439 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
437 AMS_DELTA_LATCH2_MODEM_NRESET); 440 AMS_DELTA_LATCH2_MODEM_NRESET);
438 break; 441 break;
439 case SND_SOC_BIAS_OFF: 442 case SND_SOC_BIAS_OFF:
440 if (codec->bias_level != SND_SOC_BIAS_OFF) 443 if (codec->dapm.bias_level != SND_SOC_BIAS_OFF)
441 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, 444 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
442 0); 445 0);
443 } 446 }
444 codec->bias_level = level; 447 codec->dapm.bias_level = level;
445 448
446 return 0; 449 return 0;
447} 450}
@@ -492,6 +495,7 @@ static void ams_delta_shutdown(struct snd_pcm_substream *substream)
492static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) 495static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
493{ 496{
494 struct snd_soc_codec *codec = rtd->codec; 497 struct snd_soc_codec *codec = rtd->codec;
498 struct snd_soc_dapm_context *dapm = &codec->dapm;
495 struct snd_soc_dai *codec_dai = rtd->codec_dai; 499 struct snd_soc_dai *codec_dai = rtd->codec_dai;
496 struct snd_soc_card *card = rtd->card; 500 struct snd_soc_card *card = rtd->card;
497 int ret; 501 int ret;
@@ -541,7 +545,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
541 } 545 }
542 546
543 /* Add board specific DAPM widgets and routes */ 547 /* Add board specific DAPM widgets and routes */
544 ret = snd_soc_dapm_new_controls(codec, ams_delta_dapm_widgets, 548 ret = snd_soc_dapm_new_controls(dapm, ams_delta_dapm_widgets,
545 ARRAY_SIZE(ams_delta_dapm_widgets)); 549 ARRAY_SIZE(ams_delta_dapm_widgets));
546 if (ret) { 550 if (ret) {
547 dev_warn(card->dev, 551 dev_warn(card->dev,
@@ -550,7 +554,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
550 return 0; 554 return 0;
551 } 555 }
552 556
553 ret = snd_soc_dapm_add_routes(codec, ams_delta_audio_map, 557 ret = snd_soc_dapm_add_routes(dapm, ams_delta_audio_map,
554 ARRAY_SIZE(ams_delta_audio_map)); 558 ARRAY_SIZE(ams_delta_audio_map));
555 if (ret) { 559 if (ret) {
556 dev_warn(card->dev, 560 dev_warn(card->dev,
@@ -560,13 +564,13 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
560 } 564 }
561 565
562 /* Set up initial pin constellation */ 566 /* Set up initial pin constellation */
563 snd_soc_dapm_disable_pin(codec, "Mouthpiece"); 567 snd_soc_dapm_disable_pin(dapm, "Mouthpiece");
564 snd_soc_dapm_enable_pin(codec, "Earpiece"); 568 snd_soc_dapm_enable_pin(dapm, "Earpiece");
565 snd_soc_dapm_enable_pin(codec, "Microphone"); 569 snd_soc_dapm_enable_pin(dapm, "Microphone");
566 snd_soc_dapm_disable_pin(codec, "Speaker"); 570 snd_soc_dapm_disable_pin(dapm, "Speaker");
567 snd_soc_dapm_disable_pin(codec, "AGCIN"); 571 snd_soc_dapm_disable_pin(dapm, "AGCIN");
568 snd_soc_dapm_disable_pin(codec, "AGCOUT"); 572 snd_soc_dapm_disable_pin(dapm, "AGCOUT");
569 snd_soc_dapm_sync(codec); 573 snd_soc_dapm_sync(dapm);
570 574
571 /* Add virtual switch */ 575 /* Add virtual switch */
572 ret = snd_soc_add_controls(codec, ams_delta_audio_controls, 576 ret = snd_soc_add_controls(codec, ams_delta_audio_controls,
diff --git a/sound/soc/omap/igep0020.c b/sound/soc/omap/igep0020.c
index fd3a40f309c8..0ae34702995b 100644
--- a/sound/soc/omap/igep0020.c
+++ b/sound/soc/omap/igep0020.c
@@ -24,7 +24,6 @@
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/soc.h> 26#include <sound/soc.h>
27#include <sound/soc-dapm.h>
28 27
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index a3b6d897ad84..83d213bfd3d1 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -27,7 +27,6 @@
27#include <sound/core.h> 27#include <sound/core.h>
28#include <sound/pcm.h> 28#include <sound/pcm.h>
29#include <sound/soc.h> 29#include <sound/soc.h>
30#include <sound/soc-dapm.h>
31 30
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33#include <mach/hardware.h> 32#include <mach/hardware.h>
@@ -36,7 +35,6 @@
36 35
37#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
38#include "omap-pcm.h" 37#include "omap-pcm.h"
39#include "../codecs/tlv320aic3x.h"
40 38
41#define N810_HEADSET_AMP_GPIO 10 39#define N810_HEADSET_AMP_GPIO 10
42#define N810_SPEAKER_AMP_GPIO 101 40#define N810_SPEAKER_AMP_GPIO 101
@@ -58,6 +56,7 @@ static int n810_dmic_func;
58 56
59static void n810_ext_control(struct snd_soc_codec *codec) 57static void n810_ext_control(struct snd_soc_codec *codec)
60{ 58{
59 struct snd_soc_dapm_context *dapm = &codec->dapm;
61 int hp = 0, line1l = 0; 60 int hp = 0, line1l = 0;
62 61
63 switch (n810_jack_func) { 62 switch (n810_jack_func) {
@@ -72,25 +71,25 @@ static void n810_ext_control(struct snd_soc_codec *codec)
72 } 71 }
73 72
74 if (n810_spk_func) 73 if (n810_spk_func)
75 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 74 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
76 else 75 else
77 snd_soc_dapm_disable_pin(codec, "Ext Spk"); 76 snd_soc_dapm_disable_pin(dapm, "Ext Spk");
78 77
79 if (hp) 78 if (hp)
80 snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 79 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
81 else 80 else
82 snd_soc_dapm_disable_pin(codec, "Headphone Jack"); 81 snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
83 if (line1l) 82 if (line1l)
84 snd_soc_dapm_enable_pin(codec, "LINE1L"); 83 snd_soc_dapm_enable_pin(dapm, "LINE1L");
85 else 84 else
86 snd_soc_dapm_disable_pin(codec, "LINE1L"); 85 snd_soc_dapm_disable_pin(dapm, "LINE1L");
87 86
88 if (n810_dmic_func) 87 if (n810_dmic_func)
89 snd_soc_dapm_enable_pin(codec, "DMic"); 88 snd_soc_dapm_enable_pin(dapm, "DMic");
90 else 89 else
91 snd_soc_dapm_disable_pin(codec, "DMic"); 90 snd_soc_dapm_disable_pin(dapm, "DMic");
92 91
93 snd_soc_dapm_sync(codec); 92 snd_soc_dapm_sync(dapm);
94} 93}
95 94
96static int n810_startup(struct snd_pcm_substream *substream) 95static int n810_startup(struct snd_pcm_substream *substream)
@@ -274,17 +273,18 @@ static const struct snd_kcontrol_new aic33_n810_controls[] = {
274static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd) 273static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
275{ 274{
276 struct snd_soc_codec *codec = rtd->codec; 275 struct snd_soc_codec *codec = rtd->codec;
276 struct snd_soc_dapm_context *dapm = &codec->dapm;
277 int err; 277 int err;
278 278
279 /* Not connected */ 279 /* Not connected */
280 snd_soc_dapm_nc_pin(codec, "MONO_LOUT"); 280 snd_soc_dapm_nc_pin(dapm, "MONO_LOUT");
281 snd_soc_dapm_nc_pin(codec, "HPLCOM"); 281 snd_soc_dapm_nc_pin(dapm, "HPLCOM");
282 snd_soc_dapm_nc_pin(codec, "HPRCOM"); 282 snd_soc_dapm_nc_pin(dapm, "HPRCOM");
283 snd_soc_dapm_nc_pin(codec, "MIC3L"); 283 snd_soc_dapm_nc_pin(dapm, "MIC3L");
284 snd_soc_dapm_nc_pin(codec, "MIC3R"); 284 snd_soc_dapm_nc_pin(dapm, "MIC3R");
285 snd_soc_dapm_nc_pin(codec, "LINE1R"); 285 snd_soc_dapm_nc_pin(dapm, "LINE1R");
286 snd_soc_dapm_nc_pin(codec, "LINE2L"); 286 snd_soc_dapm_nc_pin(dapm, "LINE2L");
287 snd_soc_dapm_nc_pin(codec, "LINE2R"); 287 snd_soc_dapm_nc_pin(dapm, "LINE2R");
288 288
289 /* Add N810 specific controls */ 289 /* Add N810 specific controls */
290 err = snd_soc_add_controls(codec, aic33_n810_controls, 290 err = snd_soc_add_controls(codec, aic33_n810_controls,
@@ -293,13 +293,13 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
293 return err; 293 return err;
294 294
295 /* Add N810 specific widgets */ 295 /* Add N810 specific widgets */
296 snd_soc_dapm_new_controls(codec, aic33_dapm_widgets, 296 snd_soc_dapm_new_controls(dapm, aic33_dapm_widgets,
297 ARRAY_SIZE(aic33_dapm_widgets)); 297 ARRAY_SIZE(aic33_dapm_widgets));
298 298
299 /* Set up N810 specific audio path audio_map */ 299 /* Set up N810 specific audio path audio_map */
300 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 300 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
301 301
302 snd_soc_dapm_sync(codec); 302 snd_soc_dapm_sync(dapm);
303 303
304 return 0; 304 return 0;
305} 305}
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 7e84f24b9a88..d203f4da18a0 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -102,6 +102,17 @@ static const int omap24xx_dma_reqs[][2] = {
102static const int omap24xx_dma_reqs[][2] = {}; 102static const int omap24xx_dma_reqs[][2] = {};
103#endif 103#endif
104 104
105#if defined(CONFIG_ARCH_OMAP4)
106static const int omap44xx_dma_reqs[][2] = {
107 { OMAP44XX_DMA_MCBSP1_TX, OMAP44XX_DMA_MCBSP1_RX },
108 { OMAP44XX_DMA_MCBSP2_TX, OMAP44XX_DMA_MCBSP2_RX },
109 { OMAP44XX_DMA_MCBSP3_TX, OMAP44XX_DMA_MCBSP3_RX },
110 { OMAP44XX_DMA_MCBSP4_TX, OMAP44XX_DMA_MCBSP4_RX },
111};
112#else
113static const int omap44xx_dma_reqs[][2] = {};
114#endif
115
105#if defined(CONFIG_ARCH_OMAP2420) 116#if defined(CONFIG_ARCH_OMAP2420)
106static const unsigned long omap2420_mcbsp_port[][2] = { 117static const unsigned long omap2420_mcbsp_port[][2] = {
107 { OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1, 118 { OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1,
@@ -147,6 +158,21 @@ static const unsigned long omap34xx_mcbsp_port[][2] = {
147static const unsigned long omap34xx_mcbsp_port[][2] = {}; 158static const unsigned long omap34xx_mcbsp_port[][2] = {};
148#endif 159#endif
149 160
161#if defined(CONFIG_ARCH_OMAP4)
162static const unsigned long omap44xx_mcbsp_port[][2] = {
163 { OMAP44XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR,
164 OMAP44XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR },
165 { OMAP44XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR,
166 OMAP44XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR },
167 { OMAP44XX_MCBSP3_BASE + OMAP_MCBSP_REG_DXR,
168 OMAP44XX_MCBSP3_BASE + OMAP_MCBSP_REG_DRR },
169 { OMAP44XX_MCBSP4_BASE + OMAP_MCBSP_REG_DXR,
170 OMAP44XX_MCBSP4_BASE + OMAP_MCBSP_REG_DRR },
171};
172#else
173static const unsigned long omap44xx_mcbsp_port[][2] = {};
174#endif
175
150static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream) 176static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream)
151{ 177{
152 struct snd_soc_pcm_runtime *rtd = substream->private_data; 178 struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -224,7 +250,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
224 * 2 channels (stereo): size is 128 / 2 = 64 frames (2 * 64 words) 250 * 2 channels (stereo): size is 128 / 2 = 64 frames (2 * 64 words)
225 * 4 channels: size is 128 / 4 = 32 frames (4 * 32 words) 251 * 4 channels: size is 128 / 4 = 32 frames (4 * 32 words)
226 */ 252 */
227 if (cpu_is_omap343x()) { 253 if (cpu_is_omap343x() || cpu_is_omap44xx()) {
228 /* 254 /*
229 * Rule for the buffer size. We should not allow 255 * Rule for the buffer size. We should not allow
230 * smaller buffer than the FIFO size to avoid underruns 256 * smaller buffer than the FIFO size to avoid underruns
@@ -332,6 +358,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
332 } else if (cpu_is_omap343x()) { 358 } else if (cpu_is_omap343x()) {
333 dma = omap24xx_dma_reqs[bus_id][substream->stream]; 359 dma = omap24xx_dma_reqs[bus_id][substream->stream];
334 port = omap34xx_mcbsp_port[bus_id][substream->stream]; 360 port = omap34xx_mcbsp_port[bus_id][substream->stream];
361 } else if (cpu_is_omap44xx()) {
362 dma = omap44xx_dma_reqs[bus_id][substream->stream];
363 port = omap44xx_mcbsp_port[bus_id][substream->stream];
335 } else { 364 } else {
336 return -ENODEV; 365 return -ENODEV;
337 } 366 }
@@ -498,11 +527,11 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
498 regs->spcr2 |= XINTM(3) | FREE; 527 regs->spcr2 |= XINTM(3) | FREE;
499 regs->spcr1 |= RINTM(3); 528 regs->spcr1 |= RINTM(3);
500 /* RFIG and XFIG are not defined in 34xx */ 529 /* RFIG and XFIG are not defined in 34xx */
501 if (!cpu_is_omap34xx()) { 530 if (!cpu_is_omap34xx() && !cpu_is_omap44xx()) {
502 regs->rcr2 |= RFIG; 531 regs->rcr2 |= RFIG;
503 regs->xcr2 |= XFIG; 532 regs->xcr2 |= XFIG;
504 } 533 }
505 if (cpu_is_omap2430() || cpu_is_omap34xx()) { 534 if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
506 regs->xccr = DXENDLY(1) | XDMAEN | XDISABLE; 535 regs->xccr = DXENDLY(1) | XDMAEN | XDISABLE;
507 regs->rccr = RFULL_CYCLE | RDMAEN | RDISABLE; 536 regs->rccr = RFULL_CYCLE | RDMAEN | RDISABLE;
508 } 537 }
diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h
index ffdcc5abb7b9..110c106611d3 100644
--- a/sound/soc/omap/omap-mcbsp.h
+++ b/sound/soc/omap/omap-mcbsp.h
@@ -50,6 +50,10 @@ enum omap_mcbsp_div {
50#undef NUM_LINKS 50#undef NUM_LINKS
51#define NUM_LINKS 3 51#define NUM_LINKS 3
52#endif 52#endif
53#if defined(CONFIG_ARCH_OMAP4)
54#undef NUM_LINKS
55#define NUM_LINKS 4
56#endif
53#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) 57#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3)
54#undef NUM_LINKS 58#undef NUM_LINKS
55#define NUM_LINKS 5 59#define NUM_LINKS 5
diff --git a/sound/soc/omap/omap2evm.c b/sound/soc/omap/omap2evm.c
index cf3fc8a675b5..29b60d6796e7 100644
--- a/sound/soc/omap/omap2evm.c
+++ b/sound/soc/omap/omap2evm.c
@@ -26,7 +26,6 @@
26#include <sound/core.h> 26#include <sound/core.h>
27#include <sound/pcm.h> 27#include <sound/pcm.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29#include <sound/soc-dapm.h>
30 29
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32#include <mach/hardware.h> 31#include <mach/hardware.h>
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
index e56832b0c444..40db813c0795 100644
--- a/sound/soc/omap/omap3beagle.c
+++ b/sound/soc/omap/omap3beagle.c
@@ -24,7 +24,6 @@
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/soc.h> 26#include <sound/soc.h>
27#include <sound/soc-dapm.h>
28 27
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
index 810f1e36da21..0daa04469836 100644
--- a/sound/soc/omap/omap3evm.c
+++ b/sound/soc/omap/omap3evm.c
@@ -22,7 +22,6 @@
22#include <sound/core.h> 22#include <sound/core.h>
23#include <sound/pcm.h> 23#include <sound/pcm.h>
24#include <sound/soc.h> 24#include <sound/soc.h>
25#include <sound/soc-dapm.h>
26 25
27#include <asm/mach-types.h> 26#include <asm/mach-types.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index 4ee33ce2cb98..8047c521e318 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -28,7 +28,6 @@
28#include <sound/core.h> 28#include <sound/core.h>
29#include <sound/pcm.h> 29#include <sound/pcm.h>
30#include <sound/soc.h> 30#include <sound/soc.h>
31#include <sound/soc-dapm.h>
32 31
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <plat/mcbsp.h> 33#include <plat/mcbsp.h>
@@ -170,51 +169,53 @@ static const struct snd_soc_dapm_route omap3pandora_in_map[] = {
170static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd) 169static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd)
171{ 170{
172 struct snd_soc_codec *codec = rtd->codec; 171 struct snd_soc_codec *codec = rtd->codec;
172 struct snd_soc_dapm_context *dapm = &codec->dapm;
173 int ret; 173 int ret;
174 174
175 /* All TWL4030 output pins are floating */ 175 /* All TWL4030 output pins are floating */
176 snd_soc_dapm_nc_pin(codec, "EARPIECE"); 176 snd_soc_dapm_nc_pin(dapm, "EARPIECE");
177 snd_soc_dapm_nc_pin(codec, "PREDRIVEL"); 177 snd_soc_dapm_nc_pin(dapm, "PREDRIVEL");
178 snd_soc_dapm_nc_pin(codec, "PREDRIVER"); 178 snd_soc_dapm_nc_pin(dapm, "PREDRIVER");
179 snd_soc_dapm_nc_pin(codec, "HSOL"); 179 snd_soc_dapm_nc_pin(dapm, "HSOL");
180 snd_soc_dapm_nc_pin(codec, "HSOR"); 180 snd_soc_dapm_nc_pin(dapm, "HSOR");
181 snd_soc_dapm_nc_pin(codec, "CARKITL"); 181 snd_soc_dapm_nc_pin(dapm, "CARKITL");
182 snd_soc_dapm_nc_pin(codec, "CARKITR"); 182 snd_soc_dapm_nc_pin(dapm, "CARKITR");
183 snd_soc_dapm_nc_pin(codec, "HFL"); 183 snd_soc_dapm_nc_pin(dapm, "HFL");
184 snd_soc_dapm_nc_pin(codec, "HFR"); 184 snd_soc_dapm_nc_pin(dapm, "HFR");
185 snd_soc_dapm_nc_pin(codec, "VIBRA"); 185 snd_soc_dapm_nc_pin(dapm, "VIBRA");
186 186
187 ret = snd_soc_dapm_new_controls(codec, omap3pandora_out_dapm_widgets, 187 ret = snd_soc_dapm_new_controls(dapm, omap3pandora_out_dapm_widgets,
188 ARRAY_SIZE(omap3pandora_out_dapm_widgets)); 188 ARRAY_SIZE(omap3pandora_out_dapm_widgets));
189 if (ret < 0) 189 if (ret < 0)
190 return ret; 190 return ret;
191 191
192 snd_soc_dapm_add_routes(codec, omap3pandora_out_map, 192 snd_soc_dapm_add_routes(dapm, omap3pandora_out_map,
193 ARRAY_SIZE(omap3pandora_out_map)); 193 ARRAY_SIZE(omap3pandora_out_map));
194 194
195 return snd_soc_dapm_sync(codec); 195 return snd_soc_dapm_sync(dapm);
196} 196}
197 197
198static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd) 198static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
199{ 199{
200 struct snd_soc_codec *codec = rtd->codec; 200 struct snd_soc_codec *codec = rtd->codec;
201 struct snd_soc_dapm_context *dapm = &codec->dapm;
201 int ret; 202 int ret;
202 203
203 /* Not comnnected */ 204 /* Not comnnected */
204 snd_soc_dapm_nc_pin(codec, "HSMIC"); 205 snd_soc_dapm_nc_pin(dapm, "HSMIC");
205 snd_soc_dapm_nc_pin(codec, "CARKITMIC"); 206 snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
206 snd_soc_dapm_nc_pin(codec, "DIGIMIC0"); 207 snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
207 snd_soc_dapm_nc_pin(codec, "DIGIMIC1"); 208 snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");
208 209
209 ret = snd_soc_dapm_new_controls(codec, omap3pandora_in_dapm_widgets, 210 ret = snd_soc_dapm_new_controls(dapm, omap3pandora_in_dapm_widgets,
210 ARRAY_SIZE(omap3pandora_in_dapm_widgets)); 211 ARRAY_SIZE(omap3pandora_in_dapm_widgets));
211 if (ret < 0) 212 if (ret < 0)
212 return ret; 213 return ret;
213 214
214 snd_soc_dapm_add_routes(codec, omap3pandora_in_map, 215 snd_soc_dapm_add_routes(dapm, omap3pandora_in_map,
215 ARRAY_SIZE(omap3pandora_in_map)); 216 ARRAY_SIZE(omap3pandora_in_map));
216 217
217 return snd_soc_dapm_sync(codec); 218 return snd_soc_dapm_sync(dapm);
218} 219}
219 220
220static struct snd_soc_ops omap3pandora_ops = { 221static struct snd_soc_ops omap3pandora_ops = {
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index 65ae00e976ef..7e75e775fb4a 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -26,7 +26,6 @@
26#include <sound/core.h> 26#include <sound/core.h>
27#include <sound/pcm.h> 27#include <sound/pcm.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29#include <sound/soc-dapm.h>
30 29
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -116,19 +115,20 @@ static const struct snd_soc_dapm_route audio_map[] = {
116static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) 115static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
117{ 116{
118 struct snd_soc_codec *codec = rtd->codec; 117 struct snd_soc_codec *codec = rtd->codec;
118 struct snd_soc_dapm_context *dapm = &codec->dapm;
119 119
120 /* Add osk5912 specific widgets */ 120 /* Add osk5912 specific widgets */
121 snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets, 121 snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
122 ARRAY_SIZE(tlv320aic23_dapm_widgets)); 122 ARRAY_SIZE(tlv320aic23_dapm_widgets));
123 123
124 /* Set up osk5912 specific audio path audio_map */ 124 /* Set up osk5912 specific audio path audio_map */
125 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 125 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
126 126
127 snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 127 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
128 snd_soc_dapm_enable_pin(codec, "Line In"); 128 snd_soc_dapm_enable_pin(dapm, "Line In");
129 snd_soc_dapm_enable_pin(codec, "Mic Jack"); 129 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
130 130
131 snd_soc_dapm_sync(codec); 131 snd_soc_dapm_sync(dapm);
132 132
133 return 0; 133 return 0;
134} 134}
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c
index e95a607937de..bbcf380bfb56 100644
--- a/sound/soc/omap/overo.c
+++ b/sound/soc/omap/overo.c
@@ -24,7 +24,6 @@
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/soc.h> 26#include <sound/soc.h>
27#include <sound/soc-dapm.h>
28 27
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 04b5723bf89b..09fb0df8d416 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -30,14 +30,12 @@
30#include <sound/jack.h> 30#include <sound/jack.h>
31#include <sound/pcm.h> 31#include <sound/pcm.h>
32#include <sound/soc.h> 32#include <sound/soc.h>
33#include <sound/soc-dapm.h>
34#include <plat/mcbsp.h> 33#include <plat/mcbsp.h>
35 34
36#include <asm/mach-types.h> 35#include <asm/mach-types.h>
37 36
38#include "omap-mcbsp.h" 37#include "omap-mcbsp.h"
39#include "omap-pcm.h" 38#include "omap-pcm.h"
40#include "../codecs/tlv320aic3x.h"
41 39
42#define RX51_TVOUT_SEL_GPIO 40 40#define RX51_TVOUT_SEL_GPIO 40
43#define RX51_JACK_DETECT_GPIO 177 41#define RX51_JACK_DETECT_GPIO 177
@@ -58,19 +56,21 @@ static int rx51_jack_func;
58 56
59static void rx51_ext_control(struct snd_soc_codec *codec) 57static void rx51_ext_control(struct snd_soc_codec *codec)
60{ 58{
59 struct snd_soc_dapm_context *dapm = &codec->dapm;
60
61 if (rx51_spk_func) 61 if (rx51_spk_func)
62 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 62 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
63 else 63 else
64 snd_soc_dapm_disable_pin(codec, "Ext Spk"); 64 snd_soc_dapm_disable_pin(dapm, "Ext Spk");
65 if (rx51_dmic_func) 65 if (rx51_dmic_func)
66 snd_soc_dapm_enable_pin(codec, "DMic"); 66 snd_soc_dapm_enable_pin(dapm, "DMic");
67 else 67 else
68 snd_soc_dapm_disable_pin(codec, "DMic"); 68 snd_soc_dapm_disable_pin(dapm, "DMic");
69 69
70 gpio_set_value(RX51_TVOUT_SEL_GPIO, 70 gpio_set_value(RX51_TVOUT_SEL_GPIO,
71 rx51_jack_func == RX51_JACK_TVOUT); 71 rx51_jack_func == RX51_JACK_TVOUT);
72 72
73 snd_soc_dapm_sync(codec); 73 snd_soc_dapm_sync(dapm);
74} 74}
75 75
76static int rx51_startup(struct snd_pcm_substream *substream) 76static int rx51_startup(struct snd_pcm_substream *substream)
@@ -244,12 +244,13 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = {
244static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) 244static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
245{ 245{
246 struct snd_soc_codec *codec = rtd->codec; 246 struct snd_soc_codec *codec = rtd->codec;
247 struct snd_soc_dapm_context *dapm = &codec->dapm;
247 int err; 248 int err;
248 249
249 /* Set up NC codec pins */ 250 /* Set up NC codec pins */
250 snd_soc_dapm_nc_pin(codec, "MIC3L"); 251 snd_soc_dapm_nc_pin(dapm, "MIC3L");
251 snd_soc_dapm_nc_pin(codec, "MIC3R"); 252 snd_soc_dapm_nc_pin(dapm, "MIC3R");
252 snd_soc_dapm_nc_pin(codec, "LINE1R"); 253 snd_soc_dapm_nc_pin(dapm, "LINE1R");
253 254
254 /* Add RX-51 specific controls */ 255 /* Add RX-51 specific controls */
255 err = snd_soc_add_controls(codec, aic34_rx51_controls, 256 err = snd_soc_add_controls(codec, aic34_rx51_controls,
@@ -258,13 +259,13 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
258 return err; 259 return err;
259 260
260 /* Add RX-51 specific widgets */ 261 /* Add RX-51 specific widgets */
261 snd_soc_dapm_new_controls(codec, aic34_dapm_widgets, 262 snd_soc_dapm_new_controls(dapm, aic34_dapm_widgets,
262 ARRAY_SIZE(aic34_dapm_widgets)); 263 ARRAY_SIZE(aic34_dapm_widgets));
263 264
264 /* Set up RX-51 specific audio path audio_map */ 265 /* Set up RX-51 specific audio path audio_map */
265 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 266 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
266 267
267 snd_soc_dapm_sync(codec); 268 snd_soc_dapm_sync(dapm);
268 269
269 /* AV jack detection */ 270 /* AV jack detection */
270 err = snd_soc_jack_new(codec, "AV Jack", 271 err = snd_soc_jack_new(codec, "AV Jack",
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
index 07fbcf7d2411..3f72d17d1ef0 100644
--- a/sound/soc/omap/sdp3430.c
+++ b/sound/soc/omap/sdp3430.c
@@ -28,7 +28,6 @@
28#include <sound/core.h> 28#include <sound/core.h>
29#include <sound/pcm.h> 29#include <sound/pcm.h>
30#include <sound/soc.h> 30#include <sound/soc.h>
31#include <sound/soc-dapm.h>
32#include <sound/jack.h> 31#include <sound/jack.h>
33 32
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -191,39 +190,40 @@ static const struct snd_soc_dapm_route audio_map[] = {
191static int sdp3430_twl4030_init(struct snd_soc_pcm_runtime *rtd) 190static int sdp3430_twl4030_init(struct snd_soc_pcm_runtime *rtd)
192{ 191{
193 struct snd_soc_codec *codec = rtd->codec; 192 struct snd_soc_codec *codec = rtd->codec;
193 struct snd_soc_dapm_context *dapm = &codec->dapm;
194 int ret; 194 int ret;
195 195
196 /* Add SDP3430 specific widgets */ 196 /* Add SDP3430 specific widgets */
197 ret = snd_soc_dapm_new_controls(codec, sdp3430_twl4030_dapm_widgets, 197 ret = snd_soc_dapm_new_controls(dapm, sdp3430_twl4030_dapm_widgets,
198 ARRAY_SIZE(sdp3430_twl4030_dapm_widgets)); 198 ARRAY_SIZE(sdp3430_twl4030_dapm_widgets));
199 if (ret) 199 if (ret)
200 return ret; 200 return ret;
201 201
202 /* Set up SDP3430 specific audio path audio_map */ 202 /* Set up SDP3430 specific audio path audio_map */
203 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 203 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
204 204
205 /* SDP3430 connected pins */ 205 /* SDP3430 connected pins */
206 snd_soc_dapm_enable_pin(codec, "Ext Mic"); 206 snd_soc_dapm_enable_pin(dapm, "Ext Mic");
207 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 207 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
208 snd_soc_dapm_disable_pin(codec, "Headset Mic"); 208 snd_soc_dapm_disable_pin(dapm, "Headset Mic");
209 snd_soc_dapm_disable_pin(codec, "Headset Stereophone"); 209 snd_soc_dapm_disable_pin(dapm, "Headset Stereophone");
210 210
211 /* TWL4030 not connected pins */ 211 /* TWL4030 not connected pins */
212 snd_soc_dapm_nc_pin(codec, "AUXL"); 212 snd_soc_dapm_nc_pin(dapm, "AUXL");
213 snd_soc_dapm_nc_pin(codec, "AUXR"); 213 snd_soc_dapm_nc_pin(dapm, "AUXR");
214 snd_soc_dapm_nc_pin(codec, "CARKITMIC"); 214 snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
215 snd_soc_dapm_nc_pin(codec, "DIGIMIC0"); 215 snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
216 snd_soc_dapm_nc_pin(codec, "DIGIMIC1"); 216 snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");
217 217
218 snd_soc_dapm_nc_pin(codec, "OUTL"); 218 snd_soc_dapm_nc_pin(dapm, "OUTL");
219 snd_soc_dapm_nc_pin(codec, "OUTR"); 219 snd_soc_dapm_nc_pin(dapm, "OUTR");
220 snd_soc_dapm_nc_pin(codec, "EARPIECE"); 220 snd_soc_dapm_nc_pin(dapm, "EARPIECE");
221 snd_soc_dapm_nc_pin(codec, "PREDRIVEL"); 221 snd_soc_dapm_nc_pin(dapm, "PREDRIVEL");
222 snd_soc_dapm_nc_pin(codec, "PREDRIVER"); 222 snd_soc_dapm_nc_pin(dapm, "PREDRIVER");
223 snd_soc_dapm_nc_pin(codec, "CARKITL"); 223 snd_soc_dapm_nc_pin(dapm, "CARKITL");
224 snd_soc_dapm_nc_pin(codec, "CARKITR"); 224 snd_soc_dapm_nc_pin(dapm, "CARKITR");
225 225
226 ret = snd_soc_dapm_sync(codec); 226 ret = snd_soc_dapm_sync(dapm);
227 if (ret) 227 if (ret)
228 return ret; 228 return ret;
229 229
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 4b4463db6ba0..189e03900637 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -24,7 +24,7 @@
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/soc.h> 26#include <sound/soc.h>
27#include <sound/soc-dapm.h> 27#include <sound/jack.h>
28 28
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <plat/hardware.h> 30#include <plat/hardware.h>
@@ -66,6 +66,21 @@ static struct snd_soc_ops sdp4430_ops = {
66 .hw_params = sdp4430_hw_params, 66 .hw_params = sdp4430_hw_params,
67}; 67};
68 68
69/* Headset jack */
70static struct snd_soc_jack hs_jack;
71
72/*Headset jack detection DAPM pins */
73static struct snd_soc_jack_pin hs_jack_pins[] = {
74 {
75 .pin = "Headset Mic",
76 .mask = SND_JACK_MICROPHONE,
77 },
78 {
79 .pin = "Headset Stereophone",
80 .mask = SND_JACK_HEADPHONE,
81 },
82};
83
69static int sdp4430_get_power_mode(struct snd_kcontrol *kcontrol, 84static int sdp4430_get_power_mode(struct snd_kcontrol *kcontrol,
70 struct snd_ctl_elem_value *ucontrol) 85 struct snd_ctl_elem_value *ucontrol)
71{ 86{
@@ -102,6 +117,7 @@ static const struct snd_soc_dapm_widget sdp4430_twl6040_dapm_widgets[] = {
102 SND_SOC_DAPM_MIC("Headset Mic", NULL), 117 SND_SOC_DAPM_MIC("Headset Mic", NULL),
103 SND_SOC_DAPM_HP("Headset Stereophone", NULL), 118 SND_SOC_DAPM_HP("Headset Stereophone", NULL),
104 SND_SOC_DAPM_SPK("Earphone Spk", NULL), 119 SND_SOC_DAPM_SPK("Earphone Spk", NULL),
120 SND_SOC_DAPM_INPUT("Aux/FM Stereo In"),
105}; 121};
106 122
107static const struct snd_soc_dapm_route audio_map[] = { 123static const struct snd_soc_dapm_route audio_map[] = {
@@ -124,11 +140,16 @@ static const struct snd_soc_dapm_route audio_map[] = {
124 140
125 /* Earphone speaker */ 141 /* Earphone speaker */
126 {"Earphone Spk", NULL, "EP"}, 142 {"Earphone Spk", NULL, "EP"},
143
144 /* Aux/FM Stereo In: AFML, AFMR */
145 {"AFML", NULL, "Aux/FM Stereo In"},
146 {"AFMR", NULL, "Aux/FM Stereo In"},
127}; 147};
128 148
129static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) 149static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
130{ 150{
131 struct snd_soc_codec *codec = rtd->codec; 151 struct snd_soc_codec *codec = rtd->codec;
152 struct snd_soc_dapm_context *dapm = &codec->dapm;
132 int ret; 153 int ret;
133 154
134 /* Add SDP4430 specific controls */ 155 /* Add SDP4430 specific controls */
@@ -138,25 +159,39 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
138 return ret; 159 return ret;
139 160
140 /* Add SDP4430 specific widgets */ 161 /* Add SDP4430 specific widgets */
141 ret = snd_soc_dapm_new_controls(codec, sdp4430_twl6040_dapm_widgets, 162 ret = snd_soc_dapm_new_controls(dapm, sdp4430_twl6040_dapm_widgets,
142 ARRAY_SIZE(sdp4430_twl6040_dapm_widgets)); 163 ARRAY_SIZE(sdp4430_twl6040_dapm_widgets));
143 if (ret) 164 if (ret)
144 return ret; 165 return ret;
145 166
146 /* Set up SDP4430 specific audio path audio_map */ 167 /* Set up SDP4430 specific audio path audio_map */
147 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 168 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
148 169
149 /* SDP4430 connected pins */ 170 /* SDP4430 connected pins */
150 snd_soc_dapm_enable_pin(codec, "Ext Mic"); 171 snd_soc_dapm_enable_pin(dapm, "Ext Mic");
151 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 172 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
152 snd_soc_dapm_enable_pin(codec, "Headset Mic"); 173 snd_soc_dapm_enable_pin(dapm, "AFML");
153 snd_soc_dapm_enable_pin(codec, "Headset Stereophone"); 174 snd_soc_dapm_enable_pin(dapm, "AFMR");
175 snd_soc_dapm_enable_pin(dapm, "Headset Mic");
176 snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
177
178 ret = snd_soc_dapm_sync(dapm);
179 if (ret)
180 return ret;
181
182 /* Headset jack detection */
183 ret = snd_soc_jack_new(codec, "Headset Jack",
184 SND_JACK_HEADSET, &hs_jack);
185 if (ret)
186 return ret;
154 187
155 /* TWL6040 not connected pins */ 188 ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
156 snd_soc_dapm_nc_pin(codec, "AFML"); 189 hs_jack_pins);
157 snd_soc_dapm_nc_pin(codec, "AFMR");
158 190
159 ret = snd_soc_dapm_sync(codec); 191 if (machine_is_omap_4430sdp())
192 twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET);
193 else
194 snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET);
160 195
161 return ret; 196 return ret;
162} 197}
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index 718031eeac34..01709940a43c 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -24,7 +24,6 @@
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/soc.h> 26#include <sound/soc.h>
27#include <sound/soc-dapm.h>
28 27
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -162,35 +161,36 @@ static const struct snd_soc_dapm_route audio_map[] = {
162static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd) 161static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd)
163{ 162{
164 struct snd_soc_codec *codec = rtd->codec; 163 struct snd_soc_codec *codec = rtd->codec;
164 struct snd_soc_dapm_context *dapm = &codec->dapm;
165 int ret; 165 int ret;
166 166
167 /* Add Zoom2 specific widgets */ 167 /* Add Zoom2 specific widgets */
168 ret = snd_soc_dapm_new_controls(codec, zoom2_twl4030_dapm_widgets, 168 ret = snd_soc_dapm_new_controls(dapm, zoom2_twl4030_dapm_widgets,
169 ARRAY_SIZE(zoom2_twl4030_dapm_widgets)); 169 ARRAY_SIZE(zoom2_twl4030_dapm_widgets));
170 if (ret) 170 if (ret)
171 return ret; 171 return ret;
172 172
173 /* Set up Zoom2 specific audio path audio_map */ 173 /* Set up Zoom2 specific audio path audio_map */
174 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 174 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
175 175
176 /* Zoom2 connected pins */ 176 /* Zoom2 connected pins */
177 snd_soc_dapm_enable_pin(codec, "Ext Mic"); 177 snd_soc_dapm_enable_pin(dapm, "Ext Mic");
178 snd_soc_dapm_enable_pin(codec, "Ext Spk"); 178 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
179 snd_soc_dapm_enable_pin(codec, "Headset Mic"); 179 snd_soc_dapm_enable_pin(dapm, "Headset Mic");
180 snd_soc_dapm_enable_pin(codec, "Headset Stereophone"); 180 snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
181 snd_soc_dapm_enable_pin(codec, "Aux In"); 181 snd_soc_dapm_enable_pin(dapm, "Aux In");
182 182
183 /* TWL4030 not connected pins */ 183 /* TWL4030 not connected pins */
184 snd_soc_dapm_nc_pin(codec, "CARKITMIC"); 184 snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
185 snd_soc_dapm_nc_pin(codec, "DIGIMIC0"); 185 snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
186 snd_soc_dapm_nc_pin(codec, "DIGIMIC1"); 186 snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");
187 snd_soc_dapm_nc_pin(codec, "EARPIECE"); 187 snd_soc_dapm_nc_pin(dapm, "EARPIECE");
188 snd_soc_dapm_nc_pin(codec, "PREDRIVEL"); 188 snd_soc_dapm_nc_pin(dapm, "PREDRIVEL");
189 snd_soc_dapm_nc_pin(codec, "PREDRIVER"); 189 snd_soc_dapm_nc_pin(dapm, "PREDRIVER");
190 snd_soc_dapm_nc_pin(codec, "CARKITL"); 190 snd_soc_dapm_nc_pin(dapm, "CARKITL");
191 snd_soc_dapm_nc_pin(codec, "CARKITR"); 191 snd_soc_dapm_nc_pin(dapm, "CARKITR");
192 192
193 ret = snd_soc_dapm_sync(codec); 193 ret = snd_soc_dapm_sync(dapm);
194 194
195 return ret; 195 return ret;
196} 196}