aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/atmel/ac97c.c5
-rw-r--r--sound/core/hrtimer.c7
-rw-r--r--sound/core/jack.c1
-rw-r--r--sound/drivers/mtpav.c3
-rw-r--r--sound/oss/Makefile4
-rw-r--r--sound/pci/au88x0/au88x0_core.c14
-rw-r--r--sound/pci/azt3328.c38
-rw-r--r--sound/pci/hda/hda_eld.c2
-rw-r--r--sound/pci/hda/hda_intel.c3
-rw-r--r--sound/pci/hda/patch_conexant.c212
-rw-r--r--sound/pci/hda/patch_hdmi.c2
-rw-r--r--sound/pci/hda/patch_realtek.c33
-rw-r--r--sound/pci/hda/patch_via.c2
-rw-r--r--sound/pci/oxygen/oxygen.h2
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c2
-rw-r--r--sound/pci/oxygen/xonar_dg.c36
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.h2
-rw-r--r--sound/pcmcia/vx/vxp_ops.c2
-rw-r--r--sound/soc/atmel/snd-soc-afeb9260.c2
-rw-r--r--sound/soc/blackfin/bf5xx-ssm2602.c2
-rw-r--r--sound/soc/codecs/cq93vc.c2
-rw-r--r--sound/soc/codecs/cx20442.c3
-rw-r--r--sound/soc/codecs/wm8994.c28
-rw-r--r--sound/soc/codecs/wm8995.c2
-rw-r--r--sound/soc/codecs/wm_hubs.c15
-rw-r--r--sound/soc/davinci/davinci-evm.c20
-rw-r--r--sound/soc/omap/ams-delta.c2
-rw-r--r--sound/soc/pxa/corgi.c4
-rw-r--r--sound/soc/pxa/poodle.c2
-rw-r--r--sound/soc/pxa/spitz.c4
-rw-r--r--sound/soc/samsung/neo1973_gta02_wm8753.c6
-rw-r--r--sound/soc/samsung/neo1973_wm8753.c6
-rw-r--r--sound/soc/samsung/s3c24xx_simtec_hermes.c4
-rw-r--r--sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c4
-rw-r--r--sound/soc/samsung/s3c24xx_uda134x.c2
-rw-r--r--sound/soc/soc-core.c5
-rw-r--r--sound/soc/soc-dapm.c6
-rw-r--r--sound/usb/caiaq/audio.c2
-rw-r--r--sound/usb/caiaq/midi.c2
-rw-r--r--sound/usb/card.c4
-rw-r--r--sound/usb/mixer.c4
-rw-r--r--sound/usb/pcm.c7
-rw-r--r--sound/usb/quirks-table.h7
-rw-r--r--sound/usb/quirks.c3
-rw-r--r--sound/usb/usbaudio.h1
45 files changed, 347 insertions, 172 deletions
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 10c3a871a12d..b310702c646e 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -33,9 +33,12 @@
33#include <linux/dw_dmac.h> 33#include <linux/dw_dmac.h>
34 34
35#include <mach/cpu.h> 35#include <mach/cpu.h>
36#include <mach/hardware.h>
37#include <mach/gpio.h> 36#include <mach/gpio.h>
38 37
38#ifdef CONFIG_ARCH_AT91
39#include <mach/hardware.h>
40#endif
41
39#include "ac97c.h" 42#include "ac97c.h"
40 43
41enum { 44enum {
diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c
index 7730575bfadd..b8b31c433d64 100644
--- a/sound/core/hrtimer.c
+++ b/sound/core/hrtimer.c
@@ -45,12 +45,13 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
45{ 45{
46 struct snd_hrtimer *stime = container_of(hrt, struct snd_hrtimer, hrt); 46 struct snd_hrtimer *stime = container_of(hrt, struct snd_hrtimer, hrt);
47 struct snd_timer *t = stime->timer; 47 struct snd_timer *t = stime->timer;
48 unsigned long oruns;
48 49
49 if (!atomic_read(&stime->running)) 50 if (!atomic_read(&stime->running))
50 return HRTIMER_NORESTART; 51 return HRTIMER_NORESTART;
51 52
52 hrtimer_forward_now(hrt, ns_to_ktime(t->sticks * resolution)); 53 oruns = hrtimer_forward_now(hrt, ns_to_ktime(t->sticks * resolution));
53 snd_timer_interrupt(stime->timer, t->sticks); 54 snd_timer_interrupt(stime->timer, t->sticks * oruns);
54 55
55 if (!atomic_read(&stime->running)) 56 if (!atomic_read(&stime->running))
56 return HRTIMER_NORESTART; 57 return HRTIMER_NORESTART;
@@ -104,7 +105,7 @@ static int snd_hrtimer_stop(struct snd_timer *t)
104} 105}
105 106
106static struct snd_timer_hardware hrtimer_hw = { 107static struct snd_timer_hardware hrtimer_hw = {
107 .flags = SNDRV_TIMER_HW_AUTO, 108 .flags = SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_TASKLET,
108 .open = snd_hrtimer_open, 109 .open = snd_hrtimer_open,
109 .close = snd_hrtimer_close, 110 .close = snd_hrtimer_close,
110 .start = snd_hrtimer_start, 111 .start = snd_hrtimer_start,
diff --git a/sound/core/jack.c b/sound/core/jack.c
index 4902ae568730..53b53e97c896 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -141,6 +141,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
141 141
142fail_input: 142fail_input:
143 input_free_device(jack->input_dev); 143 input_free_device(jack->input_dev);
144 kfree(jack->id);
144 kfree(jack); 145 kfree(jack);
145 return err; 146 return err;
146} 147}
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index da03597fc893..5c426df87678 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -55,14 +55,13 @@
55#include <linux/err.h> 55#include <linux/err.h>
56#include <linux/platform_device.h> 56#include <linux/platform_device.h>
57#include <linux/ioport.h> 57#include <linux/ioport.h>
58#include <linux/io.h>
58#include <linux/moduleparam.h> 59#include <linux/moduleparam.h>
59#include <sound/core.h> 60#include <sound/core.h>
60#include <sound/initval.h> 61#include <sound/initval.h>
61#include <sound/rawmidi.h> 62#include <sound/rawmidi.h>
62#include <linux/delay.h> 63#include <linux/delay.h>
63 64
64#include <asm/io.h>
65
66/* 65/*
67 * globals 66 * globals
68 */ 67 */
diff --git a/sound/oss/Makefile b/sound/oss/Makefile
index 96f14dcd0cd1..90ffb99c6b17 100644
--- a/sound/oss/Makefile
+++ b/sound/oss/Makefile
@@ -87,7 +87,7 @@ ifeq ($(CONFIG_PSS_HAVE_BOOT),y)
87 $(obj)/bin2hex pss_synth < $< > $@ 87 $(obj)/bin2hex pss_synth < $< > $@
88else 88else
89 $(obj)/pss_boot.h: 89 $(obj)/pss_boot.h:
90 ( \ 90 $(Q)( \
91 echo 'static unsigned char * pss_synth = NULL;'; \ 91 echo 'static unsigned char * pss_synth = NULL;'; \
92 echo 'static int pss_synthLen = 0;'; \ 92 echo 'static int pss_synthLen = 0;'; \
93 ) > $@ 93 ) > $@
@@ -102,7 +102,7 @@ ifeq ($(CONFIG_TRIX_HAVE_BOOT),y)
102 $(obj)/hex2hex -i trix_boot < $< > $@ 102 $(obj)/hex2hex -i trix_boot < $< > $@
103else 103else
104 $(obj)/trix_boot.h: 104 $(obj)/trix_boot.h:
105 ( \ 105 $(Q)( \
106 echo 'static unsigned char * trix_boot = NULL;'; \ 106 echo 'static unsigned char * trix_boot = NULL;'; \
107 echo 'static int trix_boot_len = 0;'; \ 107 echo 'static int trix_boot_len = 0;'; \
108 ) > $@ 108 ) > $@
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 23f49f356e0f..16c0bdfbb164 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -1252,11 +1252,19 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) {
1252static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma) 1252static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
1253{ 1253{
1254 stream_t *dma = &vortex->dma_adb[adbdma]; 1254 stream_t *dma = &vortex->dma_adb[adbdma];
1255 int temp; 1255 int temp, page, delta;
1256 1256
1257 temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); 1257 temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2));
1258 temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); 1258 page = (temp & ADB_SUBBUF_MASK) >> ADB_SUBBUF_SHIFT;
1259 return temp; 1259 if (dma->nr_periods >= 4)
1260 delta = (page - dma->period_real) & 3;
1261 else {
1262 delta = (page - dma->period_real);
1263 if (delta < 0)
1264 delta += dma->nr_periods;
1265 }
1266 return (dma->period_virt + delta) * dma->period_bytes
1267 + (temp & (dma->period_bytes - 1));
1260} 1268}
1261 1269
1262static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma) 1270static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma)
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index bb84bb68a776..5715c4d05573 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -1317,31 +1317,25 @@ snd_azf3328_codec_setfmt(struct snd_azf3328_codec_data *codec,
1317 1317
1318 snd_azf3328_dbgcallenter(); 1318 snd_azf3328_dbgcallenter();
1319 switch (bitrate) { 1319 switch (bitrate) {
1320#define AZF_FMT_XLATE(in_freq, out_bits) \ 1320 case AZF_FREQ_4000: freq = SOUNDFORMAT_FREQ_SUSPECTED_4000; break;
1321 do { \ 1321 case AZF_FREQ_4800: freq = SOUNDFORMAT_FREQ_SUSPECTED_4800; break;
1322 case AZF_FREQ_ ## in_freq: \ 1322 case AZF_FREQ_5512:
1323 freq = SOUNDFORMAT_FREQ_ ## out_bits; \ 1323 /* the AZF3328 names it "5510" for some strange reason */
1324 break; \ 1324 freq = SOUNDFORMAT_FREQ_5510; break;
1325 } while (0); 1325 case AZF_FREQ_6620: freq = SOUNDFORMAT_FREQ_6620; break;
1326 AZF_FMT_XLATE(4000, SUSPECTED_4000) 1326 case AZF_FREQ_8000: freq = SOUNDFORMAT_FREQ_8000; break;
1327 AZF_FMT_XLATE(4800, SUSPECTED_4800) 1327 case AZF_FREQ_9600: freq = SOUNDFORMAT_FREQ_9600; break;
1328 /* the AZF3328 names it "5510" for some strange reason: */ 1328 case AZF_FREQ_11025: freq = SOUNDFORMAT_FREQ_11025; break;
1329 AZF_FMT_XLATE(5512, 5510) 1329 case AZF_FREQ_13240: freq = SOUNDFORMAT_FREQ_SUSPECTED_13240; break;
1330 AZF_FMT_XLATE(6620, 6620) 1330 case AZF_FREQ_16000: freq = SOUNDFORMAT_FREQ_16000; break;
1331 AZF_FMT_XLATE(8000, 8000) 1331 case AZF_FREQ_22050: freq = SOUNDFORMAT_FREQ_22050; break;
1332 AZF_FMT_XLATE(9600, 9600) 1332 case AZF_FREQ_32000: freq = SOUNDFORMAT_FREQ_32000; break;
1333 AZF_FMT_XLATE(11025, 11025)
1334 AZF_FMT_XLATE(13240, SUSPECTED_13240)
1335 AZF_FMT_XLATE(16000, 16000)
1336 AZF_FMT_XLATE(22050, 22050)
1337 AZF_FMT_XLATE(32000, 32000)
1338 default: 1333 default:
1339 snd_printk(KERN_WARNING "unknown bitrate %d, assuming 44.1kHz!\n", bitrate); 1334 snd_printk(KERN_WARNING "unknown bitrate %d, assuming 44.1kHz!\n", bitrate);
1340 /* fall-through */ 1335 /* fall-through */
1341 AZF_FMT_XLATE(44100, 44100) 1336 case AZF_FREQ_44100: freq = SOUNDFORMAT_FREQ_44100; break;
1342 AZF_FMT_XLATE(48000, 48000) 1337 case AZF_FREQ_48000: freq = SOUNDFORMAT_FREQ_48000; break;
1343 AZF_FMT_XLATE(66200, SUSPECTED_66200) 1338 case AZF_FREQ_66200: freq = SOUNDFORMAT_FREQ_SUSPECTED_66200; break;
1344#undef AZF_FMT_XLATE
1345 } 1339 }
1346 /* val = 0xff07; 3m27.993s (65301Hz; -> 64000Hz???) hmm, 66120, 65967, 66123 */ 1340 /* val = 0xff07; 3m27.993s (65301Hz; -> 64000Hz???) hmm, 66120, 65967, 66123 */
1347 /* val = 0xff09; 17m15.098s (13123,478Hz; -> 12000Hz???) hmm, 13237.2Hz? */ 1341 /* val = 0xff09; 17m15.098s (13123,478Hz; -> 12000Hz???) hmm, 13237.2Hz? */
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 4a663471dadc..74b0560289c0 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -381,7 +381,7 @@ static void hdmi_show_short_audio_desc(struct cea_sad *a)
381 snd_print_pcm_rates(a->rates, buf, sizeof(buf)); 381 snd_print_pcm_rates(a->rates, buf, sizeof(buf));
382 382
383 if (a->format == AUDIO_CODING_TYPE_LPCM) 383 if (a->format == AUDIO_CODING_TYPE_LPCM)
384 snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2 - 8)); 384 snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2) - 8);
385 else if (a->max_bitrate) 385 else if (a->max_bitrate)
386 snprintf(buf2, sizeof(buf2), 386 snprintf(buf2, sizeof(buf2),
387 ", max bitrate = %d", a->max_bitrate); 387 ", max bitrate = %d", a->max_bitrate);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 2e91a991eb15..fcedad9a5fef 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2308,6 +2308,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
2308 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2308 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
2309 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), 2309 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
2310 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), 2310 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
2311 SND_PCI_QUIRK(0x1043, 0x8410, "ASUS", POS_FIX_LPIB),
2311 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), 2312 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
2312 SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), 2313 SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
2313 SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB), 2314 SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB),
@@ -2703,7 +2704,7 @@ static int __devinit azx_probe(struct pci_dev *pci,
2703 if (err < 0) 2704 if (err < 0)
2704 goto out_free; 2705 goto out_free;
2705#ifdef CONFIG_SND_HDA_PATCH_LOADER 2706#ifdef CONFIG_SND_HDA_PATCH_LOADER
2706 if (patch[dev]) { 2707 if (patch[dev] && *patch[dev]) {
2707 snd_printk(KERN_ERR SFX "Applying patch firmware '%s'\n", 2708 snd_printk(KERN_ERR SFX "Applying patch firmware '%s'\n",
2708 patch[dev]); 2709 patch[dev]);
2709 err = snd_hda_load_patch(chip->bus, patch[dev]); 2710 err = snd_hda_load_patch(chip->bus, patch[dev]);
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 9bb030a469cd..dd7c5c12225d 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -85,6 +85,7 @@ struct conexant_spec {
85 unsigned int auto_mic; 85 unsigned int auto_mic;
86 int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ 86 int auto_mic_ext; /* autocfg.inputs[] index for ext mic */
87 unsigned int need_dac_fix; 87 unsigned int need_dac_fix;
88 hda_nid_t slave_dig_outs[2];
88 89
89 /* capture */ 90 /* capture */
90 unsigned int num_adc_nids; 91 unsigned int num_adc_nids;
@@ -127,6 +128,7 @@ struct conexant_spec {
127 unsigned int ideapad:1; 128 unsigned int ideapad:1;
128 unsigned int thinkpad:1; 129 unsigned int thinkpad:1;
129 unsigned int hp_laptop:1; 130 unsigned int hp_laptop:1;
131 unsigned int asus:1;
130 132
131 unsigned int ext_mic_present; 133 unsigned int ext_mic_present;
132 unsigned int recording; 134 unsigned int recording;
@@ -352,6 +354,8 @@ static int conexant_build_pcms(struct hda_codec *codec)
352 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = 354 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid =
353 spec->dig_in_nid; 355 spec->dig_in_nid;
354 } 356 }
357 if (spec->slave_dig_outs[0])
358 codec->slave_dig_outs = spec->slave_dig_outs;
355 } 359 }
356 360
357 return 0; 361 return 0;
@@ -403,10 +407,16 @@ static int conexant_add_jack(struct hda_codec *codec,
403 struct conexant_spec *spec; 407 struct conexant_spec *spec;
404 struct conexant_jack *jack; 408 struct conexant_jack *jack;
405 const char *name; 409 const char *name;
406 int err; 410 int i, err;
407 411
408 spec = codec->spec; 412 spec = codec->spec;
409 snd_array_init(&spec->jacks, sizeof(*jack), 32); 413 snd_array_init(&spec->jacks, sizeof(*jack), 32);
414
415 jack = spec->jacks.list;
416 for (i = 0; i < spec->jacks.used; i++, jack++)
417 if (jack->nid == nid)
418 return 0 ; /* already present */
419
410 jack = snd_array_new(&spec->jacks); 420 jack = snd_array_new(&spec->jacks);
411 name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; 421 name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ;
412 422
@@ -2100,7 +2110,7 @@ static int patch_cxt5051(struct hda_codec *codec)
2100static hda_nid_t cxt5066_dac_nids[1] = { 0x10 }; 2110static hda_nid_t cxt5066_dac_nids[1] = { 0x10 };
2101static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; 2111static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 };
2102static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; 2112static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 };
2103#define CXT5066_SPDIF_OUT 0x21 2113static hda_nid_t cxt5066_digout_pin_nids[2] = { 0x20, 0x22 };
2104 2114
2105/* OLPC's microphone port is DC coupled for use with external sensors, 2115/* OLPC's microphone port is DC coupled for use with external sensors,
2106 * therefore we use a 50% mic bias in order to center the input signal with 2116 * therefore we use a 50% mic bias in order to center the input signal with
@@ -2312,6 +2322,19 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec)
2312 } 2322 }
2313} 2323}
2314 2324
2325
2326/* toggle input of built-in digital mic and mic jack appropriately */
2327static void cxt5066_asus_automic(struct hda_codec *codec)
2328{
2329 unsigned int present;
2330
2331 present = snd_hda_jack_detect(codec, 0x1b);
2332 snd_printdd("CXT5066: external microphone present=%d\n", present);
2333 snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
2334 present ? 1 : 0);
2335}
2336
2337
2315/* toggle input of built-in digital mic and mic jack appropriately */ 2338/* toggle input of built-in digital mic and mic jack appropriately */
2316static void cxt5066_hp_laptop_automic(struct hda_codec *codec) 2339static void cxt5066_hp_laptop_automic(struct hda_codec *codec)
2317{ 2340{
@@ -2387,79 +2410,55 @@ static void cxt5066_hp_automute(struct hda_codec *codec)
2387 cxt5066_update_speaker(codec); 2410 cxt5066_update_speaker(codec);
2388} 2411}
2389 2412
2390/* unsolicited event for jack sensing */ 2413/* Dispatch the right mic autoswitch function */
2391static void cxt5066_olpc_unsol_event(struct hda_codec *codec, unsigned int res) 2414static void cxt5066_automic(struct hda_codec *codec)
2392{ 2415{
2393 struct conexant_spec *spec = codec->spec; 2416 struct conexant_spec *spec = codec->spec;
2394 snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26);
2395 switch (res >> 26) {
2396 case CONEXANT_HP_EVENT:
2397 cxt5066_hp_automute(codec);
2398 break;
2399 case CONEXANT_MIC_EVENT:
2400 /* ignore mic events in DC mode; we're always using the jack */
2401 if (!spec->dc_enable)
2402 cxt5066_olpc_automic(codec);
2403 break;
2404 }
2405}
2406 2417
2407/* unsolicited event for jack sensing */ 2418 if (spec->dell_vostro)
2408static void cxt5066_vostro_event(struct hda_codec *codec, unsigned int res)
2409{
2410 snd_printdd("CXT5066_vostro: unsol event %x (%x)\n", res, res >> 26);
2411 switch (res >> 26) {
2412 case CONEXANT_HP_EVENT:
2413 cxt5066_hp_automute(codec);
2414 break;
2415 case CONEXANT_MIC_EVENT:
2416 cxt5066_vostro_automic(codec); 2419 cxt5066_vostro_automic(codec);
2417 break; 2420 else if (spec->ideapad)
2418 }
2419}
2420
2421/* unsolicited event for jack sensing */
2422static void cxt5066_ideapad_event(struct hda_codec *codec, unsigned int res)
2423{
2424 snd_printdd("CXT5066_ideapad: unsol event %x (%x)\n", res, res >> 26);
2425 switch (res >> 26) {
2426 case CONEXANT_HP_EVENT:
2427 cxt5066_hp_automute(codec);
2428 break;
2429 case CONEXANT_MIC_EVENT:
2430 cxt5066_ideapad_automic(codec); 2421 cxt5066_ideapad_automic(codec);
2431 break; 2422 else if (spec->thinkpad)
2432 } 2423 cxt5066_thinkpad_automic(codec);
2424 else if (spec->hp_laptop)
2425 cxt5066_hp_laptop_automic(codec);
2426 else if (spec->asus)
2427 cxt5066_asus_automic(codec);
2433} 2428}
2434 2429
2435/* unsolicited event for jack sensing */ 2430/* unsolicited event for jack sensing */
2436static void cxt5066_hp_laptop_event(struct hda_codec *codec, unsigned int res) 2431static void cxt5066_olpc_unsol_event(struct hda_codec *codec, unsigned int res)
2437{ 2432{
2438 snd_printdd("CXT5066_hp_laptop: unsol event %x (%x)\n", res, res >> 26); 2433 struct conexant_spec *spec = codec->spec;
2434 snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26);
2439 switch (res >> 26) { 2435 switch (res >> 26) {
2440 case CONEXANT_HP_EVENT: 2436 case CONEXANT_HP_EVENT:
2441 cxt5066_hp_automute(codec); 2437 cxt5066_hp_automute(codec);
2442 break; 2438 break;
2443 case CONEXANT_MIC_EVENT: 2439 case CONEXANT_MIC_EVENT:
2444 cxt5066_hp_laptop_automic(codec); 2440 /* ignore mic events in DC mode; we're always using the jack */
2441 if (!spec->dc_enable)
2442 cxt5066_olpc_automic(codec);
2445 break; 2443 break;
2446 } 2444 }
2447} 2445}
2448 2446
2449/* unsolicited event for jack sensing */ 2447/* unsolicited event for jack sensing */
2450static void cxt5066_thinkpad_event(struct hda_codec *codec, unsigned int res) 2448static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res)
2451{ 2449{
2452 snd_printdd("CXT5066_thinkpad: unsol event %x (%x)\n", res, res >> 26); 2450 snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26);
2453 switch (res >> 26) { 2451 switch (res >> 26) {
2454 case CONEXANT_HP_EVENT: 2452 case CONEXANT_HP_EVENT:
2455 cxt5066_hp_automute(codec); 2453 cxt5066_hp_automute(codec);
2456 break; 2454 break;
2457 case CONEXANT_MIC_EVENT: 2455 case CONEXANT_MIC_EVENT:
2458 cxt5066_thinkpad_automic(codec); 2456 cxt5066_automic(codec);
2459 break; 2457 break;
2460 } 2458 }
2461} 2459}
2462 2460
2461
2463static const struct hda_input_mux cxt5066_analog_mic_boost = { 2462static const struct hda_input_mux cxt5066_analog_mic_boost = {
2464 .num_items = 5, 2463 .num_items = 5,
2465 .items = { 2464 .items = {
@@ -2633,6 +2632,27 @@ static void cxt5066_olpc_capture_cleanup(struct hda_codec *codec)
2633 spec->recording = 0; 2632 spec->recording = 0;
2634} 2633}
2635 2634
2635static void conexant_check_dig_outs(struct hda_codec *codec,
2636 hda_nid_t *dig_pins,
2637 int num_pins)
2638{
2639 struct conexant_spec *spec = codec->spec;
2640 hda_nid_t *nid_loc = &spec->multiout.dig_out_nid;
2641 int i;
2642
2643 for (i = 0; i < num_pins; i++, dig_pins++) {
2644 unsigned int cfg = snd_hda_codec_get_pincfg(codec, *dig_pins);
2645 if (get_defcfg_connect(cfg) == AC_JACK_PORT_NONE)
2646 continue;
2647 if (snd_hda_get_connections(codec, *dig_pins, nid_loc, 1) != 1)
2648 continue;
2649 if (spec->slave_dig_outs[0])
2650 nid_loc++;
2651 else
2652 nid_loc = spec->slave_dig_outs;
2653 }
2654}
2655
2636static struct hda_input_mux cxt5066_capture_source = { 2656static struct hda_input_mux cxt5066_capture_source = {
2637 .num_items = 4, 2657 .num_items = 4,
2638 .items = { 2658 .items = {
@@ -3039,20 +3059,11 @@ static struct hda_verb cxt5066_init_verbs_hp_laptop[] = {
3039/* initialize jack-sensing, too */ 3059/* initialize jack-sensing, too */
3040static int cxt5066_init(struct hda_codec *codec) 3060static int cxt5066_init(struct hda_codec *codec)
3041{ 3061{
3042 struct conexant_spec *spec = codec->spec;
3043
3044 snd_printdd("CXT5066: init\n"); 3062 snd_printdd("CXT5066: init\n");
3045 conexant_init(codec); 3063 conexant_init(codec);
3046 if (codec->patch_ops.unsol_event) { 3064 if (codec->patch_ops.unsol_event) {
3047 cxt5066_hp_automute(codec); 3065 cxt5066_hp_automute(codec);
3048 if (spec->dell_vostro) 3066 cxt5066_automic(codec);
3049 cxt5066_vostro_automic(codec);
3050 else if (spec->ideapad)
3051 cxt5066_ideapad_automic(codec);
3052 else if (spec->thinkpad)
3053 cxt5066_thinkpad_automic(codec);
3054 else if (spec->hp_laptop)
3055 cxt5066_hp_laptop_automic(codec);
3056 } 3067 }
3057 cxt5066_set_mic_boost(codec); 3068 cxt5066_set_mic_boost(codec);
3058 return 0; 3069 return 0;
@@ -3080,6 +3091,7 @@ enum {
3080 CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */ 3091 CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */
3081 CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ 3092 CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */
3082 CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */ 3093 CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */
3094 CXT5066_ASUS, /* Asus K52JU, Lenovo G560 - Int mic at 0x1a and Ext mic at 0x1b */
3083 CXT5066_HP_LAPTOP, /* HP Laptop */ 3095 CXT5066_HP_LAPTOP, /* HP Laptop */
3084 CXT5066_MODELS 3096 CXT5066_MODELS
3085}; 3097};
@@ -3091,6 +3103,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
3091 [CXT5066_DELL_VOSTRO] = "dell-vostro", 3103 [CXT5066_DELL_VOSTRO] = "dell-vostro",
3092 [CXT5066_IDEAPAD] = "ideapad", 3104 [CXT5066_IDEAPAD] = "ideapad",
3093 [CXT5066_THINKPAD] = "thinkpad", 3105 [CXT5066_THINKPAD] = "thinkpad",
3106 [CXT5066_ASUS] = "asus",
3094 [CXT5066_HP_LAPTOP] = "hp-laptop", 3107 [CXT5066_HP_LAPTOP] = "hp-laptop",
3095}; 3108};
3096 3109
@@ -3102,7 +3115,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3102 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), 3115 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
3103 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 3116 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
3104 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), 3117 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
3105 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP), 3118 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS),
3119 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS),
3120 SND_PCI_QUIRK(0x1043, 0x1993, "Asus U50F", CXT5066_ASUS),
3106 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), 3121 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD),
3107 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), 3122 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
3108 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), 3123 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
@@ -3111,7 +3126,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3111 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), 3126 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
3112 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), 3127 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD),
3113 SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), 3128 SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
3129 SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
3114 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), 3130 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
3131 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
3115 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ 3132 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
3116 {} 3133 {}
3117}; 3134};
@@ -3133,7 +3150,8 @@ static int patch_cxt5066(struct hda_codec *codec)
3133 spec->multiout.max_channels = 2; 3150 spec->multiout.max_channels = 2;
3134 spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids); 3151 spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids);
3135 spec->multiout.dac_nids = cxt5066_dac_nids; 3152 spec->multiout.dac_nids = cxt5066_dac_nids;
3136 spec->multiout.dig_out_nid = CXT5066_SPDIF_OUT; 3153 conexant_check_dig_outs(codec, cxt5066_digout_pin_nids,
3154 ARRAY_SIZE(cxt5066_digout_pin_nids));
3137 spec->num_adc_nids = 1; 3155 spec->num_adc_nids = 1;
3138 spec->adc_nids = cxt5066_adc_nids; 3156 spec->adc_nids = cxt5066_adc_nids;
3139 spec->capsrc_nids = cxt5066_capsrc_nids; 3157 spec->capsrc_nids = cxt5066_capsrc_nids;
@@ -3167,17 +3185,20 @@ static int patch_cxt5066(struct hda_codec *codec)
3167 spec->num_init_verbs++; 3185 spec->num_init_verbs++;
3168 spec->dell_automute = 1; 3186 spec->dell_automute = 1;
3169 break; 3187 break;
3188 case CXT5066_ASUS:
3170 case CXT5066_HP_LAPTOP: 3189 case CXT5066_HP_LAPTOP:
3171 codec->patch_ops.init = cxt5066_init; 3190 codec->patch_ops.init = cxt5066_init;
3172 codec->patch_ops.unsol_event = cxt5066_hp_laptop_event; 3191 codec->patch_ops.unsol_event = cxt5066_unsol_event;
3173 spec->init_verbs[spec->num_init_verbs] = 3192 spec->init_verbs[spec->num_init_verbs] =
3174 cxt5066_init_verbs_hp_laptop; 3193 cxt5066_init_verbs_hp_laptop;
3175 spec->num_init_verbs++; 3194 spec->num_init_verbs++;
3176 spec->hp_laptop = 1; 3195 spec->hp_laptop = board_config == CXT5066_HP_LAPTOP;
3196 spec->asus = board_config == CXT5066_ASUS;
3177 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; 3197 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
3178 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 3198 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
3179 /* no S/PDIF out */ 3199 /* no S/PDIF out */
3180 spec->multiout.dig_out_nid = 0; 3200 if (board_config == CXT5066_HP_LAPTOP)
3201 spec->multiout.dig_out_nid = 0;
3181 /* input source automatically selected */ 3202 /* input source automatically selected */
3182 spec->input_mux = NULL; 3203 spec->input_mux = NULL;
3183 spec->port_d_mode = 0; 3204 spec->port_d_mode = 0;
@@ -3207,7 +3228,7 @@ static int patch_cxt5066(struct hda_codec *codec)
3207 break; 3228 break;
3208 case CXT5066_DELL_VOSTRO: 3229 case CXT5066_DELL_VOSTRO:
3209 codec->patch_ops.init = cxt5066_init; 3230 codec->patch_ops.init = cxt5066_init;
3210 codec->patch_ops.unsol_event = cxt5066_vostro_event; 3231 codec->patch_ops.unsol_event = cxt5066_unsol_event;
3211 spec->init_verbs[0] = cxt5066_init_verbs_vostro; 3232 spec->init_verbs[0] = cxt5066_init_verbs_vostro;
3212 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; 3233 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
3213 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 3234 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
@@ -3224,7 +3245,7 @@ static int patch_cxt5066(struct hda_codec *codec)
3224 break; 3245 break;
3225 case CXT5066_IDEAPAD: 3246 case CXT5066_IDEAPAD:
3226 codec->patch_ops.init = cxt5066_init; 3247 codec->patch_ops.init = cxt5066_init;
3227 codec->patch_ops.unsol_event = cxt5066_ideapad_event; 3248 codec->patch_ops.unsol_event = cxt5066_unsol_event;
3228 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; 3249 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
3229 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 3250 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
3230 spec->init_verbs[0] = cxt5066_init_verbs_ideapad; 3251 spec->init_verbs[0] = cxt5066_init_verbs_ideapad;
@@ -3240,7 +3261,7 @@ static int patch_cxt5066(struct hda_codec *codec)
3240 break; 3261 break;
3241 case CXT5066_THINKPAD: 3262 case CXT5066_THINKPAD:
3242 codec->patch_ops.init = cxt5066_init; 3263 codec->patch_ops.init = cxt5066_init;
3243 codec->patch_ops.unsol_event = cxt5066_thinkpad_event; 3264 codec->patch_ops.unsol_event = cxt5066_unsol_event;
3244 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; 3265 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
3245 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 3266 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
3246 spec->init_verbs[0] = cxt5066_init_verbs_thinkpad; 3267 spec->init_verbs[0] = cxt5066_init_verbs_thinkpad;
@@ -3389,7 +3410,7 @@ static void cx_auto_parse_output(struct hda_codec *codec)
3389 } 3410 }
3390 } 3411 }
3391 spec->multiout.dac_nids = spec->private_dac_nids; 3412 spec->multiout.dac_nids = spec->private_dac_nids;
3392 spec->multiout.max_channels = nums * 2; 3413 spec->multiout.max_channels = spec->multiout.num_dacs * 2;
3393 3414
3394 if (cfg->hp_outs > 0) 3415 if (cfg->hp_outs > 0)
3395 spec->auto_mute = 1; 3416 spec->auto_mute = 1;
@@ -3708,9 +3729,9 @@ static int cx_auto_init(struct hda_codec *codec)
3708 return 0; 3729 return 0;
3709} 3730}
3710 3731
3711static int cx_auto_add_volume(struct hda_codec *codec, const char *basename, 3732static int cx_auto_add_volume_idx(struct hda_codec *codec, const char *basename,
3712 const char *dir, int cidx, 3733 const char *dir, int cidx,
3713 hda_nid_t nid, int hda_dir) 3734 hda_nid_t nid, int hda_dir, int amp_idx)
3714{ 3735{
3715 static char name[32]; 3736 static char name[32];
3716 static struct snd_kcontrol_new knew[] = { 3737 static struct snd_kcontrol_new knew[] = {
@@ -3722,7 +3743,8 @@ static int cx_auto_add_volume(struct hda_codec *codec, const char *basename,
3722 3743
3723 for (i = 0; i < 2; i++) { 3744 for (i = 0; i < 2; i++) {
3724 struct snd_kcontrol *kctl; 3745 struct snd_kcontrol *kctl;
3725 knew[i].private_value = HDA_COMPOSE_AMP_VAL(nid, 3, 0, hda_dir); 3746 knew[i].private_value = HDA_COMPOSE_AMP_VAL(nid, 3, amp_idx,
3747 hda_dir);
3726 knew[i].subdevice = HDA_SUBDEV_AMP_FLAG; 3748 knew[i].subdevice = HDA_SUBDEV_AMP_FLAG;
3727 knew[i].index = cidx; 3749 knew[i].index = cidx;
3728 snprintf(name, sizeof(name), "%s%s %s", basename, dir, sfx[i]); 3750 snprintf(name, sizeof(name), "%s%s %s", basename, dir, sfx[i]);
@@ -3738,6 +3760,9 @@ static int cx_auto_add_volume(struct hda_codec *codec, const char *basename,
3738 return 0; 3760 return 0;
3739} 3761}
3740 3762
3763#define cx_auto_add_volume(codec, str, dir, cidx, nid, hda_dir) \
3764 cx_auto_add_volume_idx(codec, str, dir, cidx, nid, hda_dir, 0)
3765
3741#define cx_auto_add_pb_volume(codec, nid, str, idx) \ 3766#define cx_auto_add_pb_volume(codec, nid, str, idx) \
3742 cx_auto_add_volume(codec, str, " Playback", idx, nid, HDA_OUTPUT) 3767 cx_auto_add_volume(codec, str, " Playback", idx, nid, HDA_OUTPUT)
3743 3768
@@ -3787,29 +3812,60 @@ static int cx_auto_build_input_controls(struct hda_codec *codec)
3787 struct conexant_spec *spec = codec->spec; 3812 struct conexant_spec *spec = codec->spec;
3788 struct auto_pin_cfg *cfg = &spec->autocfg; 3813 struct auto_pin_cfg *cfg = &spec->autocfg;
3789 static const char *prev_label; 3814 static const char *prev_label;
3790 int i, err, cidx; 3815 int i, err, cidx, conn_len;
3816 hda_nid_t conn[HDA_MAX_CONNECTIONS];
3817
3818 int multi_adc_volume = 0; /* If the ADC nid has several input volumes */
3819 int adc_nid = spec->adc_nids[0];
3820
3821 conn_len = snd_hda_get_connections(codec, adc_nid, conn,
3822 HDA_MAX_CONNECTIONS);
3823 if (conn_len < 0)
3824 return conn_len;
3825
3826 multi_adc_volume = cfg->num_inputs > 1 && conn_len > 1;
3827 if (!multi_adc_volume) {
3828 err = cx_auto_add_volume(codec, "Capture", "", 0, adc_nid,
3829 HDA_INPUT);
3830 if (err < 0)
3831 return err;
3832 }
3791 3833
3792 err = cx_auto_add_volume(codec, "Capture", "", 0, spec->adc_nids[0],
3793 HDA_INPUT);
3794 if (err < 0)
3795 return err;
3796 prev_label = NULL; 3834 prev_label = NULL;
3797 cidx = 0; 3835 cidx = 0;
3798 for (i = 0; i < cfg->num_inputs; i++) { 3836 for (i = 0; i < cfg->num_inputs; i++) {
3799 hda_nid_t nid = cfg->inputs[i].pin; 3837 hda_nid_t nid = cfg->inputs[i].pin;
3800 const char *label; 3838 const char *label;
3801 if (!(get_wcaps(codec, nid) & AC_WCAP_IN_AMP)) 3839 int j;
3840 int pin_amp = get_wcaps(codec, nid) & AC_WCAP_IN_AMP;
3841 if (!pin_amp && !multi_adc_volume)
3802 continue; 3842 continue;
3843
3803 label = hda_get_autocfg_input_label(codec, cfg, i); 3844 label = hda_get_autocfg_input_label(codec, cfg, i);
3804 if (label == prev_label) 3845 if (label == prev_label)
3805 cidx++; 3846 cidx++;
3806 else 3847 else
3807 cidx = 0; 3848 cidx = 0;
3808 prev_label = label; 3849 prev_label = label;
3809 err = cx_auto_add_volume(codec, label, " Capture", cidx, 3850
3810 nid, HDA_INPUT); 3851 if (pin_amp) {
3811 if (err < 0) 3852 err = cx_auto_add_volume(codec, label, " Boost", cidx,
3812 return err; 3853 nid, HDA_INPUT);
3854 if (err < 0)
3855 return err;
3856 }
3857
3858 if (!multi_adc_volume)
3859 continue;
3860 for (j = 0; j < conn_len; j++) {
3861 if (conn[j] == nid) {
3862 err = cx_auto_add_volume_idx(codec, label,
3863 " Capture", cidx, adc_nid, HDA_INPUT, j);
3864 if (err < 0)
3865 return err;
3866 break;
3867 }
3868 }
3813 } 3869 }
3814 return 0; 3870 return 0;
3815} 3871}
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 2d5b83fa8d24..a58767736727 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -642,6 +642,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
642 hdmi_ai->ver = 0x01; 642 hdmi_ai->ver = 0x01;
643 hdmi_ai->len = 0x0a; 643 hdmi_ai->len = 0x0a;
644 hdmi_ai->CC02_CT47 = channels - 1; 644 hdmi_ai->CC02_CT47 = channels - 1;
645 hdmi_ai->CA = ca;
645 hdmi_checksum_audio_infoframe(hdmi_ai); 646 hdmi_checksum_audio_infoframe(hdmi_ai);
646 } else if (spec->sink_eld[i].conn_type == 1) { /* DisplayPort */ 647 } else if (spec->sink_eld[i].conn_type == 1) { /* DisplayPort */
647 struct dp_audio_infoframe *dp_ai; 648 struct dp_audio_infoframe *dp_ai;
@@ -651,6 +652,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
651 dp_ai->len = 0x1b; 652 dp_ai->len = 0x1b;
652 dp_ai->ver = 0x11 << 2; 653 dp_ai->ver = 0x11 << 2;
653 dp_ai->CC02_CT47 = channels - 1; 654 dp_ai->CC02_CT47 = channels - 1;
655 dp_ai->CA = ca;
654 } else { 656 } else {
655 snd_printd("HDMI: unknown connection type at pin %d\n", 657 snd_printd("HDMI: unknown connection type at pin %d\n",
656 pin_nid); 658 pin_nid);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7169c9a4d0b0..c5208c90784b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2290,6 +2290,29 @@ static struct snd_kcontrol_new alc888_base_mixer[] = {
2290 { } /* end */ 2290 { } /* end */
2291}; 2291};
2292 2292
2293static struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer[] = {
2294 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2295 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2296 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2297 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2298 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0f, 2, 0x0,
2299 HDA_OUTPUT),
2300 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0f, 2, 2, HDA_INPUT),
2301 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0f, 1, 0x0, HDA_OUTPUT),
2302 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0f, 1, 2, HDA_INPUT),
2303 HDA_CODEC_VOLUME("Side Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
2304 HDA_BIND_MUTE("Side Playback Switch", 0x0e, 2, HDA_INPUT),
2305 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2306 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2307 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2308 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2309 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2310 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2311 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2312 { } /* end */
2313};
2314
2315
2293static struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer[] = { 2316static struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer[] = {
2294 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 2317 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2295 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 2318 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
@@ -10359,7 +10382,7 @@ static struct alc_config_preset alc882_presets[] = {
10359 .init_hook = alc_automute_amp, 10382 .init_hook = alc_automute_amp,
10360 }, 10383 },
10361 [ALC888_ACER_ASPIRE_4930G] = { 10384 [ALC888_ACER_ASPIRE_4930G] = {
10362 .mixers = { alc888_base_mixer, 10385 .mixers = { alc888_acer_aspire_4930g_mixer,
10363 alc883_chmode_mixer }, 10386 alc883_chmode_mixer },
10364 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs, 10387 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
10365 alc888_acer_aspire_4930g_verbs }, 10388 alc888_acer_aspire_4930g_verbs },
@@ -14954,9 +14977,11 @@ static struct snd_pci_quirk alc269_fixup_tbl[] = {
14954 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 14977 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
14955 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 14978 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14956 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 14979 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
14957 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
14958 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
14959 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), 14980 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
14981 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
14982 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
14983 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
14984 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
14960 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 14985 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
14961 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 14986 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
14962 {} 14987 {}
@@ -18800,6 +18825,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
18800 ALC662_3ST_6ch_DIG), 18825 ALC662_3ST_6ch_DIG),
18801 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x", 18826 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
18802 ALC663_ASUS_H13), 18827 ALC663_ASUS_H13),
18828 SND_PCI_QUIRK(0x1991, 0x5628, "Ordissimo EVE", ALC662_LENOVO_101E),
18803 {} 18829 {}
18804}; 18830};
18805 18831
@@ -19492,6 +19518,7 @@ static const struct alc_fixup alc662_fixups[] = {
19492}; 19518};
19493 19519
19494static struct snd_pci_quirk alc662_fixup_tbl[] = { 19520static struct snd_pci_quirk alc662_fixup_tbl[] = {
19521 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
19495 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 19522 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
19496 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 19523 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
19497 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 19524 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index a76c3260d941..63b0054200a8 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -567,7 +567,7 @@ static void via_auto_init_analog_input(struct hda_codec *codec)
567 hda_nid_t nid = cfg->inputs[i].pin; 567 hda_nid_t nid = cfg->inputs[i].pin;
568 if (spec->smart51_enabled && is_smart51_pins(spec, nid)) 568 if (spec->smart51_enabled && is_smart51_pins(spec, nid))
569 ctl = PIN_OUT; 569 ctl = PIN_OUT;
570 else if (i == AUTO_PIN_MIC) 570 else if (cfg->inputs[i].type == AUTO_PIN_MIC)
571 ctl = PIN_VREF50; 571 ctl = PIN_VREF50;
572 else 572 else
573 ctl = PIN_IN; 573 ctl = PIN_IN;
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h
index c2ae63d17cd2..f53897a708b4 100644
--- a/sound/pci/oxygen/oxygen.h
+++ b/sound/pci/oxygen/oxygen.h
@@ -92,6 +92,8 @@ struct oxygen_model {
92 void (*update_dac_volume)(struct oxygen *chip); 92 void (*update_dac_volume)(struct oxygen *chip);
93 void (*update_dac_mute)(struct oxygen *chip); 93 void (*update_dac_mute)(struct oxygen *chip);
94 void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed); 94 void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed);
95 unsigned int (*adjust_dac_routing)(struct oxygen *chip,
96 unsigned int play_routing);
95 void (*gpio_changed)(struct oxygen *chip); 97 void (*gpio_changed)(struct oxygen *chip);
96 void (*uart_input)(struct oxygen *chip); 98 void (*uart_input)(struct oxygen *chip);
97 void (*ac97_switch)(struct oxygen *chip, 99 void (*ac97_switch)(struct oxygen *chip,
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index 9bff14d5895d..26c7e8bcb229 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -180,6 +180,8 @@ void oxygen_update_dac_routing(struct oxygen *chip)
180 (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | 180 (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) |
181 (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | 181 (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) |
182 (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); 182 (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT);
183 if (chip->model.adjust_dac_routing)
184 reg_value = chip->model.adjust_dac_routing(chip, reg_value);
183 oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, 185 oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value,
184 OXYGEN_PLAY_DAC0_SOURCE_MASK | 186 OXYGEN_PLAY_DAC0_SOURCE_MASK |
185 OXYGEN_PLAY_DAC1_SOURCE_MASK | 187 OXYGEN_PLAY_DAC1_SOURCE_MASK |
diff --git a/sound/pci/oxygen/xonar_dg.c b/sound/pci/oxygen/xonar_dg.c
index e1fa602eba79..bc6eb58be380 100644
--- a/sound/pci/oxygen/xonar_dg.c
+++ b/sound/pci/oxygen/xonar_dg.c
@@ -24,6 +24,11 @@
24 * 24 *
25 * SPI 0 -> CS4245 25 * SPI 0 -> CS4245
26 * 26 *
27 * I²S 1 -> CS4245
28 * I²S 2 -> CS4361 (center/LFE)
29 * I²S 3 -> CS4361 (surround)
30 * I²S 4 -> CS4361 (front)
31 *
27 * GPIO 3 <- ? 32 * GPIO 3 <- ?
28 * GPIO 4 <- headphone detect 33 * GPIO 4 <- headphone detect
29 * GPIO 5 -> route input jack to line-in (0) or mic-in (1) 34 * GPIO 5 -> route input jack to line-in (0) or mic-in (1)
@@ -36,6 +41,7 @@
36 * input 1 <- aux 41 * input 1 <- aux
37 * input 2 <- front mic 42 * input 2 <- front mic
38 * input 4 <- line/mic 43 * input 4 <- line/mic
44 * DAC out -> headphones
39 * aux out -> front panel headphones 45 * aux out -> front panel headphones
40 */ 46 */
41 47
@@ -207,6 +213,35 @@ static void set_cs4245_adc_params(struct oxygen *chip,
207 cs4245_write_cached(chip, CS4245_ADC_CTRL, value); 213 cs4245_write_cached(chip, CS4245_ADC_CTRL, value);
208} 214}
209 215
216static inline unsigned int shift_bits(unsigned int value,
217 unsigned int shift_from,
218 unsigned int shift_to,
219 unsigned int mask)
220{
221 if (shift_from < shift_to)
222 return (value << (shift_to - shift_from)) & mask;
223 else
224 return (value >> (shift_from - shift_to)) & mask;
225}
226
227static unsigned int adjust_dg_dac_routing(struct oxygen *chip,
228 unsigned int play_routing)
229{
230 return (play_routing & OXYGEN_PLAY_DAC0_SOURCE_MASK) |
231 shift_bits(play_routing,
232 OXYGEN_PLAY_DAC2_SOURCE_SHIFT,
233 OXYGEN_PLAY_DAC1_SOURCE_SHIFT,
234 OXYGEN_PLAY_DAC1_SOURCE_MASK) |
235 shift_bits(play_routing,
236 OXYGEN_PLAY_DAC1_SOURCE_SHIFT,
237 OXYGEN_PLAY_DAC2_SOURCE_SHIFT,
238 OXYGEN_PLAY_DAC2_SOURCE_MASK) |
239 shift_bits(play_routing,
240 OXYGEN_PLAY_DAC0_SOURCE_SHIFT,
241 OXYGEN_PLAY_DAC3_SOURCE_SHIFT,
242 OXYGEN_PLAY_DAC3_SOURCE_MASK);
243}
244
210static int output_switch_info(struct snd_kcontrol *ctl, 245static int output_switch_info(struct snd_kcontrol *ctl,
211 struct snd_ctl_elem_info *info) 246 struct snd_ctl_elem_info *info)
212{ 247{
@@ -557,6 +592,7 @@ struct oxygen_model model_xonar_dg = {
557 .resume = dg_resume, 592 .resume = dg_resume,
558 .set_dac_params = set_cs4245_dac_params, 593 .set_dac_params = set_cs4245_dac_params,
559 .set_adc_params = set_cs4245_adc_params, 594 .set_adc_params = set_cs4245_adc_params,
595 .adjust_dac_routing = adjust_dg_dac_routing,
560 .dump_registers = dump_cs4245_registers, 596 .dump_registers = dump_cs4245_registers,
561 .model_data_size = sizeof(struct dg), 597 .model_data_size = sizeof(struct dg),
562 .device_config = PLAYBACK_0_TO_I2S | 598 .device_config = PLAYBACK_0_TO_I2S |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h
index bd26e092aead..6ce9ad700290 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.h
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h
@@ -22,7 +22,7 @@
22#define __PDAUDIOCF_H 22#define __PDAUDIOCF_H
23 23
24#include <sound/pcm.h> 24#include <sound/pcm.h>
25#include <asm/io.h> 25#include <linux/io.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <pcmcia/cistpl.h> 27#include <pcmcia/cistpl.h>
28#include <pcmcia/ds.h> 28#include <pcmcia/ds.h>
diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c
index 989e04abb520..fe33e122e372 100644
--- a/sound/pcmcia/vx/vxp_ops.c
+++ b/sound/pcmcia/vx/vxp_ops.c
@@ -23,8 +23,8 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/firmware.h> 25#include <linux/firmware.h>
26#include <linux/io.h>
26#include <sound/core.h> 27#include <sound/core.h>
27#include <asm/io.h>
28#include "vxpocket.h" 28#include "vxpocket.h"
29 29
30 30
diff --git a/sound/soc/atmel/snd-soc-afeb9260.c b/sound/soc/atmel/snd-soc-afeb9260.c
index da2208e06b0d..5e4d499d8434 100644
--- a/sound/soc/atmel/snd-soc-afeb9260.c
+++ b/sound/soc/atmel/snd-soc-afeb9260.c
@@ -129,7 +129,7 @@ static struct snd_soc_dai_link afeb9260_dai = {
129 .cpu_dai_name = "atmel-ssc-dai.0", 129 .cpu_dai_name = "atmel-ssc-dai.0",
130 .codec_dai_name = "tlv320aic23-hifi", 130 .codec_dai_name = "tlv320aic23-hifi",
131 .platform_name = "atmel_pcm-audio", 131 .platform_name = "atmel_pcm-audio",
132 .codec_name = "tlv320aic23-codec.0-0x1a", 132 .codec_name = "tlv320aic23-codec.0-001a",
133 .init = afeb9260_tlv320aic23_init, 133 .init = afeb9260_tlv320aic23_init,
134 .ops = &afeb9260_ops, 134 .ops = &afeb9260_ops,
135}; 135};
diff --git a/sound/soc/blackfin/bf5xx-ssm2602.c b/sound/soc/blackfin/bf5xx-ssm2602.c
index e902b24c1856..ad28663f5bbd 100644
--- a/sound/soc/blackfin/bf5xx-ssm2602.c
+++ b/sound/soc/blackfin/bf5xx-ssm2602.c
@@ -119,7 +119,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai = {
119 .cpu_dai_name = "bf5xx-i2s", 119 .cpu_dai_name = "bf5xx-i2s",
120 .codec_dai_name = "ssm2602-hifi", 120 .codec_dai_name = "ssm2602-hifi",
121 .platform_name = "bf5xx-pcm-audio", 121 .platform_name = "bf5xx-pcm-audio",
122 .codec_name = "ssm2602-codec.0-0x1b", 122 .codec_name = "ssm2602-codec.0-001b",
123 .ops = &bf5xx_ssm2602_ops, 123 .ops = &bf5xx_ssm2602_ops,
124}; 124};
125 125
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index 46dbfd067f79..347a567b01e1 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec)
153 153
154static int cq93vc_probe(struct snd_soc_codec *codec) 154static int cq93vc_probe(struct snd_soc_codec *codec)
155{ 155{
156 struct davinci_vc *davinci_vc = codec->dev->platform_data; 156 struct davinci_vc *davinci_vc = snd_soc_codec_get_drvdata(codec);
157 157
158 davinci_vc->cq93vc.codec = codec; 158 davinci_vc->cq93vc.codec = codec;
159 codec->control_data = davinci_vc; 159 codec->control_data = davinci_vc;
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c
index 03d1e860d229..bb4bf65b9e7e 100644
--- a/sound/soc/codecs/cx20442.c
+++ b/sound/soc/codecs/cx20442.c
@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec)
367 return 0; 367 return 0;
368} 368}
369 369
370static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC;
371
370static struct snd_soc_codec_driver cx20442_codec_dev = { 372static struct snd_soc_codec_driver cx20442_codec_dev = {
371 .probe = cx20442_codec_probe, 373 .probe = cx20442_codec_probe,
372 .remove = cx20442_codec_remove, 374 .remove = cx20442_codec_remove,
375 .reg_cache_default = &cx20442_reg,
373 .reg_cache_size = 1, 376 .reg_cache_size = 1,
374 .reg_word_size = sizeof(u8), 377 .reg_word_size = sizeof(u8),
375 .read = cx20442_read_reg_cache, 378 .read = cx20442_read_reg_cache,
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 247a6a99feb8..37b8aa8a680f 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -1287,9 +1287,9 @@ SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0),
1287SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 1287SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0),
1288SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), 1288SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0),
1289 1289
1290SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", "AIF1 Capture", 1290SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL,
1291 0, WM8994_POWER_MANAGEMENT_4, 9, 0), 1291 0, WM8994_POWER_MANAGEMENT_4, 9, 0),
1292SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", "AIF1 Capture", 1292SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL,
1293 0, WM8994_POWER_MANAGEMENT_4, 8, 0), 1293 0, WM8994_POWER_MANAGEMENT_4, 8, 0),
1294SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0, 1294SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0,
1295 WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev, 1295 WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev,
@@ -1298,9 +1298,9 @@ SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0,
1298 WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev, 1298 WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev,
1299 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 1299 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1300 1300
1301SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", "AIF1 Capture", 1301SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL,
1302 0, WM8994_POWER_MANAGEMENT_4, 11, 0), 1302 0, WM8994_POWER_MANAGEMENT_4, 11, 0),
1303SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", "AIF1 Capture", 1303SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL,
1304 0, WM8994_POWER_MANAGEMENT_4, 10, 0), 1304 0, WM8994_POWER_MANAGEMENT_4, 10, 0),
1305SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0, 1305SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0,
1306 WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev, 1306 WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev,
@@ -1345,6 +1345,7 @@ SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0,
1345 1345
1346SND_SOC_DAPM_AIF_IN("AIF1DACDAT", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), 1346SND_SOC_DAPM_AIF_IN("AIF1DACDAT", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
1347SND_SOC_DAPM_AIF_IN("AIF2DACDAT", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0), 1347SND_SOC_DAPM_AIF_IN("AIF2DACDAT", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0),
1348SND_SOC_DAPM_AIF_OUT("AIF1ADCDAT", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0),
1348SND_SOC_DAPM_AIF_OUT("AIF2ADCDAT", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0), 1349SND_SOC_DAPM_AIF_OUT("AIF2ADCDAT", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0),
1349 1350
1350SND_SOC_DAPM_MUX("AIF1DAC Mux", SND_SOC_NOPM, 0, 0, &aif1dac_mux), 1351SND_SOC_DAPM_MUX("AIF1DAC Mux", SND_SOC_NOPM, 0, 0, &aif1dac_mux),
@@ -1546,6 +1547,11 @@ static const struct snd_soc_dapm_route intercon[] = {
1546 { "AIF2DAC2R Mixer", "Left Sidetone Switch", "Left Sidetone" }, 1547 { "AIF2DAC2R Mixer", "Left Sidetone Switch", "Left Sidetone" },
1547 { "AIF2DAC2R Mixer", "Right Sidetone Switch", "Right Sidetone" }, 1548 { "AIF2DAC2R Mixer", "Right Sidetone Switch", "Right Sidetone" },
1548 1549
1550 { "AIF1ADCDAT", NULL, "AIF1ADC1L" },
1551 { "AIF1ADCDAT", NULL, "AIF1ADC1R" },
1552 { "AIF1ADCDAT", NULL, "AIF1ADC2L" },
1553 { "AIF1ADCDAT", NULL, "AIF1ADC2R" },
1554
1549 { "AIF2ADCDAT", NULL, "AIF2ADC Mux" }, 1555 { "AIF2ADCDAT", NULL, "AIF2ADC Mux" },
1550 1556
1551 /* AIF3 output */ 1557 /* AIF3 output */
@@ -1578,6 +1584,13 @@ static const struct snd_soc_dapm_route intercon[] = {
1578 { "Right Headphone Mux", "DAC", "DAC1R" }, 1584 { "Right Headphone Mux", "DAC", "DAC1R" },
1579}; 1585};
1580 1586
1587static const struct snd_soc_dapm_route wm8994_revd_intercon[] = {
1588 { "AIF1DACDAT", NULL, "AIF2DACDAT" },
1589 { "AIF2DACDAT", NULL, "AIF1DACDAT" },
1590 { "AIF1ADCDAT", NULL, "AIF2ADCDAT" },
1591 { "AIF2ADCDAT", NULL, "AIF1ADCDAT" },
1592};
1593
1581static const struct snd_soc_dapm_route wm8994_intercon[] = { 1594static const struct snd_soc_dapm_route wm8994_intercon[] = {
1582 { "AIF2DACL", NULL, "AIF2DAC Mux" }, 1595 { "AIF2DACL", NULL, "AIF2DAC Mux" },
1583 { "AIF2DACR", NULL, "AIF2DAC Mux" }, 1596 { "AIF2DACR", NULL, "AIF2DAC Mux" },
@@ -2386,7 +2399,7 @@ static int wm8994_set_tristate(struct snd_soc_dai *codec_dai, int tristate)
2386 else 2399 else
2387 val = 0; 2400 val = 0;
2388 2401
2389 return snd_soc_update_bits(codec, reg, mask, reg); 2402 return snd_soc_update_bits(codec, reg, mask, val);
2390} 2403}
2391 2404
2392#define WM8994_RATES SNDRV_PCM_RATE_8000_96000 2405#define WM8994_RATES SNDRV_PCM_RATE_8000_96000
@@ -3129,6 +3142,11 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3129 case WM8994: 3142 case WM8994:
3130 snd_soc_dapm_add_routes(dapm, wm8994_intercon, 3143 snd_soc_dapm_add_routes(dapm, wm8994_intercon,
3131 ARRAY_SIZE(wm8994_intercon)); 3144 ARRAY_SIZE(wm8994_intercon));
3145
3146 if (wm8994->revision < 4)
3147 snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon,
3148 ARRAY_SIZE(wm8994_revd_intercon));
3149
3132 break; 3150 break;
3133 case WM8958: 3151 case WM8958:
3134 snd_soc_dapm_add_routes(dapm, wm8958_intercon, 3152 snd_soc_dapm_add_routes(dapm, wm8958_intercon,
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c
index 6045cbde492b..608c84c5aa8e 100644
--- a/sound/soc/codecs/wm8995.c
+++ b/sound/soc/codecs/wm8995.c
@@ -1223,7 +1223,7 @@ static int wm8995_set_tristate(struct snd_soc_dai *codec_dai, int tristate)
1223 else 1223 else
1224 val = 0; 1224 val = 0;
1225 1225
1226 return snd_soc_update_bits(codec, reg, mask, reg); 1226 return snd_soc_update_bits(codec, reg, mask, val);
1227} 1227}
1228 1228
1229/* The size in bits of the FLL divide multiplied by 10 1229/* The size in bits of the FLL divide multiplied by 10
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index c466982eed23..613df5db0b32 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -91,6 +91,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, unsigned int op)
91static void calibrate_dc_servo(struct snd_soc_codec *codec) 91static void calibrate_dc_servo(struct snd_soc_codec *codec)
92{ 92{
93 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); 93 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
94 s8 offset;
94 u16 reg, reg_l, reg_r, dcs_cfg; 95 u16 reg, reg_l, reg_r, dcs_cfg;
95 96
96 /* If we're using a digital only path and have a previously 97 /* If we're using a digital only path and have a previously
@@ -149,16 +150,14 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec)
149 hubs->dcs_codes); 150 hubs->dcs_codes);
150 151
151 /* HPOUT1L */ 152 /* HPOUT1L */
152 if (reg_l + hubs->dcs_codes > 0 && 153 offset = reg_l;
153 reg_l + hubs->dcs_codes < 0xff) 154 offset += hubs->dcs_codes;
154 reg_l += hubs->dcs_codes; 155 dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
155 dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
156 156
157 /* HPOUT1R */ 157 /* HPOUT1R */
158 if (reg_r + hubs->dcs_codes > 0 && 158 offset = reg_r;
159 reg_r + hubs->dcs_codes < 0xff) 159 offset += hubs->dcs_codes;
160 reg_r += hubs->dcs_codes; 160 dcs_cfg |= (u8)offset;
161 dcs_cfg |= reg_r;
162 161
163 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); 162 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg);
164 163
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 0c2d6bacc681..fe7984221eb9 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -218,12 +218,24 @@ static struct snd_soc_dai_link dm6467_evm_dai[] = {
218 .ops = &evm_spdif_ops, 218 .ops = &evm_spdif_ops,
219 }, 219 },
220}; 220};
221static struct snd_soc_dai_link da8xx_evm_dai = { 221
222static struct snd_soc_dai_link da830_evm_dai = {
223 .name = "TLV320AIC3X",
224 .stream_name = "AIC3X",
225 .cpu_dai_name = "davinci-mcasp.1",
226 .codec_dai_name = "tlv320aic3x-hifi",
227 .codec_name = "tlv320aic3x-codec.1-0018",
228 .platform_name = "davinci-pcm-audio",
229 .init = evm_aic3x_init,
230 .ops = &evm_ops,
231};
232
233static struct snd_soc_dai_link da850_evm_dai = {
222 .name = "TLV320AIC3X", 234 .name = "TLV320AIC3X",
223 .stream_name = "AIC3X", 235 .stream_name = "AIC3X",
224 .cpu_dai_name= "davinci-mcasp.0", 236 .cpu_dai_name= "davinci-mcasp.0",
225 .codec_dai_name = "tlv320aic3x-hifi", 237 .codec_dai_name = "tlv320aic3x-hifi",
226 .codec_name = "tlv320aic3x-codec.0-001a", 238 .codec_name = "tlv320aic3x-codec.1-0018",
227 .platform_name = "davinci-pcm-audio", 239 .platform_name = "davinci-pcm-audio",
228 .init = evm_aic3x_init, 240 .init = evm_aic3x_init,
229 .ops = &evm_ops, 241 .ops = &evm_ops,
@@ -259,13 +271,13 @@ static struct snd_soc_card dm6467_snd_soc_card_evm = {
259 271
260static struct snd_soc_card da830_snd_soc_card = { 272static struct snd_soc_card da830_snd_soc_card = {
261 .name = "DA830/OMAP-L137 EVM", 273 .name = "DA830/OMAP-L137 EVM",
262 .dai_link = &da8xx_evm_dai, 274 .dai_link = &da830_evm_dai,
263 .num_links = 1, 275 .num_links = 1,
264}; 276};
265 277
266static struct snd_soc_card da850_snd_soc_card = { 278static struct snd_soc_card da850_snd_soc_card = {
267 .name = "DA850/OMAP-L138 EVM", 279 .name = "DA850/OMAP-L138 EVM",
268 .dai_link = &da8xx_evm_dai, 280 .dai_link = &da850_evm_dai,
269 .num_links = 1, 281 .num_links = 1,
270}; 282};
271 283
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 2101bdcee21f..3167be689621 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -507,8 +507,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
507 /* Set up digital mute if not provided by the codec */ 507 /* Set up digital mute if not provided by the codec */
508 if (!codec_dai->driver->ops) { 508 if (!codec_dai->driver->ops) {
509 codec_dai->driver->ops = &ams_delta_dai_ops; 509 codec_dai->driver->ops = &ams_delta_dai_ops;
510 } else if (!codec_dai->driver->ops->digital_mute) {
511 codec_dai->driver->ops->digital_mute = ams_delta_digital_mute;
512 } else { 510 } else {
513 ams_delta_ops.startup = ams_delta_startup; 511 ams_delta_ops.startup = ams_delta_startup;
514 ams_delta_ops.shutdown = ams_delta_shutdown; 512 ams_delta_ops.shutdown = ams_delta_shutdown;
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index fc592f0d5fc7..784cff5f67e8 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -307,10 +307,10 @@ static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd)
307static struct snd_soc_dai_link corgi_dai = { 307static struct snd_soc_dai_link corgi_dai = {
308 .name = "WM8731", 308 .name = "WM8731",
309 .stream_name = "WM8731", 309 .stream_name = "WM8731",
310 .cpu_dai_name = "pxa-is2-dai", 310 .cpu_dai_name = "pxa2xx-i2s",
311 .codec_dai_name = "wm8731-hifi", 311 .codec_dai_name = "wm8731-hifi",
312 .platform_name = "pxa-pcm-audio", 312 .platform_name = "pxa-pcm-audio",
313 .codec_name = "wm8731-codec-0.001a", 313 .codec_name = "wm8731-codec-0.001b",
314 .init = corgi_wm8731_init, 314 .init = corgi_wm8731_init,
315 .ops = &corgi_ops, 315 .ops = &corgi_ops,
316}; 316};
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index 6298ee115e27..a7d4999f9b24 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -276,7 +276,7 @@ static struct snd_soc_dai_link poodle_dai = {
276 .cpu_dai_name = "pxa2xx-i2s", 276 .cpu_dai_name = "pxa2xx-i2s",
277 .codec_dai_name = "wm8731-hifi", 277 .codec_dai_name = "wm8731-hifi",
278 .platform_name = "pxa-pcm-audio", 278 .platform_name = "pxa-pcm-audio",
279 .codec_name = "wm8731-codec.0-001a", 279 .codec_name = "wm8731-codec.0-001b",
280 .init = poodle_wm8731_init, 280 .init = poodle_wm8731_init,
281 .ops = &poodle_ops, 281 .ops = &poodle_ops,
282}; 282};
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index c2acb69b957a..8e1571350630 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -315,10 +315,10 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd)
315static struct snd_soc_dai_link spitz_dai = { 315static struct snd_soc_dai_link spitz_dai = {
316 .name = "wm8750", 316 .name = "wm8750",
317 .stream_name = "WM8750", 317 .stream_name = "WM8750",
318 .cpu_dai_name = "pxa-is2", 318 .cpu_dai_name = "pxa2xx-i2s",
319 .codec_dai_name = "wm8750-hifi", 319 .codec_dai_name = "wm8750-hifi",
320 .platform_name = "pxa-pcm-audio", 320 .platform_name = "pxa-pcm-audio",
321 .codec_name = "wm8750-codec.0-001a", 321 .codec_name = "wm8750-codec.0-001b",
322 .init = spitz_wm8750_init, 322 .init = spitz_wm8750_init,
323 .ops = &spitz_ops, 323 .ops = &spitz_ops,
324}; 324};
diff --git a/sound/soc/samsung/neo1973_gta02_wm8753.c b/sound/soc/samsung/neo1973_gta02_wm8753.c
index 3eec610c10f9..0d0ae2b9eef6 100644
--- a/sound/soc/samsung/neo1973_gta02_wm8753.c
+++ b/sound/soc/samsung/neo1973_gta02_wm8753.c
@@ -397,11 +397,11 @@ static struct snd_soc_dai_link neo1973_gta02_dai[] = {
397{ /* Hifi Playback - for similatious use with voice below */ 397{ /* Hifi Playback - for similatious use with voice below */
398 .name = "WM8753", 398 .name = "WM8753",
399 .stream_name = "WM8753 HiFi", 399 .stream_name = "WM8753 HiFi",
400 .cpu_dai_name = "s3c24xx-i2s", 400 .cpu_dai_name = "s3c24xx-iis",
401 .codec_dai_name = "wm8753-hifi", 401 .codec_dai_name = "wm8753-hifi",
402 .init = neo1973_gta02_wm8753_init, 402 .init = neo1973_gta02_wm8753_init,
403 .platform_name = "samsung-audio", 403 .platform_name = "samsung-audio",
404 .codec_name = "wm8753-codec.0-0x1a", 404 .codec_name = "wm8753-codec.0-001a",
405 .ops = &neo1973_gta02_hifi_ops, 405 .ops = &neo1973_gta02_hifi_ops,
406}, 406},
407{ /* Voice via BT */ 407{ /* Voice via BT */
@@ -410,7 +410,7 @@ static struct snd_soc_dai_link neo1973_gta02_dai[] = {
410 .cpu_dai_name = "bluetooth-dai", 410 .cpu_dai_name = "bluetooth-dai",
411 .codec_dai_name = "wm8753-voice", 411 .codec_dai_name = "wm8753-voice",
412 .ops = &neo1973_gta02_voice_ops, 412 .ops = &neo1973_gta02_voice_ops,
413 .codec_name = "wm8753-codec.0-0x1a", 413 .codec_name = "wm8753-codec.0-001a",
414 .platform_name = "samsung-audio", 414 .platform_name = "samsung-audio",
415}, 415},
416}; 416};
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c
index c7a24514beb5..d20815d5ab2e 100644
--- a/sound/soc/samsung/neo1973_wm8753.c
+++ b/sound/soc/samsung/neo1973_wm8753.c
@@ -559,9 +559,9 @@ static struct snd_soc_dai_link neo1973_dai[] = {
559 .name = "WM8753", 559 .name = "WM8753",
560 .stream_name = "WM8753 HiFi", 560 .stream_name = "WM8753 HiFi",
561 .platform_name = "samsung-audio", 561 .platform_name = "samsung-audio",
562 .cpu_dai_name = "s3c24xx-i2s", 562 .cpu_dai_name = "s3c24xx-iis",
563 .codec_dai_name = "wm8753-hifi", 563 .codec_dai_name = "wm8753-hifi",
564 .codec_name = "wm8753-codec.0-0x1a", 564 .codec_name = "wm8753-codec.0-001a",
565 .init = neo1973_wm8753_init, 565 .init = neo1973_wm8753_init,
566 .ops = &neo1973_hifi_ops, 566 .ops = &neo1973_hifi_ops,
567}, 567},
@@ -571,7 +571,7 @@ static struct snd_soc_dai_link neo1973_dai[] = {
571 .platform_name = "samsung-audio", 571 .platform_name = "samsung-audio",
572 .cpu_dai_name = "bluetooth-dai", 572 .cpu_dai_name = "bluetooth-dai",
573 .codec_dai_name = "wm8753-voice", 573 .codec_dai_name = "wm8753-voice",
574 .codec_name = "wm8753-codec.0-0x1a", 574 .codec_name = "wm8753-codec.0-001a",
575 .ops = &neo1973_voice_ops, 575 .ops = &neo1973_voice_ops,
576}, 576},
577}; 577};
diff --git a/sound/soc/samsung/s3c24xx_simtec_hermes.c b/sound/soc/samsung/s3c24xx_simtec_hermes.c
index bb4292e3596c..08fcaaa66907 100644
--- a/sound/soc/samsung/s3c24xx_simtec_hermes.c
+++ b/sound/soc/samsung/s3c24xx_simtec_hermes.c
@@ -94,8 +94,8 @@ static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd)
94static struct snd_soc_dai_link simtec_dai_aic33 = { 94static struct snd_soc_dai_link simtec_dai_aic33 = {
95 .name = "tlv320aic33", 95 .name = "tlv320aic33",
96 .stream_name = "TLV320AIC33", 96 .stream_name = "TLV320AIC33",
97 .codec_name = "tlv320aic3x-codec.0-0x1a", 97 .codec_name = "tlv320aic3x-codec.0-001a",
98 .cpu_dai_name = "s3c24xx-i2s", 98 .cpu_dai_name = "s3c24xx-iis",
99 .codec_dai_name = "tlv320aic3x-hifi", 99 .codec_dai_name = "tlv320aic3x-hifi",
100 .platform_name = "samsung-audio", 100 .platform_name = "samsung-audio",
101 .init = simtec_hermes_init, 101 .init = simtec_hermes_init,
diff --git a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
index fbba4e367729..116e3e670167 100644
--- a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
+++ b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
@@ -85,8 +85,8 @@ static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
85static struct snd_soc_dai_link simtec_dai_aic23 = { 85static struct snd_soc_dai_link simtec_dai_aic23 = {
86 .name = "tlv320aic23", 86 .name = "tlv320aic23",
87 .stream_name = "TLV320AIC23", 87 .stream_name = "TLV320AIC23",
88 .codec_name = "tlv320aic3x-codec.0-0x1a", 88 .codec_name = "tlv320aic3x-codec.0-001a",
89 .cpu_dai_name = "s3c24xx-i2s", 89 .cpu_dai_name = "s3c24xx-iis",
90 .codec_dai_name = "tlv320aic3x-hifi", 90 .codec_dai_name = "tlv320aic3x-hifi",
91 .platform_name = "samsung-audio", 91 .platform_name = "samsung-audio",
92 .init = simtec_tlv320aic23_init, 92 .init = simtec_tlv320aic23_init,
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c
index cdc8ecbcb8ef..2c09e93dd566 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -228,7 +228,7 @@ static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {
228 .stream_name = "UDA134X", 228 .stream_name = "UDA134X",
229 .codec_name = "uda134x-hifi", 229 .codec_name = "uda134x-hifi",
230 .codec_dai_name = "uda134x-hifi", 230 .codec_dai_name = "uda134x-hifi",
231 .cpu_dai_name = "s3c24xx-i2s", 231 .cpu_dai_name = "s3c24xx-iis",
232 .ops = &s3c24xx_uda134x_ops, 232 .ops = &s3c24xx_uda134x_ops,
233 .platform_name = "samsung-audio", 233 .platform_name = "samsung-audio",
234}; 234};
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index bac7291b6ff6..c3f6f1e72790 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1449,6 +1449,7 @@ static int soc_post_component_init(struct snd_soc_card *card,
1449 rtd = &card->rtd_aux[num]; 1449 rtd = &card->rtd_aux[num];
1450 name = aux_dev->name; 1450 name = aux_dev->name;
1451 } 1451 }
1452 rtd->card = card;
1452 1453
1453 /* machine controls, routes and widgets are not prefixed */ 1454 /* machine controls, routes and widgets are not prefixed */
1454 temp = codec->name_prefix; 1455 temp = codec->name_prefix;
@@ -1471,7 +1472,6 @@ static int soc_post_component_init(struct snd_soc_card *card,
1471 1472
1472 /* register the rtd device */ 1473 /* register the rtd device */
1473 rtd->codec = codec; 1474 rtd->codec = codec;
1474 rtd->card = card;
1475 rtd->dev.parent = card->dev; 1475 rtd->dev.parent = card->dev;
1476 rtd->dev.release = rtd_release; 1476 rtd->dev.release = rtd_release;
1477 rtd->dev.init_name = name; 1477 rtd->dev.init_name = name;
@@ -1664,9 +1664,6 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num)
1664 goto out; 1664 goto out;
1665 1665
1666found: 1666found:
1667 if (!try_module_get(codec->dev->driver->owner))
1668 return -ENODEV;
1669
1670 ret = soc_probe_codec(card, codec); 1667 ret = soc_probe_codec(card, codec);
1671 if (ret < 0) 1668 if (ret < 0)
1672 return ret; 1669 return ret;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 499730ab5638..8194f150bab7 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1742,7 +1742,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
1742 int max = mc->max; 1742 int max = mc->max;
1743 unsigned int mask = (1 << fls(max)) - 1; 1743 unsigned int mask = (1 << fls(max)) - 1;
1744 unsigned int invert = mc->invert; 1744 unsigned int invert = mc->invert;
1745 unsigned int val, val_mask; 1745 unsigned int val;
1746 int connect, change; 1746 int connect, change;
1747 struct snd_soc_dapm_update update; 1747 struct snd_soc_dapm_update update;
1748 1748
@@ -1750,13 +1750,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
1750 1750
1751 if (invert) 1751 if (invert)
1752 val = max - val; 1752 val = max - val;
1753 val_mask = mask << shift; 1753 mask = mask << shift;
1754 val = val << shift; 1754 val = val << shift;
1755 1755
1756 mutex_lock(&widget->codec->mutex); 1756 mutex_lock(&widget->codec->mutex);
1757 widget->value = val; 1757 widget->value = val;
1758 1758
1759 change = snd_soc_test_bits(widget->codec, reg, val_mask, val); 1759 change = snd_soc_test_bits(widget->codec, reg, mask, val);
1760 if (change) { 1760 if (change) {
1761 if (val) 1761 if (val)
1762 /* new connection */ 1762 /* new connection */
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index e411cd323d57..d0d493ca28ae 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -785,7 +785,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
785 } 785 }
786 786
787 dev->pcm->private_data = dev; 787 dev->pcm->private_data = dev;
788 strcpy(dev->pcm->name, dev->product_name); 788 strlcpy(dev->pcm->name, dev->product_name, sizeof(dev->pcm->name));
789 789
790 memset(dev->sub_playback, 0, sizeof(dev->sub_playback)); 790 memset(dev->sub_playback, 0, sizeof(dev->sub_playback));
791 memset(dev->sub_capture, 0, sizeof(dev->sub_capture)); 791 memset(dev->sub_capture, 0, sizeof(dev->sub_capture));
diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c
index 2f218c77fff2..a1a47088fd0c 100644
--- a/sound/usb/caiaq/midi.c
+++ b/sound/usb/caiaq/midi.c
@@ -136,7 +136,7 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device)
136 if (ret < 0) 136 if (ret < 0)
137 return ret; 137 return ret;
138 138
139 strcpy(rmidi->name, device->product_name); 139 strlcpy(rmidi->name, device->product_name, sizeof(rmidi->name));
140 140
141 rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX; 141 rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX;
142 rmidi->private_data = device; 142 rmidi->private_data = device;
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 800f7cb4f251..c0f8270bc199 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -323,6 +323,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
323 return -ENOMEM; 323 return -ENOMEM;
324 } 324 }
325 325
326 mutex_init(&chip->shutdown_mutex);
326 chip->index = idx; 327 chip->index = idx;
327 chip->dev = dev; 328 chip->dev = dev;
328 chip->card = card; 329 chip->card = card;
@@ -531,6 +532,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
531 chip = ptr; 532 chip = ptr;
532 card = chip->card; 533 card = chip->card;
533 mutex_lock(&register_mutex); 534 mutex_lock(&register_mutex);
535 mutex_lock(&chip->shutdown_mutex);
534 chip->shutdown = 1; 536 chip->shutdown = 1;
535 chip->num_interfaces--; 537 chip->num_interfaces--;
536 if (chip->num_interfaces <= 0) { 538 if (chip->num_interfaces <= 0) {
@@ -548,9 +550,11 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
548 snd_usb_mixer_disconnect(p); 550 snd_usb_mixer_disconnect(p);
549 } 551 }
550 usb_chip[chip->index] = NULL; 552 usb_chip[chip->index] = NULL;
553 mutex_unlock(&chip->shutdown_mutex);
551 mutex_unlock(&register_mutex); 554 mutex_unlock(&register_mutex);
552 snd_card_free_when_closed(card); 555 snd_card_free_when_closed(card);
553 } else { 556 } else {
557 mutex_unlock(&chip->shutdown_mutex);
554 mutex_unlock(&register_mutex); 558 mutex_unlock(&register_mutex);
555 } 559 }
556} 560}
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 844cf786e81c..675a4f1b5de1 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -95,7 +95,7 @@ enum {
95}; 95};
96 96
97 97
98/*E-mu 0202(0404) eXtension Unit(XU) control*/ 98/*E-mu 0202/0404/0204 eXtension Unit(XU) control*/
99enum { 99enum {
100 USB_XU_CLOCK_RATE = 0xe301, 100 USB_XU_CLOCK_RATE = 0xe301,
101 USB_XU_CLOCK_SOURCE = 0xe302, 101 USB_XU_CLOCK_SOURCE = 0xe302,
@@ -1583,7 +1583,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw
1583 cval->initialized = 1; 1583 cval->initialized = 1;
1584 } else { 1584 } else {
1585 if (type == USB_XU_CLOCK_RATE) { 1585 if (type == USB_XU_CLOCK_RATE) {
1586 /* E-Mu USB 0404/0202/TrackerPre 1586 /* E-Mu USB 0404/0202/TrackerPre/0204
1587 * samplerate control quirk 1587 * samplerate control quirk
1588 */ 1588 */
1589 cval->min = 0; 1589 cval->min = 0;
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 4132522ac90f..e3f680526cb5 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -361,6 +361,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
361 } 361 }
362 362
363 if (changed) { 363 if (changed) {
364 mutex_lock(&subs->stream->chip->shutdown_mutex);
364 /* format changed */ 365 /* format changed */
365 snd_usb_release_substream_urbs(subs, 0); 366 snd_usb_release_substream_urbs(subs, 0);
366 /* influenced: period_bytes, channels, rate, format, */ 367 /* influenced: period_bytes, channels, rate, format, */
@@ -368,6 +369,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
368 params_rate(hw_params), 369 params_rate(hw_params),
369 snd_pcm_format_physical_width(params_format(hw_params)) * 370 snd_pcm_format_physical_width(params_format(hw_params)) *
370 params_channels(hw_params)); 371 params_channels(hw_params));
372 mutex_unlock(&subs->stream->chip->shutdown_mutex);
371 } 373 }
372 374
373 return ret; 375 return ret;
@@ -385,8 +387,9 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream)
385 subs->cur_audiofmt = NULL; 387 subs->cur_audiofmt = NULL;
386 subs->cur_rate = 0; 388 subs->cur_rate = 0;
387 subs->period_bytes = 0; 389 subs->period_bytes = 0;
388 if (!subs->stream->chip->shutdown) 390 mutex_lock(&subs->stream->chip->shutdown_mutex);
389 snd_usb_release_substream_urbs(subs, 0); 391 snd_usb_release_substream_urbs(subs, 0);
392 mutex_unlock(&subs->stream->chip->shutdown_mutex);
390 return snd_pcm_lib_free_vmalloc_buffer(substream); 393 return snd_pcm_lib_free_vmalloc_buffer(substream);
391} 394}
392 395
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index e1e245d0e5ec..c0dcfca9b5b5 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -79,6 +79,13 @@
79 .idProduct = 0x3f0a, 79 .idProduct = 0x3f0a,
80 .bInterfaceClass = USB_CLASS_AUDIO, 80 .bInterfaceClass = USB_CLASS_AUDIO,
81}, 81},
82{
83 /* E-Mu 0204 USB */
84 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
85 .idVendor = 0x041e,
86 .idProduct = 0x3f19,
87 .bInterfaceClass = USB_CLASS_AUDIO,
88},
82 89
83/* 90/*
84 * Logitech QuickCam: bDeviceClass is vendor-specific, so generic interface 91 * Logitech QuickCam: bDeviceClass is vendor-specific, so generic interface
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index ca860e611263..355759bad581 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -566,7 +566,7 @@ int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, struct audioformat
566} 566}
567 567
568/* 568/*
569 * For E-Mu 0404USB/0202USB/TrackerPre sample rate should be set for device, 569 * For E-Mu 0404USB/0202USB/TrackerPre/0204 sample rate should be set for device,
570 * not for interface. 570 * not for interface.
571 */ 571 */
572 572
@@ -623,6 +623,7 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
623 case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */ 623 case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */
624 case USB_ID(0x041e, 0x3f04): /* E-Mu 0404 USB */ 624 case USB_ID(0x041e, 0x3f04): /* E-Mu 0404 USB */
625 case USB_ID(0x041e, 0x3f0a): /* E-Mu Tracker Pre */ 625 case USB_ID(0x041e, 0x3f0a): /* E-Mu Tracker Pre */
626 case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */
626 set_format_emu_quirk(subs, fmt); 627 set_format_emu_quirk(subs, fmt);
627 break; 628 break;
628 } 629 }
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index db3eb21627ee..6e66fffe87f5 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -36,6 +36,7 @@ struct snd_usb_audio {
36 struct snd_card *card; 36 struct snd_card *card;
37 u32 usb_id; 37 u32 usb_id;
38 int shutdown; 38 int shutdown;
39 struct mutex shutdown_mutex;
39 unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ 40 unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */
40 int num_interfaces; 41 int num_interfaces;
41 int num_suspended_intf; 42 int num_suspended_intf;