aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/sa11xx-uda1341.c2
-rw-r--r--sound/core/oss/pcm_oss.c49
-rw-r--r--sound/core/oss/pcm_plugin.h4
-rw-r--r--sound/core/pcm.c2
-rw-r--r--sound/core/pcm_native.c6
-rw-r--r--sound/core/seq/oss/seq_oss_device.h2
-rw-r--r--sound/core/seq/seq_prioq.c3
-rw-r--r--sound/drivers/mtpav.c12
-rw-r--r--sound/drivers/mts64.c2
-rw-r--r--sound/drivers/opl3/opl3_lib.c2
-rw-r--r--sound/drivers/opl3/opl3_midi.c30
-rw-r--r--sound/drivers/opl3/opl3_oss.c8
-rw-r--r--sound/drivers/opl3/opl3_synth.c2
-rw-r--r--sound/drivers/pcsp/pcsp.c2
-rw-r--r--sound/drivers/serial-u16550.c18
-rw-r--r--sound/drivers/virmidi.c4
-rw-r--r--sound/drivers/vx/vx_core.c3
-rw-r--r--sound/mips/au1x00.c2
-rw-r--r--sound/oss/dmasound/dmasound_atari.c5
-rw-r--r--sound/oss/dmasound/dmasound_q40.c16
-rw-r--r--sound/pci/ac97/ac97_codec.c5
-rw-r--r--sound/pci/ak4531_codec.c3
-rw-r--r--sound/pci/als300.c2
-rw-r--r--sound/pci/au88x0/au88x0_a3d.c7
-rw-r--r--sound/pci/au88x0/au88x0_core.c19
-rw-r--r--sound/pci/au88x0/au88x0_synth.c39
-rw-r--r--sound/pci/azt3328.c8
-rw-r--r--sound/pci/ca0106/ca0106_main.c91
-rw-r--r--sound/pci/cs4281.c6
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c6
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.h6
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c2
-rw-r--r--sound/pci/ens1370.c3
-rw-r--r--sound/pci/es1938.c23
-rw-r--r--sound/pci/hda/hda_beep.c1
-rw-r--r--sound/pci/hda/hda_codec.c111
-rw-r--r--sound/pci/hda/hda_codec.h2
-rw-r--r--sound/pci/hda/hda_intel.c6
-rw-r--r--sound/pci/hda/hda_local.h3
-rw-r--r--sound/pci/hda/patch_analog.c5
-rw-r--r--sound/pci/hda/patch_nvhdmi.c4
-rw-r--r--sound/pci/hda/patch_realtek.c19
-rw-r--r--sound/pci/hda/patch_sigmatel.c159
-rw-r--r--sound/pci/mixart/mixart_hwdep.c46
-rw-r--r--sound/pci/oxygen/virtuoso.c17
-rw-r--r--sound/pci/sonicvibes.c109
-rw-r--r--sound/pci/trident/trident_main.c57
-rw-r--r--sound/pci/via82xx.c5
-rw-r--r--sound/pci/via82xx_modem.c5
-rw-r--r--sound/pci/vx222/vx222_ops.c8
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c14
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf_core.c23
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf_irq.c4
-rw-r--r--sound/ppc/snd_ps3.c4
-rw-r--r--sound/soc/codecs/twl4030.c12
-rw-r--r--sound/soc/soc-core.c37
-rw-r--r--sound/soc/soc-dapm.c83
-rw-r--r--sound/sparc/amd7930.c5
-rw-r--r--sound/synth/emux/emux_oss.c2
-rw-r--r--sound/synth/emux/emux_seq.c16
-rw-r--r--sound/synth/emux/emux_synth.c6
-rw-r--r--sound/synth/emux/soundfont.c28
-rw-r--r--sound/usb/caiaq/caiaq-device.c2
-rw-r--r--sound/usb/caiaq/caiaq-device.h1
-rw-r--r--sound/usb/caiaq/caiaq-midi.c32
-rw-r--r--sound/usb/usbquirks.h8
66 files changed, 778 insertions, 450 deletions
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index 51d708c31e65..7101d3d8bae6 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -915,7 +915,7 @@ static int __devinit sa11xx_uda1341_probe(struct platform_device *devptr)
915 snd_card_set_dev(card, &devptr->dev); 915 snd_card_set_dev(card, &devptr->dev);
916 916
917 if ((err = snd_card_register(card)) == 0) { 917 if ((err = snd_card_register(card)) == 0) {
918 printk( KERN_INFO "iPAQ audio support initialized\n" ); 918 printk(KERN_INFO "iPAQ audio support initialized\n");
919 platform_set_drvdata(devptr, card); 919 platform_set_drvdata(devptr, card);
920 return 0; 920 return 0;
921 } 921 }
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index e17836680f49..4b883595a85a 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1160,9 +1160,11 @@ snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream, const
1160 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { 1160 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
1161#ifdef OSS_DEBUG 1161#ifdef OSS_DEBUG
1162 if (runtime->status->state == SNDRV_PCM_STATE_XRUN) 1162 if (runtime->status->state == SNDRV_PCM_STATE_XRUN)
1163 printk("pcm_oss: write: recovering from XRUN\n"); 1163 printk(KERN_DEBUG "pcm_oss: write: "
1164 "recovering from XRUN\n");
1164 else 1165 else
1165 printk("pcm_oss: write: recovering from SUSPEND\n"); 1166 printk(KERN_DEBUG "pcm_oss: write: "
1167 "recovering from SUSPEND\n");
1166#endif 1168#endif
1167 ret = snd_pcm_oss_prepare(substream); 1169 ret = snd_pcm_oss_prepare(substream);
1168 if (ret < 0) 1170 if (ret < 0)
@@ -1196,9 +1198,11 @@ snd_pcm_sframes_t snd_pcm_oss_read3(struct snd_pcm_substream *substream, char *p
1196 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { 1198 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
1197#ifdef OSS_DEBUG 1199#ifdef OSS_DEBUG
1198 if (runtime->status->state == SNDRV_PCM_STATE_XRUN) 1200 if (runtime->status->state == SNDRV_PCM_STATE_XRUN)
1199 printk("pcm_oss: read: recovering from XRUN\n"); 1201 printk(KERN_DEBUG "pcm_oss: read: "
1202 "recovering from XRUN\n");
1200 else 1203 else
1201 printk("pcm_oss: read: recovering from SUSPEND\n"); 1204 printk(KERN_DEBUG "pcm_oss: read: "
1205 "recovering from SUSPEND\n");
1202#endif 1206#endif
1203 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL); 1207 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
1204 if (ret < 0) 1208 if (ret < 0)
@@ -1242,9 +1246,11 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void
1242 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { 1246 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
1243#ifdef OSS_DEBUG 1247#ifdef OSS_DEBUG
1244 if (runtime->status->state == SNDRV_PCM_STATE_XRUN) 1248 if (runtime->status->state == SNDRV_PCM_STATE_XRUN)
1245 printk("pcm_oss: writev: recovering from XRUN\n"); 1249 printk(KERN_DEBUG "pcm_oss: writev: "
1250 "recovering from XRUN\n");
1246 else 1251 else
1247 printk("pcm_oss: writev: recovering from SUSPEND\n"); 1252 printk(KERN_DEBUG "pcm_oss: writev: "
1253 "recovering from SUSPEND\n");
1248#endif 1254#endif
1249 ret = snd_pcm_oss_prepare(substream); 1255 ret = snd_pcm_oss_prepare(substream);
1250 if (ret < 0) 1256 if (ret < 0)
@@ -1278,9 +1284,11 @@ snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void *
1278 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { 1284 runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
1279#ifdef OSS_DEBUG 1285#ifdef OSS_DEBUG
1280 if (runtime->status->state == SNDRV_PCM_STATE_XRUN) 1286 if (runtime->status->state == SNDRV_PCM_STATE_XRUN)
1281 printk("pcm_oss: readv: recovering from XRUN\n"); 1287 printk(KERN_DEBUG "pcm_oss: readv: "
1288 "recovering from XRUN\n");
1282 else 1289 else
1283 printk("pcm_oss: readv: recovering from SUSPEND\n"); 1290 printk(KERN_DEBUG "pcm_oss: readv: "
1291 "recovering from SUSPEND\n");
1284#endif 1292#endif
1285 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL); 1293 ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
1286 if (ret < 0) 1294 if (ret < 0)
@@ -1533,7 +1541,7 @@ static int snd_pcm_oss_sync1(struct snd_pcm_substream *substream, size_t size)
1533 init_waitqueue_entry(&wait, current); 1541 init_waitqueue_entry(&wait, current);
1534 add_wait_queue(&runtime->sleep, &wait); 1542 add_wait_queue(&runtime->sleep, &wait);
1535#ifdef OSS_DEBUG 1543#ifdef OSS_DEBUG
1536 printk("sync1: size = %li\n", size); 1544 printk(KERN_DEBUG "sync1: size = %li\n", size);
1537#endif 1545#endif
1538 while (1) { 1546 while (1) {
1539 result = snd_pcm_oss_write2(substream, runtime->oss.buffer, size, 1); 1547 result = snd_pcm_oss_write2(substream, runtime->oss.buffer, size, 1);
@@ -1590,7 +1598,7 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file)
1590 mutex_lock(&runtime->oss.params_lock); 1598 mutex_lock(&runtime->oss.params_lock);
1591 if (runtime->oss.buffer_used > 0) { 1599 if (runtime->oss.buffer_used > 0) {
1592#ifdef OSS_DEBUG 1600#ifdef OSS_DEBUG
1593 printk("sync: buffer_used\n"); 1601 printk(KERN_DEBUG "sync: buffer_used\n");
1594#endif 1602#endif
1595 size = (8 * (runtime->oss.period_bytes - runtime->oss.buffer_used) + 7) / width; 1603 size = (8 * (runtime->oss.period_bytes - runtime->oss.buffer_used) + 7) / width;
1596 snd_pcm_format_set_silence(format, 1604 snd_pcm_format_set_silence(format,
@@ -1603,7 +1611,7 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file)
1603 } 1611 }
1604 } else if (runtime->oss.period_ptr > 0) { 1612 } else if (runtime->oss.period_ptr > 0) {
1605#ifdef OSS_DEBUG 1613#ifdef OSS_DEBUG
1606 printk("sync: period_ptr\n"); 1614 printk(KERN_DEBUG "sync: period_ptr\n");
1607#endif 1615#endif
1608 size = runtime->oss.period_bytes - runtime->oss.period_ptr; 1616 size = runtime->oss.period_bytes - runtime->oss.period_ptr;
1609 snd_pcm_format_set_silence(format, 1617 snd_pcm_format_set_silence(format,
@@ -1952,7 +1960,7 @@ static int snd_pcm_oss_set_trigger(struct snd_pcm_oss_file *pcm_oss_file, int tr
1952 int err, cmd; 1960 int err, cmd;
1953 1961
1954#ifdef OSS_DEBUG 1962#ifdef OSS_DEBUG
1955 printk("pcm_oss: trigger = 0x%x\n", trigger); 1963 printk(KERN_DEBUG "pcm_oss: trigger = 0x%x\n", trigger);
1956#endif 1964#endif
1957 1965
1958 psubstream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; 1966 psubstream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
@@ -2170,7 +2178,9 @@ static int snd_pcm_oss_get_space(struct snd_pcm_oss_file *pcm_oss_file, int stre
2170 } 2178 }
2171 2179
2172#ifdef OSS_DEBUG 2180#ifdef OSS_DEBUG
2173 printk("pcm_oss: space: bytes = %i, fragments = %i, fragstotal = %i, fragsize = %i\n", info.bytes, info.fragments, info.fragstotal, info.fragsize); 2181 printk(KERN_DEBUG "pcm_oss: space: bytes = %i, fragments = %i, "
2182 "fragstotal = %i, fragsize = %i\n",
2183 info.bytes, info.fragments, info.fragstotal, info.fragsize);
2174#endif 2184#endif
2175 if (copy_to_user(_info, &info, sizeof(info))) 2185 if (copy_to_user(_info, &info, sizeof(info)))
2176 return -EFAULT; 2186 return -EFAULT;
@@ -2473,7 +2483,7 @@ static long snd_pcm_oss_ioctl(struct file *file, unsigned int cmd, unsigned long
2473 if (((cmd >> 8) & 0xff) != 'P') 2483 if (((cmd >> 8) & 0xff) != 'P')
2474 return -EINVAL; 2484 return -EINVAL;
2475#ifdef OSS_DEBUG 2485#ifdef OSS_DEBUG
2476 printk("pcm_oss: ioctl = 0x%x\n", cmd); 2486 printk(KERN_DEBUG "pcm_oss: ioctl = 0x%x\n", cmd);
2477#endif 2487#endif
2478 switch (cmd) { 2488 switch (cmd) {
2479 case SNDCTL_DSP_RESET: 2489 case SNDCTL_DSP_RESET:
@@ -2627,7 +2637,8 @@ static ssize_t snd_pcm_oss_read(struct file *file, char __user *buf, size_t coun
2627#else 2637#else
2628 { 2638 {
2629 ssize_t res = snd_pcm_oss_read1(substream, buf, count); 2639 ssize_t res = snd_pcm_oss_read1(substream, buf, count);
2630 printk("pcm_oss: read %li bytes (returned %li bytes)\n", (long)count, (long)res); 2640 printk(KERN_DEBUG "pcm_oss: read %li bytes "
2641 "(returned %li bytes)\n", (long)count, (long)res);
2631 return res; 2642 return res;
2632 } 2643 }
2633#endif 2644#endif
@@ -2646,7 +2657,8 @@ static ssize_t snd_pcm_oss_write(struct file *file, const char __user *buf, size
2646 substream->f_flags = file->f_flags & O_NONBLOCK; 2657 substream->f_flags = file->f_flags & O_NONBLOCK;
2647 result = snd_pcm_oss_write1(substream, buf, count); 2658 result = snd_pcm_oss_write1(substream, buf, count);
2648#ifdef OSS_DEBUG 2659#ifdef OSS_DEBUG
2649 printk("pcm_oss: write %li bytes (wrote %li bytes)\n", (long)count, (long)result); 2660 printk(KERN_DEBUG "pcm_oss: write %li bytes (wrote %li bytes)\n",
2661 (long)count, (long)result);
2650#endif 2662#endif
2651 return result; 2663 return result;
2652} 2664}
@@ -2720,7 +2732,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
2720 int err; 2732 int err;
2721 2733
2722#ifdef OSS_DEBUG 2734#ifdef OSS_DEBUG
2723 printk("pcm_oss: mmap begin\n"); 2735 printk(KERN_DEBUG "pcm_oss: mmap begin\n");
2724#endif 2736#endif
2725 pcm_oss_file = file->private_data; 2737 pcm_oss_file = file->private_data;
2726 switch ((area->vm_flags & (VM_READ | VM_WRITE))) { 2738 switch ((area->vm_flags & (VM_READ | VM_WRITE))) {
@@ -2770,7 +2782,8 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
2770 runtime->silence_threshold = 0; 2782 runtime->silence_threshold = 0;
2771 runtime->silence_size = 0; 2783 runtime->silence_size = 0;
2772#ifdef OSS_DEBUG 2784#ifdef OSS_DEBUG
2773 printk("pcm_oss: mmap ok, bytes = 0x%x\n", runtime->oss.mmap_bytes); 2785 printk(KERN_DEBUG "pcm_oss: mmap ok, bytes = 0x%x\n",
2786 runtime->oss.mmap_bytes);
2774#endif 2787#endif
2775 /* In mmap mode we never stop */ 2788 /* In mmap mode we never stop */
2776 runtime->stop_threshold = runtime->boundary; 2789 runtime->stop_threshold = runtime->boundary;
diff --git a/sound/core/oss/pcm_plugin.h b/sound/core/oss/pcm_plugin.h
index ca2f4c39be46..b9afab603711 100644
--- a/sound/core/oss/pcm_plugin.h
+++ b/sound/core/oss/pcm_plugin.h
@@ -176,9 +176,9 @@ static inline int snd_pcm_plug_slave_format(int format, struct snd_mask *format_
176#endif 176#endif
177 177
178#ifdef PLUGIN_DEBUG 178#ifdef PLUGIN_DEBUG
179#define pdprintf( fmt, args... ) printk( "plugin: " fmt, ##args) 179#define pdprintf(fmt, args...) printk(KERN_DEBUG "plugin: " fmt, ##args)
180#else 180#else
181#define pdprintf( fmt, args... ) 181#define pdprintf(fmt, args...)
182#endif 182#endif
183 183
184#endif /* __PCM_PLUGIN_H */ 184#endif /* __PCM_PLUGIN_H */
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 192a433a2403..583453e2355c 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -692,7 +692,7 @@ EXPORT_SYMBOL(snd_pcm_new_stream);
692 * 692 *
693 * Returns zero if successful, or a negative error code on failure. 693 * Returns zero if successful, or a negative error code on failure.
694 */ 694 */
695int snd_pcm_new(struct snd_card *card, char *id, int device, 695int snd_pcm_new(struct snd_card *card, const char *id, int device,
696 int playback_count, int capture_count, 696 int playback_count, int capture_count,
697 struct snd_pcm ** rpcm) 697 struct snd_pcm ** rpcm)
698{ 698{
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index a789efc9df39..d9b8f5379428 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -186,7 +186,7 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
186 if (!(params->rmask & (1 << k))) 186 if (!(params->rmask & (1 << k)))
187 continue; 187 continue;
188#ifdef RULES_DEBUG 188#ifdef RULES_DEBUG
189 printk("%s = ", snd_pcm_hw_param_names[k]); 189 printk(KERN_DEBUG "%s = ", snd_pcm_hw_param_names[k]);
190 printk("%04x%04x%04x%04x -> ", m->bits[3], m->bits[2], m->bits[1], m->bits[0]); 190 printk("%04x%04x%04x%04x -> ", m->bits[3], m->bits[2], m->bits[1], m->bits[0]);
191#endif 191#endif
192 changed = snd_mask_refine(m, constrs_mask(constrs, k)); 192 changed = snd_mask_refine(m, constrs_mask(constrs, k));
@@ -206,7 +206,7 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
206 if (!(params->rmask & (1 << k))) 206 if (!(params->rmask & (1 << k)))
207 continue; 207 continue;
208#ifdef RULES_DEBUG 208#ifdef RULES_DEBUG
209 printk("%s = ", snd_pcm_hw_param_names[k]); 209 printk(KERN_DEBUG "%s = ", snd_pcm_hw_param_names[k]);
210 if (i->empty) 210 if (i->empty)
211 printk("empty"); 211 printk("empty");
212 else 212 else
@@ -251,7 +251,7 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
251 if (!doit) 251 if (!doit)
252 continue; 252 continue;
253#ifdef RULES_DEBUG 253#ifdef RULES_DEBUG
254 printk("Rule %d [%p]: ", k, r->func); 254 printk(KERN_DEBUG "Rule %d [%p]: ", k, r->func);
255 if (r->var >= 0) { 255 if (r->var >= 0) {
256 printk("%s = ", snd_pcm_hw_param_names[r->var]); 256 printk("%s = ", snd_pcm_hw_param_names[r->var]);
257 if (hw_is_mask(r->var)) { 257 if (hw_is_mask(r->var)) {
diff --git a/sound/core/seq/oss/seq_oss_device.h b/sound/core/seq/oss/seq_oss_device.h
index bf8d2b4cb15e..c0154a959d55 100644
--- a/sound/core/seq/oss/seq_oss_device.h
+++ b/sound/core/seq/oss/seq_oss_device.h
@@ -181,7 +181,7 @@ char *enabled_str(int bool);
181/* for debug */ 181/* for debug */
182#ifdef SNDRV_SEQ_OSS_DEBUG 182#ifdef SNDRV_SEQ_OSS_DEBUG
183extern int seq_oss_debug; 183extern int seq_oss_debug;
184#define debug_printk(x) do { if (seq_oss_debug > 0) snd_printk x; } while (0) 184#define debug_printk(x) do { if (seq_oss_debug > 0) snd_printd x; } while (0)
185#else 185#else
186#define debug_printk(x) /**/ 186#define debug_printk(x) /**/
187#endif 187#endif
diff --git a/sound/core/seq/seq_prioq.c b/sound/core/seq/seq_prioq.c
index 0101a8b99b73..29896ab23403 100644
--- a/sound/core/seq/seq_prioq.c
+++ b/sound/core/seq/seq_prioq.c
@@ -321,7 +321,8 @@ void snd_seq_prioq_leave(struct snd_seq_prioq * f, int client, int timestamp)
321 freeprev = cell; 321 freeprev = cell;
322 } else { 322 } else {
323#if 0 323#if 0
324 printk("type = %i, source = %i, dest = %i, client = %i\n", 324 printk(KERN_DEBUG "type = %i, source = %i, dest = %i, "
325 "client = %i\n",
325 cell->event.type, 326 cell->event.type,
326 cell->event.source.client, 327 cell->event.source.client,
327 cell->event.dest.client, 328 cell->event.dest.client,
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index c3e9833dcfd9..355da33cbd22 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -303,8 +303,10 @@ static void snd_mtpav_output_port_write(struct mtpav *mtp_card,
303 303
304 snd_mtpav_send_byte(mtp_card, 0xf5); 304 snd_mtpav_send_byte(mtp_card, 0xf5);
305 snd_mtpav_send_byte(mtp_card, portp->hwport); 305 snd_mtpav_send_byte(mtp_card, portp->hwport);
306 //snd_printk("new outport: 0x%x\n", (unsigned int) portp->hwport); 306 /*
307 307 snd_printk(KERN_DEBUG "new outport: 0x%x\n",
308 (unsigned int) portp->hwport);
309 */
308 if (!(outbyte & 0x80) && portp->running_status) 310 if (!(outbyte & 0x80) && portp->running_status)
309 snd_mtpav_send_byte(mtp_card, portp->running_status); 311 snd_mtpav_send_byte(mtp_card, portp->running_status);
310 } 312 }
@@ -540,7 +542,7 @@ static void snd_mtpav_read_bytes(struct mtpav *mcrd)
540 542
541 u8 sbyt = snd_mtpav_getreg(mcrd, SREG); 543 u8 sbyt = snd_mtpav_getreg(mcrd, SREG);
542 544
543 //printk("snd_mtpav_read_bytes() sbyt: 0x%x\n", sbyt); 545 /* printk(KERN_DEBUG "snd_mtpav_read_bytes() sbyt: 0x%x\n", sbyt); */
544 546
545 if (!(sbyt & SIGS_BYTE)) 547 if (!(sbyt & SIGS_BYTE))
546 return; 548 return;
@@ -585,12 +587,12 @@ static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id)
585static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard) 587static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard)
586{ 588{
587 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { 589 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
588 snd_printk("MTVAP port 0x%lx is busy\n", port); 590 snd_printk(KERN_ERR "MTVAP port 0x%lx is busy\n", port);
589 return -EBUSY; 591 return -EBUSY;
590 } 592 }
591 mcard->port = port; 593 mcard->port = port;
592 if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) { 594 if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) {
593 snd_printk("MTVAP IRQ %d busy\n", irq); 595 snd_printk(KERN_ERR "MTVAP IRQ %d busy\n", irq);
594 return -EBUSY; 596 return -EBUSY;
595 } 597 }
596 mcard->irq = irq; 598 mcard->irq = irq;
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
index 33d9db782e07..9284829bf927 100644
--- a/sound/drivers/mts64.c
+++ b/sound/drivers/mts64.c
@@ -1015,7 +1015,7 @@ static int __devinit snd_mts64_probe(struct platform_device *pdev)
1015 goto __err; 1015 goto __err;
1016 } 1016 }
1017 1017
1018 snd_printk("ESI Miditerminal 4140 on 0x%lx\n", p->base); 1018 snd_printk(KERN_INFO "ESI Miditerminal 4140 on 0x%lx\n", p->base);
1019 return 0; 1019 return 0;
1020 1020
1021__err: 1021__err:
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index 780582340fef..6e31e46ca393 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -302,7 +302,7 @@ void snd_opl3_interrupt(struct snd_hwdep * hw)
302 opl3 = hw->private_data; 302 opl3 = hw->private_data;
303 status = inb(opl3->l_port); 303 status = inb(opl3->l_port);
304#if 0 304#if 0
305 snd_printk("AdLib IRQ status = 0x%x\n", status); 305 snd_printk(KERN_DEBUG "AdLib IRQ status = 0x%x\n", status);
306#endif 306#endif
307 if (!(status & 0x80)) 307 if (!(status & 0x80))
308 return; 308 return;
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
index 16feafa2c51e..6e7d09ae0e82 100644
--- a/sound/drivers/opl3/opl3_midi.c
+++ b/sound/drivers/opl3/opl3_midi.c
@@ -125,7 +125,7 @@ static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {
125 int i; 125 int i;
126 char *str = "x.24"; 126 char *str = "x.24";
127 127
128 printk("time %.5i: %s [%.2i]: ", opl3->use_time, s, voice); 128 printk(KERN_DEBUG "time %.5i: %s [%.2i]: ", opl3->use_time, s, voice);
129 for (i = 0; i < opl3->max_voices; i++) 129 for (i = 0; i < opl3->max_voices; i++)
130 printk("%c", *(str + opl3->voices[i].state + 1)); 130 printk("%c", *(str + opl3->voices[i].state + 1));
131 printk("\n"); 131 printk("\n");
@@ -218,7 +218,7 @@ static int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op,
218 for (i = 0; i < END; i++) { 218 for (i = 0; i < END; i++) {
219 if (best[i].voice >= 0) { 219 if (best[i].voice >= 0) {
220#ifdef DEBUG_ALLOC 220#ifdef DEBUG_ALLOC
221 printk("%s %iop allocation on voice %i\n", 221 printk(KERN_DEBUG "%s %iop allocation on voice %i\n",
222 alloc_type[i], instr_4op ? 4 : 2, 222 alloc_type[i], instr_4op ? 4 : 2,
223 best[i].voice); 223 best[i].voice);
224#endif 224#endif
@@ -317,7 +317,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
317 opl3 = p; 317 opl3 = p;
318 318
319#ifdef DEBUG_MIDI 319#ifdef DEBUG_MIDI
320 snd_printk("Note on, ch %i, inst %i, note %i, vel %i\n", 320 snd_printk(KERN_DEBUG "Note on, ch %i, inst %i, note %i, vel %i\n",
321 chan->number, chan->midi_program, note, vel); 321 chan->number, chan->midi_program, note, vel);
322#endif 322#endif
323 323
@@ -372,7 +372,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
372 return; 372 return;
373 } 373 }
374#ifdef DEBUG_MIDI 374#ifdef DEBUG_MIDI
375 snd_printk(" --> OPL%i instrument: %s\n", 375 snd_printk(KERN_DEBUG " --> OPL%i instrument: %s\n",
376 instr_4op ? 3 : 2, patch->name); 376 instr_4op ? 3 : 2, patch->name);
377#endif 377#endif
378 /* in SYNTH mode, application takes care of voices */ 378 /* in SYNTH mode, application takes care of voices */
@@ -431,7 +431,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
431 } 431 }
432 432
433#ifdef DEBUG_MIDI 433#ifdef DEBUG_MIDI
434 snd_printk(" --> setting OPL3 connection: 0x%x\n", 434 snd_printk(KERN_DEBUG " --> setting OPL3 connection: 0x%x\n",
435 opl3->connection_reg); 435 opl3->connection_reg);
436#endif 436#endif
437 /* 437 /*
@@ -466,7 +466,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
466 /* Program the FM voice characteristics */ 466 /* Program the FM voice characteristics */
467 for (i = 0; i < (instr_4op ? 4 : 2); i++) { 467 for (i = 0; i < (instr_4op ? 4 : 2); i++) {
468#ifdef DEBUG_MIDI 468#ifdef DEBUG_MIDI
469 snd_printk(" --> programming operator %i\n", i); 469 snd_printk(KERN_DEBUG " --> programming operator %i\n", i);
470#endif 470#endif
471 op_offset = snd_opl3_regmap[voice_offset][i]; 471 op_offset = snd_opl3_regmap[voice_offset][i];
472 472
@@ -546,7 +546,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
546 blocknum |= OPL3_KEYON_BIT; 546 blocknum |= OPL3_KEYON_BIT;
547 547
548#ifdef DEBUG_MIDI 548#ifdef DEBUG_MIDI
549 snd_printk(" --> trigger voice %i\n", voice); 549 snd_printk(KERN_DEBUG " --> trigger voice %i\n", voice);
550#endif 550#endif
551 /* Set OPL3 KEYON_BLOCK register of requested voice */ 551 /* Set OPL3 KEYON_BLOCK register of requested voice */
552 opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset); 552 opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);
@@ -602,7 +602,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
602 prg = extra_prg - 1; 602 prg = extra_prg - 1;
603 } 603 }
604#ifdef DEBUG_MIDI 604#ifdef DEBUG_MIDI
605 snd_printk(" *** allocating extra program\n"); 605 snd_printk(KERN_DEBUG " *** allocating extra program\n");
606#endif 606#endif
607 goto __extra_prg; 607 goto __extra_prg;
608 } 608 }
@@ -633,7 +633,7 @@ static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
633 633
634 /* kill voice */ 634 /* kill voice */
635#ifdef DEBUG_MIDI 635#ifdef DEBUG_MIDI
636 snd_printk(" --> kill voice %i\n", voice); 636 snd_printk(KERN_DEBUG " --> kill voice %i\n", voice);
637#endif 637#endif
638 opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset); 638 opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);
639 /* clear Key ON bit */ 639 /* clear Key ON bit */
@@ -670,7 +670,7 @@ void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan
670 opl3 = p; 670 opl3 = p;
671 671
672#ifdef DEBUG_MIDI 672#ifdef DEBUG_MIDI
673 snd_printk("Note off, ch %i, inst %i, note %i\n", 673 snd_printk(KERN_DEBUG "Note off, ch %i, inst %i, note %i\n",
674 chan->number, chan->midi_program, note); 674 chan->number, chan->midi_program, note);
675#endif 675#endif
676 676
@@ -709,7 +709,7 @@ void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *cha
709 709
710 opl3 = p; 710 opl3 = p;
711#ifdef DEBUG_MIDI 711#ifdef DEBUG_MIDI
712 snd_printk("Key pressure, ch#: %i, inst#: %i\n", 712 snd_printk(KERN_DEBUG "Key pressure, ch#: %i, inst#: %i\n",
713 chan->number, chan->midi_program); 713 chan->number, chan->midi_program);
714#endif 714#endif
715} 715}
@@ -723,7 +723,7 @@ void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan)
723 723
724 opl3 = p; 724 opl3 = p;
725#ifdef DEBUG_MIDI 725#ifdef DEBUG_MIDI
726 snd_printk("Terminate note, ch#: %i, inst#: %i\n", 726 snd_printk(KERN_DEBUG "Terminate note, ch#: %i, inst#: %i\n",
727 chan->number, chan->midi_program); 727 chan->number, chan->midi_program);
728#endif 728#endif
729} 729}
@@ -812,7 +812,7 @@ void snd_opl3_control(void *p, int type, struct snd_midi_channel *chan)
812 812
813 opl3 = p; 813 opl3 = p;
814#ifdef DEBUG_MIDI 814#ifdef DEBUG_MIDI
815 snd_printk("Controller, TYPE = %i, ch#: %i, inst#: %i\n", 815 snd_printk(KERN_DEBUG "Controller, TYPE = %i, ch#: %i, inst#: %i\n",
816 type, chan->number, chan->midi_program); 816 type, chan->number, chan->midi_program);
817#endif 817#endif
818 818
@@ -849,7 +849,7 @@ void snd_opl3_nrpn(void *p, struct snd_midi_channel *chan,
849 849
850 opl3 = p; 850 opl3 = p;
851#ifdef DEBUG_MIDI 851#ifdef DEBUG_MIDI
852 snd_printk("NRPN, ch#: %i, inst#: %i\n", 852 snd_printk(KERN_DEBUG "NRPN, ch#: %i, inst#: %i\n",
853 chan->number, chan->midi_program); 853 chan->number, chan->midi_program);
854#endif 854#endif
855} 855}
@@ -864,6 +864,6 @@ void snd_opl3_sysex(void *p, unsigned char *buf, int len,
864 864
865 opl3 = p; 865 opl3 = p;
866#ifdef DEBUG_MIDI 866#ifdef DEBUG_MIDI
867 snd_printk("SYSEX\n"); 867 snd_printk(KERN_DEBUG "SYSEX\n");
868#endif 868#endif
869} 869}
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c
index 9a2271dc046a..a54b1dc5cc78 100644
--- a/sound/drivers/opl3/opl3_oss.c
+++ b/sound/drivers/opl3/opl3_oss.c
@@ -220,14 +220,14 @@ static int snd_opl3_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
220 return -EINVAL; 220 return -EINVAL;
221 221
222 if (count < (int)sizeof(sbi)) { 222 if (count < (int)sizeof(sbi)) {
223 snd_printk("FM Error: Patch record too short\n"); 223 snd_printk(KERN_ERR "FM Error: Patch record too short\n");
224 return -EINVAL; 224 return -EINVAL;
225 } 225 }
226 if (copy_from_user(&sbi, buf, sizeof(sbi))) 226 if (copy_from_user(&sbi, buf, sizeof(sbi)))
227 return -EFAULT; 227 return -EFAULT;
228 228
229 if (sbi.channel < 0 || sbi.channel >= SBFM_MAXINSTR) { 229 if (sbi.channel < 0 || sbi.channel >= SBFM_MAXINSTR) {
230 snd_printk("FM Error: Invalid instrument number %d\n", 230 snd_printk(KERN_ERR "FM Error: Invalid instrument number %d\n",
231 sbi.channel); 231 sbi.channel);
232 return -EINVAL; 232 return -EINVAL;
233 } 233 }
@@ -254,7 +254,9 @@ static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
254 opl3 = arg->private_data; 254 opl3 = arg->private_data;
255 switch (cmd) { 255 switch (cmd) {
256 case SNDCTL_FM_LOAD_INSTR: 256 case SNDCTL_FM_LOAD_INSTR:
257 snd_printk("OPL3: Obsolete ioctl(SNDCTL_FM_LOAD_INSTR) used. Fix the program.\n"); 257 snd_printk(KERN_ERR "OPL3: "
258 "Obsolete ioctl(SNDCTL_FM_LOAD_INSTR) used. "
259 "Fix the program.\n");
258 return -EINVAL; 260 return -EINVAL;
259 261
260 case SNDCTL_SYNTH_MEMAVL: 262 case SNDCTL_SYNTH_MEMAVL:
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index 962bb9c8b9c8..6d57b6441dec 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -168,7 +168,7 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
168 168
169#ifdef CONFIG_SND_DEBUG 169#ifdef CONFIG_SND_DEBUG
170 default: 170 default:
171 snd_printk("unknown IOCTL: 0x%x\n", cmd); 171 snd_printk(KERN_WARNING "unknown IOCTL: 0x%x\n", cmd);
172#endif 172#endif
173 } 173 }
174 return -ENOTTY; 174 return -ENOTTY;
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c
index aa2ae07a76d5..b60cef257b58 100644
--- a/sound/drivers/pcsp/pcsp.c
+++ b/sound/drivers/pcsp/pcsp.c
@@ -57,7 +57,7 @@ static int __devinit snd_pcsp_create(struct snd_card *card)
57 else 57 else
58 min_div = MAX_DIV; 58 min_div = MAX_DIV;
59#if PCSP_DEBUG 59#if PCSP_DEBUG
60 printk("PCSP: lpj=%li, min_div=%i, res=%li\n", 60 printk(KERN_DEBUG "PCSP: lpj=%li, min_div=%i, res=%li\n",
61 loops_per_jiffy, min_div, tp.tv_nsec); 61 loops_per_jiffy, min_div, tp.tv_nsec);
62#endif 62#endif
63 63
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 891d081e4825..b2b6d50c9425 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -241,7 +241,8 @@ static void snd_uart16550_io_loop(struct snd_uart16550 * uart)
241 snd_rawmidi_receive(uart->midi_input[substream], &c, 1); 241 snd_rawmidi_receive(uart->midi_input[substream], &c, 1);
242 242
243 if (status & UART_LSR_OE) 243 if (status & UART_LSR_OE)
244 snd_printk("%s: Overrun on device at 0x%lx\n", 244 snd_printk(KERN_WARNING
245 "%s: Overrun on device at 0x%lx\n",
245 uart->rmidi->name, uart->base); 246 uart->rmidi->name, uart->base);
246 } 247 }
247 248
@@ -636,7 +637,8 @@ static int snd_uart16550_output_byte(struct snd_uart16550 *uart,
636 } 637 }
637 } else { 638 } else {
638 if (!snd_uart16550_write_buffer(uart, midi_byte)) { 639 if (!snd_uart16550_write_buffer(uart, midi_byte)) {
639 snd_printk("%s: Buffer overrun on device at 0x%lx\n", 640 snd_printk(KERN_WARNING
641 "%s: Buffer overrun on device at 0x%lx\n",
640 uart->rmidi->name, uart->base); 642 uart->rmidi->name, uart->base);
641 return 0; 643 return 0;
642 } 644 }
@@ -815,7 +817,8 @@ static int __devinit snd_uart16550_create(struct snd_card *card,
815 if (irq >= 0 && irq != SNDRV_AUTO_IRQ) { 817 if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
816 if (request_irq(irq, snd_uart16550_interrupt, 818 if (request_irq(irq, snd_uart16550_interrupt,
817 IRQF_DISABLED, "Serial MIDI", uart)) { 819 IRQF_DISABLED, "Serial MIDI", uart)) {
818 snd_printk("irq %d busy. Using Polling.\n", irq); 820 snd_printk(KERN_WARNING
821 "irq %d busy. Using Polling.\n", irq);
819 } else { 822 } else {
820 uart->irq = irq; 823 uart->irq = irq;
821 } 824 }
@@ -919,19 +922,22 @@ static int __devinit snd_serial_probe(struct platform_device *devptr)
919 case SNDRV_SERIAL_GENERIC: 922 case SNDRV_SERIAL_GENERIC:
920 break; 923 break;
921 default: 924 default:
922 snd_printk("Adaptor type is out of range 0-%d (%d)\n", 925 snd_printk(KERN_ERR
926 "Adaptor type is out of range 0-%d (%d)\n",
923 SNDRV_SERIAL_MAX_ADAPTOR, adaptor[dev]); 927 SNDRV_SERIAL_MAX_ADAPTOR, adaptor[dev]);
924 return -ENODEV; 928 return -ENODEV;
925 } 929 }
926 930
927 if (outs[dev] < 1 || outs[dev] > SNDRV_SERIAL_MAX_OUTS) { 931 if (outs[dev] < 1 || outs[dev] > SNDRV_SERIAL_MAX_OUTS) {
928 snd_printk("Count of outputs is out of range 1-%d (%d)\n", 932 snd_printk(KERN_ERR
933 "Count of outputs is out of range 1-%d (%d)\n",
929 SNDRV_SERIAL_MAX_OUTS, outs[dev]); 934 SNDRV_SERIAL_MAX_OUTS, outs[dev]);
930 return -ENODEV; 935 return -ENODEV;
931 } 936 }
932 937
933 if (ins[dev] < 1 || ins[dev] > SNDRV_SERIAL_MAX_INS) { 938 if (ins[dev] < 1 || ins[dev] > SNDRV_SERIAL_MAX_INS) {
934 snd_printk("Count of inputs is out of range 1-%d (%d)\n", 939 snd_printk(KERN_ERR
940 "Count of inputs is out of range 1-%d (%d)\n",
935 SNDRV_SERIAL_MAX_INS, ins[dev]); 941 SNDRV_SERIAL_MAX_INS, ins[dev]);
936 return -ENODEV; 942 return -ENODEV;
937 } 943 }
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index 6f48711818f3..0e631c3221e3 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -98,7 +98,9 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
98 vmidi->card = card; 98 vmidi->card = card;
99 99
100 if (midi_devs[dev] > MAX_MIDI_DEVICES) { 100 if (midi_devs[dev] > MAX_MIDI_DEVICES) {
101 snd_printk("too much midi devices for virmidi %d: force to use %d\n", dev, MAX_MIDI_DEVICES); 101 snd_printk(KERN_WARNING
102 "too much midi devices for virmidi %d: "
103 "force to use %d\n", dev, MAX_MIDI_DEVICES);
102 midi_devs[dev] = MAX_MIDI_DEVICES; 104 midi_devs[dev] = MAX_MIDI_DEVICES;
103 } 105 }
104 for (idx = 0; idx < midi_devs[dev]; idx++) { 106 for (idx = 0; idx < midi_devs[dev]; idx++) {
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c
index 14e3354be43a..19c6e376c7c7 100644
--- a/sound/drivers/vx/vx_core.c
+++ b/sound/drivers/vx/vx_core.c
@@ -688,7 +688,8 @@ int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp)
688 image = dsp->data + i; 688 image = dsp->data + i;
689 /* Wait DSP ready for a new read */ 689 /* Wait DSP ready for a new read */
690 if ((err = vx_wait_isr_bit(chip, ISR_TX_EMPTY)) < 0) { 690 if ((err = vx_wait_isr_bit(chip, ISR_TX_EMPTY)) < 0) {
691 printk("dsp loading error at position %d\n", i); 691 printk(KERN_ERR
692 "dsp loading error at position %d\n", i);
692 return err; 693 return err;
693 } 694 }
694 cptr = image; 695 cptr = image;
diff --git a/sound/mips/au1x00.c b/sound/mips/au1x00.c
index 99e1391b2eb4..3e763d6a5d67 100644
--- a/sound/mips/au1x00.c
+++ b/sound/mips/au1x00.c
@@ -679,7 +679,7 @@ au1000_init(void)
679 return err; 679 return err;
680 } 680 }
681 681
682 printk( KERN_INFO "ALSA AC97: Driver Initialized\n" ); 682 printk(KERN_INFO "ALSA AC97: Driver Initialized\n");
683 au1000_card = card; 683 au1000_card = card;
684 return 0; 684 return 0;
685} 685}
diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
index 4d45bd63718b..57d9f154c88b 100644
--- a/sound/oss/dmasound/dmasound_atari.c
+++ b/sound/oss/dmasound/dmasound_atari.c
@@ -851,8 +851,9 @@ static int __init AtaIrqInit(void)
851 mfp.tim_dt_a = 1; /* Cause interrupt after first event. */ 851 mfp.tim_dt_a = 1; /* Cause interrupt after first event. */
852 mfp.tim_ct_a = 8; /* Turn on event counting. */ 852 mfp.tim_ct_a = 8; /* Turn on event counting. */
853 /* Register interrupt handler. */ 853 /* Register interrupt handler. */
854 request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound", 854 if (request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound",
855 AtaInterrupt); 855 AtaInterrupt))
856 return 0;
856 mfp.int_en_a |= 0x20; /* Turn interrupt on. */ 857 mfp.int_en_a |= 0x20; /* Turn interrupt on. */
857 mfp.int_mk_a |= 0x20; 858 mfp.int_mk_a |= 0x20;
858 return 1; 859 return 1;
diff --git a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c
index 1855b14d90c3..99bcb21c2281 100644
--- a/sound/oss/dmasound/dmasound_q40.c
+++ b/sound/oss/dmasound/dmasound_q40.c
@@ -371,8 +371,9 @@ static void Q40Free(void *ptr, unsigned int size)
371static int __init Q40IrqInit(void) 371static int __init Q40IrqInit(void)
372{ 372{
373 /* Register interrupt handler. */ 373 /* Register interrupt handler. */
374 request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, 374 if (request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0,
375 "DMA sound", Q40Interrupt); 375 "DMA sound", Q40Interrupt))
376 return 0;
376 377
377 return(1); 378 return(1);
378} 379}
@@ -401,6 +402,7 @@ static void Q40PlayNextFrame(int index)
401 u_char *start; 402 u_char *start;
402 u_long size; 403 u_long size;
403 u_char speed; 404 u_char speed;
405 int error;
404 406
405 /* used by Q40Play() if all doubts whether there really is something 407 /* used by Q40Play() if all doubts whether there really is something
406 * to be played are already wiped out. 408 * to be played are already wiped out.
@@ -419,11 +421,13 @@ static void Q40PlayNextFrame(int index)
419 master_outb( 0,SAMPLE_ENABLE_REG); 421 master_outb( 0,SAMPLE_ENABLE_REG);
420 free_irq(Q40_IRQ_SAMPLE, Q40Interrupt); 422 free_irq(Q40_IRQ_SAMPLE, Q40Interrupt);
421 if (dmasound.soft.stereo) 423 if (dmasound.soft.stereo)
422 request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, 424 error = request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0,
423 "Q40 sound", Q40Interrupt); 425 "Q40 sound", Q40Interrupt);
424 else 426 else
425 request_irq(Q40_IRQ_SAMPLE, Q40MonoInterrupt, 0, 427 error = request_irq(Q40_IRQ_SAMPLE, Q40MonoInterrupt, 0,
426 "Q40 sound", Q40Interrupt); 428 "Q40 sound", Q40Interrupt);
429 if (error && printk_ratelimit())
430 pr_err("Couldn't register sound interrupt\n");
427 431
428 master_outb( speed, SAMPLE_RATE_REG); 432 master_outb( speed, SAMPLE_RATE_REG);
429 master_outb( 1,SAMPLE_CLEAR_REG); 433 master_outb( 1,SAMPLE_CLEAR_REG);
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index e2b843b4f9d0..bc707b603852 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1643,7 +1643,10 @@ static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 * ac97)
1643{ 1643{
1644 int err, idx; 1644 int err, idx;
1645 1645
1646 //printk("AC97_GPIO_CFG = %x\n",snd_ac97_read(ac97,AC97_GPIO_CFG)); 1646 /*
1647 printk(KERN_DEBUG "AC97_GPIO_CFG = %x\n",
1648 snd_ac97_read(ac97,AC97_GPIO_CFG));
1649 */
1647 snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH)); 1650 snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH));
1648 snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH)); 1651 snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH));
1649 snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff); 1652 snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff);
diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c
index 0f819ddb3ebf..fd135e3d8a84 100644
--- a/sound/pci/ak4531_codec.c
+++ b/sound/pci/ak4531_codec.c
@@ -51,7 +51,8 @@ static void snd_ak4531_dump(struct snd_ak4531 *ak4531)
51 int idx; 51 int idx;
52 52
53 for (idx = 0; idx < 0x19; idx++) 53 for (idx = 0; idx < 0x19; idx++)
54 printk("ak4531 0x%x: 0x%x\n", idx, ak4531->regs[idx]); 54 printk(KERN_DEBUG "ak4531 0x%x: 0x%x\n",
55 idx, ak4531->regs[idx]);
55} 56}
56 57
57#endif 58#endif
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index f557c155db48..009b4c8225a5 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -91,7 +91,7 @@
91#define DEBUG_PLAY_REC 0 91#define DEBUG_PLAY_REC 0
92 92
93#if DEBUG_CALLS 93#if DEBUG_CALLS
94#define snd_als300_dbgcalls(format, args...) printk(format, ##args) 94#define snd_als300_dbgcalls(format, args...) printk(KERN_DEBUG format, ##args)
95#define snd_als300_dbgcallenter() printk(KERN_ERR "--> %s\n", __func__) 95#define snd_als300_dbgcallenter() printk(KERN_ERR "--> %s\n", __func__)
96#define snd_als300_dbgcallleave() printk(KERN_ERR "<-- %s\n", __func__) 96#define snd_als300_dbgcallleave() printk(KERN_ERR "<-- %s\n", __func__)
97#else 97#else
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index 649849e540d3..f4aa8ff6f5f9 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -462,9 +462,10 @@ static void a3dsrc_ZeroSliceIO(a3dsrc_t * a)
462/* Reset Single A3D source. */ 462/* Reset Single A3D source. */
463static void a3dsrc_ZeroState(a3dsrc_t * a) 463static void a3dsrc_ZeroState(a3dsrc_t * a)
464{ 464{
465 465 /*
466 //printk("vortex: ZeroState slice: %d, source %d\n", a->slice, a->source); 466 printk(KERN_DEBUG "vortex: ZeroState slice: %d, source %d\n",
467 467 a->slice, a->source);
468 */
468 a3dsrc_SetAtmosState(a, 0, 0, 0, 0); 469 a3dsrc_SetAtmosState(a, 0, 0, 0, 0);
469 a3dsrc_SetHrtfState(a, A3dHrirZeros, A3dHrirZeros); 470 a3dsrc_SetHrtfState(a, A3dHrirZeros, A3dHrirZeros);
470 a3dsrc_SetItdDline(a, A3dItdDlineZeros); 471 a3dsrc_SetItdDline(a, A3dItdDlineZeros);
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index b070e5714514..e6a04d037c15 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -1135,7 +1135,10 @@ vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma,
1135 snd_pcm_sgbuf_get_addr(dma->substream, 0)); 1135 snd_pcm_sgbuf_get_addr(dma->substream, 0));
1136 break; 1136 break;
1137 } 1137 }
1138 //printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1); 1138 /*
1139 printk(KERN_DEBUG "vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n",
1140 dma->cfg0, dma->cfg1);
1141 */
1139 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0); 1142 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0);
1140 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1); 1143 hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1);
1141 1144
@@ -1959,7 +1962,7 @@ vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[])
1959 ADB_CODECOUT(0 + 4)); 1962 ADB_CODECOUT(0 + 4));
1960 vortex_connection_mix_adb(vortex, en, 0x11, mixers[3], 1963 vortex_connection_mix_adb(vortex, en, 0x11, mixers[3],
1961 ADB_CODECOUT(1 + 4)); 1964 ADB_CODECOUT(1 + 4));
1962 //printk("SDAC detected "); 1965 /* printk(KERN_DEBUG "SDAC detected "); */
1963 } 1966 }
1964#else 1967#else
1965 // Use plain direct output to codec. 1968 // Use plain direct output to codec.
@@ -2013,7 +2016,11 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
2013 resmap[restype] |= (1 << i); 2016 resmap[restype] |= (1 << i);
2014 else 2017 else
2015 vortex->dma_adb[i].resources[restype] |= (1 << i); 2018 vortex->dma_adb[i].resources[restype] |= (1 << i);
2016 //printk("vortex: ResManager: type %d out %d\n", restype, i); 2019 /*
2020 printk(KERN_DEBUG
2021 "vortex: ResManager: type %d out %d\n",
2022 restype, i);
2023 */
2017 return i; 2024 return i;
2018 } 2025 }
2019 } 2026 }
@@ -2024,7 +2031,11 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
2024 for (i = 0; i < qty; i++) { 2031 for (i = 0; i < qty; i++) {
2025 if (resmap[restype] & (1 << i)) { 2032 if (resmap[restype] & (1 << i)) {
2026 resmap[restype] &= ~(1 << i); 2033 resmap[restype] &= ~(1 << i);
2027 //printk("vortex: ResManager: type %d in %d\n",restype, i); 2034 /*
2035 printk(KERN_DEBUG
2036 "vortex: ResManager: type %d in %d\n",
2037 restype, i);
2038 */
2028 return i; 2039 return i;
2029 } 2040 }
2030 } 2041 }
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index 978b856f5621..2805e34bd41d 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -213,38 +213,59 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
213 switch (reg) { 213 switch (reg) {
214 /* Voice specific parameters */ 214 /* Voice specific parameters */
215 case 0: /* running */ 215 case 0: /* running */
216 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_RUN(wt), (int)val); 216 /*
217 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
218 WT_RUN(wt), (int)val);
219 */
217 hwwrite(vortex->mmio, WT_RUN(wt), val); 220 hwwrite(vortex->mmio, WT_RUN(wt), val);
218 return 0xc; 221 return 0xc;
219 break; 222 break;
220 case 1: /* param 0 */ 223 case 1: /* param 0 */
221 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,0), (int)val); 224 /*
225 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
226 WT_PARM(wt,0), (int)val);
227 */
222 hwwrite(vortex->mmio, WT_PARM(wt, 0), val); 228 hwwrite(vortex->mmio, WT_PARM(wt, 0), val);
223 return 0xc; 229 return 0xc;
224 break; 230 break;
225 case 2: /* param 1 */ 231 case 2: /* param 1 */
226 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,1), (int)val); 232 /*
233 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
234 WT_PARM(wt,1), (int)val);
235 */
227 hwwrite(vortex->mmio, WT_PARM(wt, 1), val); 236 hwwrite(vortex->mmio, WT_PARM(wt, 1), val);
228 return 0xc; 237 return 0xc;
229 break; 238 break;
230 case 3: /* param 2 */ 239 case 3: /* param 2 */
231 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,2), (int)val); 240 /*
241 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
242 WT_PARM(wt,2), (int)val);
243 */
232 hwwrite(vortex->mmio, WT_PARM(wt, 2), val); 244 hwwrite(vortex->mmio, WT_PARM(wt, 2), val);
233 return 0xc; 245 return 0xc;
234 break; 246 break;
235 case 4: /* param 3 */ 247 case 4: /* param 3 */
236 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,3), (int)val); 248 /*
249 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
250 WT_PARM(wt,3), (int)val);
251 */
237 hwwrite(vortex->mmio, WT_PARM(wt, 3), val); 252 hwwrite(vortex->mmio, WT_PARM(wt, 3), val);
238 return 0xc; 253 return 0xc;
239 break; 254 break;
240 case 6: /* mute */ 255 case 6: /* mute */
241 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_MUTE(wt), (int)val); 256 /*
257 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
258 WT_MUTE(wt), (int)val);
259 */
242 hwwrite(vortex->mmio, WT_MUTE(wt), val); 260 hwwrite(vortex->mmio, WT_MUTE(wt), val);
243 return 0xc; 261 return 0xc;
244 break; 262 break;
245 case 0xb: 263 case 0xb:
246 { /* delay */ 264 { /* delay */
247 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_DELAY(wt,0), (int)val); 265 /*
266 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n",
267 WT_DELAY(wt,0), (int)val);
268 */
248 hwwrite(vortex->mmio, WT_DELAY(wt, 3), val); 269 hwwrite(vortex->mmio, WT_DELAY(wt, 3), val);
249 hwwrite(vortex->mmio, WT_DELAY(wt, 2), val); 270 hwwrite(vortex->mmio, WT_DELAY(wt, 2), val);
250 hwwrite(vortex->mmio, WT_DELAY(wt, 1), val); 271 hwwrite(vortex->mmio, WT_DELAY(wt, 1), val);
@@ -272,7 +293,9 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
272 return 0; 293 return 0;
273 break; 294 break;
274 } 295 }
275 //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", ecx, (int)val); 296 /*
297 printk(KERN_DEBUG "vortex: WT SetReg(0x%x) = 0x%08x\n", ecx, (int)val);
298 */
276 hwwrite(vortex->mmio, ecx, val); 299 hwwrite(vortex->mmio, ecx, val);
277 return 1; 300 return 1;
278} 301}
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 1df96e76c483..e9e9b5821d41 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -211,25 +211,25 @@ MODULE_SUPPORTED_DEVICE("{{Aztech,AZF3328}}");
211#endif 211#endif
212 212
213#if DEBUG_MIXER 213#if DEBUG_MIXER
214#define snd_azf3328_dbgmixer(format, args...) printk(format, ##args) 214#define snd_azf3328_dbgmixer(format, args...) printk(KERN_DEBUG format, ##args)
215#else 215#else
216#define snd_azf3328_dbgmixer(format, args...) 216#define snd_azf3328_dbgmixer(format, args...)
217#endif 217#endif
218 218
219#if DEBUG_PLAY_REC 219#if DEBUG_PLAY_REC
220#define snd_azf3328_dbgplay(format, args...) printk(KERN_ERR format, ##args) 220#define snd_azf3328_dbgplay(format, args...) printk(KERN_DEBUG format, ##args)
221#else 221#else
222#define snd_azf3328_dbgplay(format, args...) 222#define snd_azf3328_dbgplay(format, args...)
223#endif 223#endif
224 224
225#if DEBUG_MISC 225#if DEBUG_MISC
226#define snd_azf3328_dbgtimer(format, args...) printk(KERN_ERR format, ##args) 226#define snd_azf3328_dbgtimer(format, args...) printk(KERN_DEBUG format, ##args)
227#else 227#else
228#define snd_azf3328_dbgtimer(format, args...) 228#define snd_azf3328_dbgtimer(format, args...)
229#endif 229#endif
230 230
231#if DEBUG_GAME 231#if DEBUG_GAME
232#define snd_azf3328_dbggame(format, args...) printk(KERN_ERR format, ##args) 232#define snd_azf3328_dbggame(format, args...) printk(KERN_DEBUG format, ##args)
233#else 233#else
234#define snd_azf3328_dbggame(format, args...) 234#define snd_azf3328_dbggame(format, args...)
235#endif 235#endif
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index b116456e7707..a38ff9dd07eb 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -404,7 +404,9 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
404 } 404 }
405 405
406 tmp = reg << 25 | value << 16; 406 tmp = reg << 25 | value << 16;
407 // snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value); 407 /*
408 snd_printk(KERN_DEBUG "I2C-write:reg=0x%x, value=0x%x\n", reg, value);
409 */
408 /* Not sure what this I2C channel controls. */ 410 /* Not sure what this I2C channel controls. */
409 /* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */ 411 /* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */
410 412
@@ -422,7 +424,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
422 /* Wait till the transaction ends */ 424 /* Wait till the transaction ends */
423 while (1) { 425 while (1) {
424 status = snd_ca0106_ptr_read(emu, I2C_A, 0); 426 status = snd_ca0106_ptr_read(emu, I2C_A, 0);
425 //snd_printk("I2C:status=0x%x\n", status); 427 /*snd_printk(KERN_DEBUG "I2C:status=0x%x\n", status);*/
426 timeout++; 428 timeout++;
427 if ((status & I2C_A_ADC_START) == 0) 429 if ((status & I2C_A_ADC_START) == 0)
428 break; 430 break;
@@ -521,7 +523,10 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
521 channel->number = channel_id; 523 channel->number = channel_id;
522 524
523 channel->use = 1; 525 channel->use = 1;
524 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 526 /*
527 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
528 channel_id, chip, channel);
529 */
525 //channel->interrupt = snd_ca0106_pcm_channel_interrupt; 530 //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
526 channel->epcm = epcm; 531 channel->epcm = epcm;
527 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 532 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
@@ -614,7 +619,10 @@ static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substre
614 channel->number = channel_id; 619 channel->number = channel_id;
615 620
616 channel->use = 1; 621 channel->use = 1;
617 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 622 /*
623 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
624 channel_id, chip, channel);
625 */
618 //channel->interrupt = snd_ca0106_pcm_channel_interrupt; 626 //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
619 channel->epcm = epcm; 627 channel->epcm = epcm;
620 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 628 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
@@ -705,9 +713,20 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
705 u32 reg71; 713 u32 reg71;
706 int i; 714 int i;
707 715
708 //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); 716#if 0 /* debug */
709 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 717 snd_printk(KERN_DEBUG
710 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); 718 "prepare:channel_number=%d, rate=%d, format=0x%x, "
719 "channels=%d, buffer_size=%ld, period_size=%ld, "
720 "periods=%u, frames_to_bytes=%d\n",
721 channel, runtime->rate, runtime->format,
722 runtime->channels, runtime->buffer_size,
723 runtime->period_size, runtime->periods,
724 frames_to_bytes(runtime, 1));
725 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n",
726 runtime->dma_addr, runtime->dma_area, table_base);
727 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
728 emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
729#endif /* debug */
711 /* Rate can be set per channel. */ 730 /* Rate can be set per channel. */
712 /* reg40 control host to fifo */ 731 /* reg40 control host to fifo */
713 /* reg71 controls DAC rate. */ 732 /* reg71 controls DAC rate. */
@@ -799,9 +818,20 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
799 u32 reg71_set = 0; 818 u32 reg71_set = 0;
800 u32 reg71; 819 u32 reg71;
801 820
802 //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); 821#if 0 /* debug */
803 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 822 snd_printk(KERN_DEBUG
804 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); 823 "prepare:channel_number=%d, rate=%d, format=0x%x, "
824 "channels=%d, buffer_size=%ld, period_size=%ld, "
825 "periods=%u, frames_to_bytes=%d\n",
826 channel, runtime->rate, runtime->format,
827 runtime->channels, runtime->buffer_size,
828 runtime->period_size, runtime->periods,
829 frames_to_bytes(runtime, 1));
830 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n",
831 runtime->dma_addr, runtime->dma_area, table_base);
832 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
833 emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
834#endif /* debug */
805 /* reg71 controls ADC rate. */ 835 /* reg71 controls ADC rate. */
806 switch (runtime->rate) { 836 switch (runtime->rate) {
807 case 44100: 837 case 44100:
@@ -846,7 +876,14 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
846 } 876 }
847 877
848 878
849 //printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); 879 /*
880 printk(KERN_DEBUG
881 "prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, "
882 "buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",
883 channel, runtime->rate, runtime->format, runtime->channels,
884 runtime->buffer_size, runtime->period_size,
885 frames_to_bytes(runtime, 1));
886 */
850 snd_ca0106_ptr_write(emu, 0x13, channel, 0); 887 snd_ca0106_ptr_write(emu, 0x13, channel, 0);
851 snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); 888 snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr);
852 snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes 889 snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
@@ -888,13 +925,13 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
888 runtime = s->runtime; 925 runtime = s->runtime;
889 epcm = runtime->private_data; 926 epcm = runtime->private_data;
890 channel = epcm->channel_id; 927 channel = epcm->channel_id;
891 /* snd_printk("channel=%d\n",channel); */ 928 /* snd_printk(KERN_DEBUG "channel=%d\n", channel); */
892 epcm->running = running; 929 epcm->running = running;
893 basic |= (0x1 << channel); 930 basic |= (0x1 << channel);
894 extended |= (0x10 << channel); 931 extended |= (0x10 << channel);
895 snd_pcm_trigger_done(s, substream); 932 snd_pcm_trigger_done(s, substream);
896 } 933 }
897 /* snd_printk("basic=0x%x, extended=0x%x\n",basic, extended); */ 934 /* snd_printk(KERN_DEBUG "basic=0x%x, extended=0x%x\n",basic, extended); */
898 935
899 switch (cmd) { 936 switch (cmd) {
900 case SNDRV_PCM_TRIGGER_START: 937 case SNDRV_PCM_TRIGGER_START:
@@ -972,8 +1009,13 @@ snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream)
972 ptr=ptr2; 1009 ptr=ptr2;
973 if (ptr >= runtime->buffer_size) 1010 if (ptr >= runtime->buffer_size)
974 ptr -= runtime->buffer_size; 1011 ptr -= runtime->buffer_size;
975 //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); 1012 /*
976 1013 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
1014 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
1015 ptr1, ptr2, ptr, (int)runtime->buffer_size,
1016 (int)runtime->period_size, (int)runtime->frame_bits,
1017 (int)runtime->rate);
1018 */
977 return ptr; 1019 return ptr;
978} 1020}
979 1021
@@ -995,8 +1037,13 @@ snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream)
995 ptr=ptr2; 1037 ptr=ptr2;
996 if (ptr >= runtime->buffer_size) 1038 if (ptr >= runtime->buffer_size)
997 ptr -= runtime->buffer_size; 1039 ptr -= runtime->buffer_size;
998 //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); 1040 /*
999 1041 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
1042 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
1043 ptr1, ptr2, ptr, (int)runtime->buffer_size,
1044 (int)runtime->period_size, (int)runtime->frame_bits,
1045 (int)runtime->rate);
1046 */
1000 return ptr; 1047 return ptr;
1001} 1048}
1002 1049
@@ -1181,8 +1228,12 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
1181 return IRQ_NONE; 1228 return IRQ_NONE;
1182 1229
1183 stat76 = snd_ca0106_ptr_read(chip, EXTENDED_INT, 0); 1230 stat76 = snd_ca0106_ptr_read(chip, EXTENDED_INT, 0);
1184 //snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76); 1231 /*
1185 //snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0)); 1232 snd_printk(KERN_DEBUG "interrupt status = 0x%08x, stat76=0x%08x\n",
1233 status, stat76);
1234 snd_printk(KERN_DEBUG "ptr=0x%08x\n",
1235 snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0));
1236 */
1186 mask = 0x11; /* 0x1 for one half, 0x10 for the other half period. */ 1237 mask = 0x11; /* 0x1 for one half, 0x10 for the other half period. */
1187 for(i = 0; i < 4; i++) { 1238 for(i = 0; i < 4; i++) {
1188 pchannel = &(chip->playback_channels[i]); 1239 pchannel = &(chip->playback_channels[i]);
@@ -1470,7 +1521,7 @@ static void ca0106_init_chip(struct snd_ca0106 *chip, int resume)
1470 int size, n; 1521 int size, n;
1471 1522
1472 size = ARRAY_SIZE(i2c_adc_init); 1523 size = ARRAY_SIZE(i2c_adc_init);
1473 /* snd_printk("I2C:array size=0x%x\n", size); */ 1524 /* snd_printk(KERN_DEBUG "I2C:array size=0x%x\n", size); */
1474 for (n = 0; n < size; n++) 1525 for (n = 0; n < size; n++)
1475 snd_ca0106_i2c_write(chip, i2c_adc_init[n][0], 1526 snd_ca0106_i2c_write(chip, i2c_adc_init[n][0],
1476 i2c_adc_init[n][1]); 1527 i2c_adc_init[n][1]);
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index b9b07f464631..f6286f84a221 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -834,7 +834,11 @@ static snd_pcm_uframes_t snd_cs4281_pointer(struct snd_pcm_substream *substream)
834 struct cs4281_dma *dma = runtime->private_data; 834 struct cs4281_dma *dma = runtime->private_data;
835 struct cs4281 *chip = snd_pcm_substream_chip(substream); 835 struct cs4281 *chip = snd_pcm_substream_chip(substream);
836 836
837 // printk("DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n", snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, jiffies); 837 /*
838 printk(KERN_DEBUG "DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n",
839 snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size,
840 jiffies);
841 */
838 return runtime->buffer_size - 842 return runtime->buffer_size -
839 snd_cs4281_peekBA0(chip, dma->regDCC) - 1; 843 snd_cs4281_peekBA0(chip, dma->regDCC) - 1;
840} 844}
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 8ab07aa63652..1be96ead4244 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -194,7 +194,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
194 * ACSDA = Status Data Register = 474h 194 * ACSDA = Status Data Register = 474h
195 */ 195 */
196#if 0 196#if 0
197 printk("e) reg = 0x%x, val = 0x%x, BA0_ACCAD = 0x%x\n", reg, 197 printk(KERN_DEBUG "e) reg = 0x%x, val = 0x%x, BA0_ACCAD = 0x%x\n", reg,
198 snd_cs46xx_peekBA0(chip, BA0_ACSDA), 198 snd_cs46xx_peekBA0(chip, BA0_ACSDA),
199 snd_cs46xx_peekBA0(chip, BA0_ACCAD)); 199 snd_cs46xx_peekBA0(chip, BA0_ACCAD));
200#endif 200#endif
@@ -428,8 +428,8 @@ static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout)
428 } 428 }
429 429
430 if(status & SERBST_WBSY) { 430 if(status & SERBST_WBSY) {
431 snd_printk( KERN_ERR "cs46xx: failure waiting for FIFO command to complete\n"); 431 snd_printk(KERN_ERR "cs46xx: failure waiting for "
432 432 "FIFO command to complete\n");
433 return -EINVAL; 433 return -EINVAL;
434 } 434 }
435 435
diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h
index 018a7de56017..4eb55aa33612 100644
--- a/sound/pci/cs46xx/cs46xx_lib.h
+++ b/sound/pci/cs46xx/cs46xx_lib.h
@@ -62,7 +62,11 @@ static inline void snd_cs46xx_poke(struct snd_cs46xx *chip, unsigned long reg, u
62 unsigned int bank = reg >> 16; 62 unsigned int bank = reg >> 16;
63 unsigned int offset = reg & 0xffff; 63 unsigned int offset = reg & 0xffff;
64 64
65 /*if (bank == 0) printk("snd_cs46xx_poke: %04X - %08X\n",reg >> 2,val); */ 65 /*
66 if (bank == 0)
67 printk(KERN_DEBUG "snd_cs46xx_poke: %04X - %08X\n",
68 reg >> 2,val);
69 */
66 writel(val, chip->region.idx[bank+1].remap_addr + offset); 70 writel(val, chip->region.idx[bank+1].remap_addr + offset);
67} 71}
68 72
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index ac1d72e0a1e4..c89ed1f5bc2b 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -312,7 +312,7 @@ static int __devinit snd_cs5535audio_create(struct snd_card *card,
312 312
313 if (request_irq(pci->irq, snd_cs5535audio_interrupt, 313 if (request_irq(pci->irq, snd_cs5535audio_interrupt,
314 IRQF_SHARED, "CS5535 Audio", cs5535au)) { 314 IRQF_SHARED, "CS5535 Audio", cs5535au)) {
315 snd_printk("unable to grab IRQ %d\n", pci->irq); 315 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
316 err = -EBUSY; 316 err = -EBUSY;
317 goto sndfail; 317 goto sndfail;
318 } 318 }
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index e00614cbceff..18f4d1e98c46 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -584,7 +584,8 @@ static void snd_es1370_codec_write(struct snd_ak4531 *ak4531,
584 unsigned long end_time = jiffies + HZ / 10; 584 unsigned long end_time = jiffies + HZ / 10;
585 585
586#if 0 586#if 0
587 printk("CODEC WRITE: reg = 0x%x, val = 0x%x (0x%x), creg = 0x%x\n", 587 printk(KERN_DEBUG
588 "CODEC WRITE: reg = 0x%x, val = 0x%x (0x%x), creg = 0x%x\n",
588 reg, val, ES_1370_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1370_CODEC)); 589 reg, val, ES_1370_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1370_CODEC));
589#endif 590#endif
590 do { 591 do {
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 34a78afc26d0..dd63b132fb8e 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1673,18 +1673,22 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
1673 1673
1674 status = inb(SLIO_REG(chip, IRQCONTROL)); 1674 status = inb(SLIO_REG(chip, IRQCONTROL));
1675#if 0 1675#if 0
1676 printk("Es1938debug - interrupt status: =0x%x\n", status); 1676 printk(KERN_DEBUG "Es1938debug - interrupt status: =0x%x\n", status);
1677#endif 1677#endif
1678 1678
1679 /* AUDIO 1 */ 1679 /* AUDIO 1 */
1680 if (status & 0x10) { 1680 if (status & 0x10) {
1681#if 0 1681#if 0
1682 printk("Es1938debug - AUDIO channel 1 interrupt\n"); 1682 printk(KERN_DEBUG
1683 printk("Es1938debug - AUDIO channel 1 DMAC DMA count: %u\n", 1683 "Es1938debug - AUDIO channel 1 interrupt\n");
1684 printk(KERN_DEBUG
1685 "Es1938debug - AUDIO channel 1 DMAC DMA count: %u\n",
1684 inw(SLDM_REG(chip, DMACOUNT))); 1686 inw(SLDM_REG(chip, DMACOUNT)));
1685 printk("Es1938debug - AUDIO channel 1 DMAC DMA base: %u\n", 1687 printk(KERN_DEBUG
1688 "Es1938debug - AUDIO channel 1 DMAC DMA base: %u\n",
1686 inl(SLDM_REG(chip, DMAADDR))); 1689 inl(SLDM_REG(chip, DMAADDR)));
1687 printk("Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n", 1690 printk(KERN_DEBUG
1691 "Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n",
1688 inl(SLDM_REG(chip, DMASTATUS))); 1692 inl(SLDM_REG(chip, DMASTATUS)));
1689#endif 1693#endif
1690 /* clear irq */ 1694 /* clear irq */
@@ -1699,10 +1703,13 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
1699 /* AUDIO 2 */ 1703 /* AUDIO 2 */
1700 if (status & 0x20) { 1704 if (status & 0x20) {
1701#if 0 1705#if 0
1702 printk("Es1938debug - AUDIO channel 2 interrupt\n"); 1706 printk(KERN_DEBUG
1703 printk("Es1938debug - AUDIO channel 2 DMAC DMA count: %u\n", 1707 "Es1938debug - AUDIO channel 2 interrupt\n");
1708 printk(KERN_DEBUG
1709 "Es1938debug - AUDIO channel 2 DMAC DMA count: %u\n",
1704 inw(SLIO_REG(chip, AUDIO2DMACOUNT))); 1710 inw(SLIO_REG(chip, AUDIO2DMACOUNT)));
1705 printk("Es1938debug - AUDIO channel 2 DMAC DMA base: %u\n", 1711 printk(KERN_DEBUG
1712 "Es1938debug - AUDIO channel 2 DMAC DMA base: %u\n",
1706 inl(SLIO_REG(chip, AUDIO2DMAADDR))); 1713 inl(SLIO_REG(chip, AUDIO2DMAADDR)));
1707 1714
1708#endif 1715#endif
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index e00421c0d8ba..960fd7970384 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -135,7 +135,6 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
135 struct hda_beep *beep = codec->beep; 135 struct hda_beep *beep = codec->beep;
136 if (beep) { 136 if (beep) {
137 cancel_work_sync(&beep->beep_work); 137 cancel_work_sync(&beep->beep_work);
138 flush_scheduled_work();
139 138
140 input_unregister_device(beep->dev); 139 input_unregister_device(beep->dev);
141 kfree(beep); 140 kfree(beep);
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index e16cf63821ae..b7bba7dc7cf1 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -373,7 +373,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
373 unsol->queue[wp] = res; 373 unsol->queue[wp] = res;
374 unsol->queue[wp + 1] = res_ex; 374 unsol->queue[wp + 1] = res_ex;
375 375
376 schedule_work(&unsol->work); 376 queue_work(bus->workq, &unsol->work);
377 377
378 return 0; 378 return 0;
379} 379}
@@ -437,15 +437,17 @@ static int snd_hda_bus_free(struct hda_bus *bus)
437 437
438 if (!bus) 438 if (!bus)
439 return 0; 439 return 0;
440 if (bus->unsol) { 440 if (bus->workq)
441 flush_scheduled_work(); 441 flush_workqueue(bus->workq);
442 if (bus->unsol)
442 kfree(bus->unsol); 443 kfree(bus->unsol);
443 }
444 list_for_each_entry_safe(codec, n, &bus->codec_list, list) { 444 list_for_each_entry_safe(codec, n, &bus->codec_list, list) {
445 snd_hda_codec_free(codec); 445 snd_hda_codec_free(codec);
446 } 446 }
447 if (bus->ops.private_free) 447 if (bus->ops.private_free)
448 bus->ops.private_free(bus); 448 bus->ops.private_free(bus);
449 if (bus->workq)
450 destroy_workqueue(bus->workq);
449 kfree(bus); 451 kfree(bus);
450 return 0; 452 return 0;
451} 453}
@@ -485,6 +487,7 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
485{ 487{
486 struct hda_bus *bus; 488 struct hda_bus *bus;
487 int err; 489 int err;
490 char qname[8];
488 static struct snd_device_ops dev_ops = { 491 static struct snd_device_ops dev_ops = {
489 .dev_register = snd_hda_bus_dev_register, 492 .dev_register = snd_hda_bus_dev_register,
490 .dev_free = snd_hda_bus_dev_free, 493 .dev_free = snd_hda_bus_dev_free,
@@ -514,6 +517,14 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
514 mutex_init(&bus->cmd_mutex); 517 mutex_init(&bus->cmd_mutex);
515 INIT_LIST_HEAD(&bus->codec_list); 518 INIT_LIST_HEAD(&bus->codec_list);
516 519
520 snprintf(qname, sizeof(qname), "hda%d", card->number);
521 bus->workq = create_workqueue(qname);
522 if (!bus->workq) {
523 snd_printk(KERN_ERR "cannot create workqueue %s\n", qname);
524 kfree(bus);
525 return -ENOMEM;
526 }
527
517 err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops); 528 err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops);
518 if (err < 0) { 529 if (err < 0) {
519 snd_hda_bus_free(bus); 530 snd_hda_bus_free(bus);
@@ -684,7 +695,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
684 return; 695 return;
685#ifdef CONFIG_SND_HDA_POWER_SAVE 696#ifdef CONFIG_SND_HDA_POWER_SAVE
686 cancel_delayed_work(&codec->power_work); 697 cancel_delayed_work(&codec->power_work);
687 flush_scheduled_work(); 698 flush_workqueue(codec->bus->workq);
688#endif 699#endif
689 list_del(&codec->list); 700 list_del(&codec->list);
690 snd_array_free(&codec->mixers); 701 snd_array_free(&codec->mixers);
@@ -735,6 +746,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr
735 codec->bus = bus; 746 codec->bus = bus;
736 codec->addr = codec_addr; 747 codec->addr = codec_addr;
737 mutex_init(&codec->spdif_mutex); 748 mutex_init(&codec->spdif_mutex);
749 mutex_init(&codec->control_mutex);
738 init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info)); 750 init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info));
739 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head)); 751 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head));
740 snd_array_init(&codec->mixers, sizeof(struct snd_kcontrol *), 32); 752 snd_array_init(&codec->mixers, sizeof(struct snd_kcontrol *), 32);
@@ -1272,7 +1284,7 @@ void snd_hda_codec_reset(struct hda_codec *codec)
1272 1284
1273#ifdef CONFIG_SND_HDA_POWER_SAVE 1285#ifdef CONFIG_SND_HDA_POWER_SAVE
1274 cancel_delayed_work(&codec->power_work); 1286 cancel_delayed_work(&codec->power_work);
1275 flush_scheduled_work(); 1287 flush_workqueue(codec->bus->workq);
1276#endif 1288#endif
1277 snd_hda_ctls_clear(codec); 1289 snd_hda_ctls_clear(codec);
1278 /* relase PCMs */ 1290 /* relase PCMs */
@@ -1418,12 +1430,12 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol,
1418 unsigned long pval; 1430 unsigned long pval;
1419 int err; 1431 int err;
1420 1432
1421 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1433 mutex_lock(&codec->control_mutex);
1422 pval = kcontrol->private_value; 1434 pval = kcontrol->private_value;
1423 kcontrol->private_value = pval & ~AMP_VAL_IDX_MASK; /* index 0 */ 1435 kcontrol->private_value = pval & ~AMP_VAL_IDX_MASK; /* index 0 */
1424 err = snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); 1436 err = snd_hda_mixer_amp_switch_get(kcontrol, ucontrol);
1425 kcontrol->private_value = pval; 1437 kcontrol->private_value = pval;
1426 mutex_unlock(&codec->spdif_mutex); 1438 mutex_unlock(&codec->control_mutex);
1427 return err; 1439 return err;
1428} 1440}
1429EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get); 1441EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get);
@@ -1435,7 +1447,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
1435 unsigned long pval; 1447 unsigned long pval;
1436 int i, indices, err = 0, change = 0; 1448 int i, indices, err = 0, change = 0;
1437 1449
1438 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1450 mutex_lock(&codec->control_mutex);
1439 pval = kcontrol->private_value; 1451 pval = kcontrol->private_value;
1440 indices = (pval & AMP_VAL_IDX_MASK) >> AMP_VAL_IDX_SHIFT; 1452 indices = (pval & AMP_VAL_IDX_MASK) >> AMP_VAL_IDX_SHIFT;
1441 for (i = 0; i < indices; i++) { 1453 for (i = 0; i < indices; i++) {
@@ -1447,7 +1459,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
1447 change |= err; 1459 change |= err;
1448 } 1460 }
1449 kcontrol->private_value = pval; 1461 kcontrol->private_value = pval;
1450 mutex_unlock(&codec->spdif_mutex); 1462 mutex_unlock(&codec->control_mutex);
1451 return err < 0 ? err : change; 1463 return err < 0 ? err : change;
1452} 1464}
1453EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put); 1465EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put);
@@ -1462,12 +1474,12 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol,
1462 struct hda_bind_ctls *c; 1474 struct hda_bind_ctls *c;
1463 int err; 1475 int err;
1464 1476
1465 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1477 mutex_lock(&codec->control_mutex);
1466 c = (struct hda_bind_ctls *)kcontrol->private_value; 1478 c = (struct hda_bind_ctls *)kcontrol->private_value;
1467 kcontrol->private_value = *c->values; 1479 kcontrol->private_value = *c->values;
1468 err = c->ops->info(kcontrol, uinfo); 1480 err = c->ops->info(kcontrol, uinfo);
1469 kcontrol->private_value = (long)c; 1481 kcontrol->private_value = (long)c;
1470 mutex_unlock(&codec->spdif_mutex); 1482 mutex_unlock(&codec->control_mutex);
1471 return err; 1483 return err;
1472} 1484}
1473EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info); 1485EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info);
@@ -1479,12 +1491,12 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol,
1479 struct hda_bind_ctls *c; 1491 struct hda_bind_ctls *c;
1480 int err; 1492 int err;
1481 1493
1482 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1494 mutex_lock(&codec->control_mutex);
1483 c = (struct hda_bind_ctls *)kcontrol->private_value; 1495 c = (struct hda_bind_ctls *)kcontrol->private_value;
1484 kcontrol->private_value = *c->values; 1496 kcontrol->private_value = *c->values;
1485 err = c->ops->get(kcontrol, ucontrol); 1497 err = c->ops->get(kcontrol, ucontrol);
1486 kcontrol->private_value = (long)c; 1498 kcontrol->private_value = (long)c;
1487 mutex_unlock(&codec->spdif_mutex); 1499 mutex_unlock(&codec->control_mutex);
1488 return err; 1500 return err;
1489} 1501}
1490EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get); 1502EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get);
@@ -1497,7 +1509,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
1497 unsigned long *vals; 1509 unsigned long *vals;
1498 int err = 0, change = 0; 1510 int err = 0, change = 0;
1499 1511
1500 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1512 mutex_lock(&codec->control_mutex);
1501 c = (struct hda_bind_ctls *)kcontrol->private_value; 1513 c = (struct hda_bind_ctls *)kcontrol->private_value;
1502 for (vals = c->values; *vals; vals++) { 1514 for (vals = c->values; *vals; vals++) {
1503 kcontrol->private_value = *vals; 1515 kcontrol->private_value = *vals;
@@ -1507,7 +1519,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
1507 change |= err; 1519 change |= err;
1508 } 1520 }
1509 kcontrol->private_value = (long)c; 1521 kcontrol->private_value = (long)c;
1510 mutex_unlock(&codec->spdif_mutex); 1522 mutex_unlock(&codec->control_mutex);
1511 return err < 0 ? err : change; 1523 return err < 0 ? err : change;
1512} 1524}
1513EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put); 1525EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put);
@@ -1519,12 +1531,12 @@ int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1519 struct hda_bind_ctls *c; 1531 struct hda_bind_ctls *c;
1520 int err; 1532 int err;
1521 1533
1522 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1534 mutex_lock(&codec->control_mutex);
1523 c = (struct hda_bind_ctls *)kcontrol->private_value; 1535 c = (struct hda_bind_ctls *)kcontrol->private_value;
1524 kcontrol->private_value = *c->values; 1536 kcontrol->private_value = *c->values;
1525 err = c->ops->tlv(kcontrol, op_flag, size, tlv); 1537 err = c->ops->tlv(kcontrol, op_flag, size, tlv);
1526 kcontrol->private_value = (long)c; 1538 kcontrol->private_value = (long)c;
1527 mutex_unlock(&codec->spdif_mutex); 1539 mutex_unlock(&codec->control_mutex);
1528 return err; 1540 return err;
1529} 1541}
1530EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv); 1542EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv);
@@ -2712,6 +2724,67 @@ int snd_hda_check_board_config(struct hda_codec *codec,
2712EXPORT_SYMBOL_HDA(snd_hda_check_board_config); 2724EXPORT_SYMBOL_HDA(snd_hda_check_board_config);
2713 2725
2714/** 2726/**
2727 * snd_hda_check_board_codec_sid_config - compare the current codec
2728 subsystem ID with the
2729 config table
2730
2731 This is important for Gateway notebooks with SB450 HDA Audio
2732 where the vendor ID of the PCI device is:
2733 ATI Technologies Inc SB450 HDA Audio [1002:437b]
2734 and the vendor/subvendor are found only at the codec.
2735
2736 * @codec: the HDA codec
2737 * @num_configs: number of config enums
2738 * @models: array of model name strings
2739 * @tbl: configuration table, terminated by null entries
2740 *
2741 * Compares the modelname or PCI subsystem id of the current codec with the
2742 * given configuration table. If a matching entry is found, returns its
2743 * config value (supposed to be 0 or positive).
2744 *
2745 * If no entries are matching, the function returns a negative value.
2746 */
2747int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
2748 int num_configs, const char **models,
2749 const struct snd_pci_quirk *tbl)
2750{
2751 const struct snd_pci_quirk *q;
2752
2753 /* Search for codec ID */
2754 for (q = tbl; q->subvendor; q++) {
2755 unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);
2756
2757 if (vendorid == codec->subsystem_id)
2758 break;
2759 }
2760
2761 if (!q->subvendor)
2762 return -1;
2763
2764 tbl = q;
2765
2766 if (tbl->value >= 0 && tbl->value < num_configs) {
2767#ifdef CONFIG_SND_DEBUG_DETECT
2768 char tmp[10];
2769 const char *model = NULL;
2770 if (models)
2771 model = models[tbl->value];
2772 if (!model) {
2773 sprintf(tmp, "#%d", tbl->value);
2774 model = tmp;
2775 }
2776 snd_printdd(KERN_INFO "hda_codec: model '%s' is selected "
2777 "for config %x:%x (%s)\n",
2778 model, tbl->subvendor, tbl->subdevice,
2779 (tbl->name ? tbl->name : "Unknown device"));
2780#endif
2781 return tbl->value;
2782 }
2783 return -1;
2784}
2785EXPORT_SYMBOL_HDA(snd_hda_check_board_codec_sid_config);
2786
2787/**
2715 * snd_hda_add_new_ctls - create controls from the array 2788 * snd_hda_add_new_ctls - create controls from the array
2716 * @codec: the HDA codec 2789 * @codec: the HDA codec
2717 * @knew: the array of struct snd_kcontrol_new 2790 * @knew: the array of struct snd_kcontrol_new
@@ -2803,7 +2876,7 @@ void snd_hda_power_down(struct hda_codec *codec)
2803 return; 2876 return;
2804 if (power_save(codec)) { 2877 if (power_save(codec)) {
2805 codec->power_transition = 1; /* avoid reentrance */ 2878 codec->power_transition = 1; /* avoid reentrance */
2806 schedule_delayed_work(&codec->power_work, 2879 queue_delayed_work(codec->bus->workq, &codec->power_work,
2807 msecs_to_jiffies(power_save(codec) * 1000)); 2880 msecs_to_jiffies(power_save(codec) * 1000));
2808 } 2881 }
2809} 2882}
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 729fc7642d7f..5810ef588402 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -614,6 +614,7 @@ struct hda_bus {
614 614
615 /* unsolicited event queue */ 615 /* unsolicited event queue */
616 struct hda_bus_unsolicited *unsol; 616 struct hda_bus_unsolicited *unsol;
617 struct workqueue_struct *workq; /* common workqueue for codecs */
617 618
618 /* assigned PCMs */ 619 /* assigned PCMs */
619 DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES); 620 DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES);
@@ -771,6 +772,7 @@ struct hda_codec {
771 struct hda_cache_rec cmd_cache; /* cache for other commands */ 772 struct hda_cache_rec cmd_cache; /* cache for other commands */
772 773
773 struct mutex spdif_mutex; 774 struct mutex spdif_mutex;
775 struct mutex control_mutex;
774 unsigned int spdif_status; /* IEC958 status bits */ 776 unsigned int spdif_status; /* IEC958 status bits */
775 unsigned short spdif_ctls; /* SPDIF control bits */ 777 unsigned short spdif_ctls; /* SPDIF control bits */
776 unsigned int spdif_in_enable; /* SPDIF input enable? */ 778 unsigned int spdif_in_enable; /* SPDIF input enable? */
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ad5df2ae6f7d..f9603443f086 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -996,10 +996,11 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
996 spin_unlock(&chip->reg_lock); 996 spin_unlock(&chip->reg_lock);
997 snd_pcm_period_elapsed(azx_dev->substream); 997 snd_pcm_period_elapsed(azx_dev->substream);
998 spin_lock(&chip->reg_lock); 998 spin_lock(&chip->reg_lock);
999 } else { 999 } else if (chip->bus && chip->bus->workq) {
1000 /* bogus IRQ, process it later */ 1000 /* bogus IRQ, process it later */
1001 azx_dev->irq_pending = 1; 1001 azx_dev->irq_pending = 1;
1002 schedule_work(&chip->irq_pending_work); 1002 queue_work(chip->bus->workq,
1003 &chip->irq_pending_work);
1003 } 1004 }
1004 } 1005 }
1005 } 1006 }
@@ -1741,7 +1742,6 @@ static void azx_clear_irq_pending(struct azx *chip)
1741 for (i = 0; i < chip->num_streams; i++) 1742 for (i = 0; i < chip->num_streams; i++)
1742 chip->azx_dev[i].irq_pending = 0; 1743 chip->azx_dev[i].irq_pending = 0;
1743 spin_unlock_irq(&chip->reg_lock); 1744 spin_unlock_irq(&chip->reg_lock);
1744 flush_scheduled_work();
1745} 1745}
1746 1746
1747static struct snd_pcm_ops azx_pcm_ops = { 1747static struct snd_pcm_ops azx_pcm_ops = {
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 6f2fe0f9fdd8..1dd8716c387f 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -296,6 +296,9 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen);
296int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, 296int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
297 const char **modelnames, 297 const char **modelnames,
298 const struct snd_pci_quirk *pci_list); 298 const struct snd_pci_quirk *pci_list);
299int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
300 int num_configs, const char **models,
301 const struct snd_pci_quirk *tbl);
299int snd_hda_add_new_ctls(struct hda_codec *codec, 302int snd_hda_add_new_ctls(struct hda_codec *codec,
300 struct snd_kcontrol_new *knew); 303 struct snd_kcontrol_new *knew);
301 304
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 26247cfe749d..2e7371ec2e23 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3900,6 +3900,7 @@ static const char *ad1884a_models[AD1884A_MODELS] = {
3900 3900
3901static struct snd_pci_quirk ad1884a_cfg_tbl[] = { 3901static struct snd_pci_quirk ad1884a_cfg_tbl[] = {
3902 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), 3902 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
3903 SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP),
3903 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), 3904 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
3904 SND_PCI_QUIRK(0x103c, 0x30e6, "HP 6730b", AD1884A_LAPTOP), 3905 SND_PCI_QUIRK(0x103c, 0x30e6, "HP 6730b", AD1884A_LAPTOP),
3905 SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP), 3906 SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP),
@@ -4262,13 +4263,13 @@ static int patch_ad1882(struct hda_codec *codec)
4262 spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); 4263 spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids);
4263 spec->adc_nids = ad1882_adc_nids; 4264 spec->adc_nids = ad1882_adc_nids;
4264 spec->capsrc_nids = ad1882_capsrc_nids; 4265 spec->capsrc_nids = ad1882_capsrc_nids;
4265 if (codec->vendor_id == 0x11d1882) 4266 if (codec->vendor_id == 0x11d41882)
4266 spec->input_mux = &ad1882_capture_source; 4267 spec->input_mux = &ad1882_capture_source;
4267 else 4268 else
4268 spec->input_mux = &ad1882a_capture_source; 4269 spec->input_mux = &ad1882a_capture_source;
4269 spec->num_mixers = 2; 4270 spec->num_mixers = 2;
4270 spec->mixers[0] = ad1882_base_mixers; 4271 spec->mixers[0] = ad1882_base_mixers;
4271 if (codec->vendor_id == 0x11d1882) 4272 if (codec->vendor_id == 0x11d41882)
4272 spec->mixers[1] = ad1882_loopback_mixers; 4273 spec->mixers[1] = ad1882_loopback_mixers;
4273 else 4274 else
4274 spec->mixers[1] = ad1882a_loopback_mixers; 4275 spec->mixers[1] = ad1882a_loopback_mixers;
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index 0270fda0bda5..d57d8132a06e 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -160,14 +160,18 @@ static int patch_nvhdmi(struct hda_codec *codec)
160 */ 160 */
161static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { 161static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
162 { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi }, 162 { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi },
163 { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi },
163 { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi }, 164 { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi },
164 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi }, 165 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi },
166 { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi },
165 {} /* terminator */ 167 {} /* terminator */
166}; 168};
167 169
168MODULE_ALIAS("snd-hda-codec-id:10de0002"); 170MODULE_ALIAS("snd-hda-codec-id:10de0002");
171MODULE_ALIAS("snd-hda-codec-id:10de0006");
169MODULE_ALIAS("snd-hda-codec-id:10de0007"); 172MODULE_ALIAS("snd-hda-codec-id:10de0007");
170MODULE_ALIAS("snd-hda-codec-id:10de0067"); 173MODULE_ALIAS("snd-hda-codec-id:10de0067");
174MODULE_ALIAS("snd-hda-codec-id:10de8001");
171 175
172MODULE_LICENSE("GPL"); 176MODULE_LICENSE("GPL");
173MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec"); 177MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec");
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 9065ebf9c065..82dd08431970 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1502,11 +1502,11 @@ static int alc_cap_vol_info(struct snd_kcontrol *kcontrol,
1502 struct alc_spec *spec = codec->spec; 1502 struct alc_spec *spec = codec->spec;
1503 int err; 1503 int err;
1504 1504
1505 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1505 mutex_lock(&codec->control_mutex);
1506 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, 1506 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
1507 HDA_INPUT); 1507 HDA_INPUT);
1508 err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); 1508 err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo);
1509 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1509 mutex_unlock(&codec->control_mutex);
1510 return err; 1510 return err;
1511} 1511}
1512 1512
@@ -1517,11 +1517,11 @@ static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1517 struct alc_spec *spec = codec->spec; 1517 struct alc_spec *spec = codec->spec;
1518 int err; 1518 int err;
1519 1519
1520 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1520 mutex_lock(&codec->control_mutex);
1521 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, 1521 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
1522 HDA_INPUT); 1522 HDA_INPUT);
1523 err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); 1523 err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv);
1524 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1524 mutex_unlock(&codec->control_mutex);
1525 return err; 1525 return err;
1526} 1526}
1527 1527
@@ -1537,11 +1537,11 @@ static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
1537 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1537 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
1538 int err; 1538 int err;
1539 1539
1540 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1540 mutex_lock(&codec->control_mutex);
1541 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], 1541 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx],
1542 3, 0, HDA_INPUT); 1542 3, 0, HDA_INPUT);
1543 err = func(kcontrol, ucontrol); 1543 err = func(kcontrol, ucontrol);
1544 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1544 mutex_unlock(&codec->control_mutex);
1545 return err; 1545 return err;
1546} 1546}
1547 1547
@@ -8461,6 +8461,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8461 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), 8461 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
8462 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", 8462 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
8463 ALC888_ACER_ASPIRE_4930G), 8463 ALC888_ACER_ASPIRE_4930G),
8464 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
8465 ALC888_ACER_ASPIRE_4930G),
8466 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
8467 ALC888_ACER_ASPIRE_4930G),
8464 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ 8468 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */
8465 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), 8469 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
8466 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), 8470 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG),
@@ -8522,6 +8526,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8522 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), 8526 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
8523 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), 8527 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
8524 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL), 8528 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL),
8529 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC883_3ST_6ch_INTEL),
8525 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 8530 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch),
8526 {} 8531 {}
8527}; 8532};
@@ -10568,6 +10573,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
10568 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), 10573 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
10569 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), 10574 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA),
10570 SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA), 10575 SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA),
10576 SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO),
10571 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000), 10577 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000),
10572 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), 10578 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
10573 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31), 10579 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31),
@@ -11689,6 +11695,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
11689 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", 11695 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
11690 ALC268_ACER_ASPIRE_ONE), 11696 ALC268_ACER_ASPIRE_ONE),
11691 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), 11697 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
11698 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL),
11692 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), 11699 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA),
11693 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 11700 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
11694 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), 11701 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA),
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 35b83dc6e19e..c39deebb588f 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -55,7 +55,8 @@ enum {
55 STAC_9200_DELL_M25, 55 STAC_9200_DELL_M25,
56 STAC_9200_DELL_M26, 56 STAC_9200_DELL_M26,
57 STAC_9200_DELL_M27, 57 STAC_9200_DELL_M27,
58 STAC_9200_GATEWAY, 58 STAC_9200_M4,
59 STAC_9200_M4_2,
59 STAC_9200_PANASONIC, 60 STAC_9200_PANASONIC,
60 STAC_9200_MODELS 61 STAC_9200_MODELS
61}; 62};
@@ -89,14 +90,19 @@ enum {
89 STAC_DELL_M4_2, 90 STAC_DELL_M4_2,
90 STAC_DELL_M4_3, 91 STAC_DELL_M4_3,
91 STAC_HP_M4, 92 STAC_HP_M4,
93 STAC_HP_DV5,
92 STAC_92HD71BXX_MODELS 94 STAC_92HD71BXX_MODELS
93}; 95};
94 96
95enum { 97enum {
96 STAC_925x_REF, 98 STAC_925x_REF,
99 STAC_M1,
100 STAC_M1_2,
101 STAC_M2,
97 STAC_M2_2, 102 STAC_M2_2,
98 STAC_MA6, 103 STAC_M3,
99 STAC_PA6, 104 STAC_M5,
105 STAC_M6,
100 STAC_925x_MODELS 106 STAC_925x_MODELS
101}; 107};
102 108
@@ -331,6 +337,10 @@ static unsigned int stac92hd83xxx_pwr_mapping[4] = {
331 0x03, 0x0c, 0x10, 0x40, 337 0x03, 0x0c, 0x10, 0x40,
332}; 338};
333 339
340static hda_nid_t stac92hd83xxx_amp_nids[1] = {
341 0xc,
342};
343
334static hda_nid_t stac92hd71bxx_pwr_nids[3] = { 344static hda_nid_t stac92hd71bxx_pwr_nids[3] = {
335 0x0a, 0x0d, 0x0f 345 0x0a, 0x0d, 0x0f
336}; 346};
@@ -875,6 +885,8 @@ static struct hda_verb stac92hd71bxx_analog_core_init[] = {
875static struct hda_verb stac925x_core_init[] = { 885static struct hda_verb stac925x_core_init[] = {
876 /* set dac0mux for dac converter */ 886 /* set dac0mux for dac converter */
877 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, 887 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
888 /* unmute and set max the selector */
889 { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f },
878 {} 890 {}
879}; 891};
880 892
@@ -1334,7 +1346,16 @@ static unsigned int ref9200_pin_configs[8] = {
1334 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, 1346 0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
1335}; 1347};
1336 1348
1337/* 1349static unsigned int gateway9200_m4_pin_configs[8] = {
1350 0x400000fe, 0x404500f4, 0x400100f0, 0x90110010,
1351 0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3,
1352};
1353static unsigned int gateway9200_m4_2_pin_configs[8] = {
1354 0x400000fe, 0x404500f4, 0x400100f0, 0x90110010,
1355 0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3,
1356};
1357
1358/*
1338 STAC 9200 pin configs for 1359 STAC 9200 pin configs for
1339 102801A8 1360 102801A8
1340 102801DE 1361 102801DE
@@ -1464,6 +1485,8 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
1464 [STAC_9200_DELL_M25] = dell9200_m25_pin_configs, 1485 [STAC_9200_DELL_M25] = dell9200_m25_pin_configs,
1465 [STAC_9200_DELL_M26] = dell9200_m26_pin_configs, 1486 [STAC_9200_DELL_M26] = dell9200_m26_pin_configs,
1466 [STAC_9200_DELL_M27] = dell9200_m27_pin_configs, 1487 [STAC_9200_DELL_M27] = dell9200_m27_pin_configs,
1488 [STAC_9200_M4] = gateway9200_m4_pin_configs,
1489 [STAC_9200_M4_2] = gateway9200_m4_2_pin_configs,
1467 [STAC_9200_PANASONIC] = ref9200_pin_configs, 1490 [STAC_9200_PANASONIC] = ref9200_pin_configs,
1468}; 1491};
1469 1492
@@ -1480,7 +1503,8 @@ static const char *stac9200_models[STAC_9200_MODELS] = {
1480 [STAC_9200_DELL_M25] = "dell-m25", 1503 [STAC_9200_DELL_M25] = "dell-m25",
1481 [STAC_9200_DELL_M26] = "dell-m26", 1504 [STAC_9200_DELL_M26] = "dell-m26",
1482 [STAC_9200_DELL_M27] = "dell-m27", 1505 [STAC_9200_DELL_M27] = "dell-m27",
1483 [STAC_9200_GATEWAY] = "gateway", 1506 [STAC_9200_M4] = "gateway-m4",
1507 [STAC_9200_M4_2] = "gateway-m4-2",
1484 [STAC_9200_PANASONIC] = "panasonic", 1508 [STAC_9200_PANASONIC] = "panasonic",
1485}; 1509};
1486 1510
@@ -1550,11 +1574,9 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
1550 /* Panasonic */ 1574 /* Panasonic */
1551 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), 1575 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC),
1552 /* Gateway machines needs EAPD to be set on resume */ 1576 /* Gateway machines needs EAPD to be set on resume */
1553 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_GATEWAY), 1577 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4),
1554 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", 1578 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2),
1555 STAC_9200_GATEWAY), 1579 SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2),
1556 SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707",
1557 STAC_9200_GATEWAY),
1558 /* OQO Mobile */ 1580 /* OQO Mobile */
1559 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO), 1581 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO),
1560 {} /* terminator */ 1582 {} /* terminator */
@@ -1565,44 +1587,85 @@ static unsigned int ref925x_pin_configs[8] = {
1565 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, 1587 0x90a70320, 0x02214210, 0x01019020, 0x9033032e,
1566}; 1588};
1567 1589
1568static unsigned int stac925x_MA6_pin_configs[8] = { 1590static unsigned int stac925xM1_pin_configs[8] = {
1569 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, 1591 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1570 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, 1592 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1571}; 1593};
1572 1594
1573static unsigned int stac925x_PA6_pin_configs[8] = { 1595static unsigned int stac925xM1_2_pin_configs[8] = {
1574 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, 1596 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1575 0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e, 1597 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1598};
1599
1600static unsigned int stac925xM2_pin_configs[8] = {
1601 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1602 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1576}; 1603};
1577 1604
1578static unsigned int stac925xM2_2_pin_configs[8] = { 1605static unsigned int stac925xM2_2_pin_configs[8] = {
1579 0x40c003f3, 0x424503f2, 0x04180011, 0x02a19020, 1606 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1580 0x50a103f0, 0x90100212, 0x400003f1, 0x9033032e, 1607 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1608};
1609
1610static unsigned int stac925xM3_pin_configs[8] = {
1611 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1612 0x40a000f0, 0x90100210, 0x400003f1, 0x503303f3,
1613};
1614
1615static unsigned int stac925xM5_pin_configs[8] = {
1616 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1617 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1618};
1619
1620static unsigned int stac925xM6_pin_configs[8] = {
1621 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1622 0x40a000f0, 0x90100210, 0x400003f1, 0x90330320,
1581}; 1623};
1582 1624
1583static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { 1625static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
1584 [STAC_REF] = ref925x_pin_configs, 1626 [STAC_REF] = ref925x_pin_configs,
1627 [STAC_M1] = stac925xM1_pin_configs,
1628 [STAC_M1_2] = stac925xM1_2_pin_configs,
1629 [STAC_M2] = stac925xM2_pin_configs,
1585 [STAC_M2_2] = stac925xM2_2_pin_configs, 1630 [STAC_M2_2] = stac925xM2_2_pin_configs,
1586 [STAC_MA6] = stac925x_MA6_pin_configs, 1631 [STAC_M3] = stac925xM3_pin_configs,
1587 [STAC_PA6] = stac925x_PA6_pin_configs, 1632 [STAC_M5] = stac925xM5_pin_configs,
1633 [STAC_M6] = stac925xM6_pin_configs,
1588}; 1634};
1589 1635
1590static const char *stac925x_models[STAC_925x_MODELS] = { 1636static const char *stac925x_models[STAC_925x_MODELS] = {
1591 [STAC_REF] = "ref", 1637 [STAC_REF] = "ref",
1638 [STAC_M1] = "m1",
1639 [STAC_M1_2] = "m1-2",
1640 [STAC_M2] = "m2",
1592 [STAC_M2_2] = "m2-2", 1641 [STAC_M2_2] = "m2-2",
1593 [STAC_MA6] = "m6", 1642 [STAC_M3] = "m3",
1594 [STAC_PA6] = "pa6", 1643 [STAC_M5] = "m5",
1644 [STAC_M6] = "m6",
1645};
1646
1647static struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = {
1648 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2),
1649 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5),
1650 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1),
1651 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2),
1652 SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2),
1653 /* Not sure about the brand name for those */
1654 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1),
1655 SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3),
1656 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6),
1657 SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2),
1658 {} /* terminator */
1595}; 1659};
1596 1660
1597static struct snd_pci_quirk stac925x_cfg_tbl[] = { 1661static struct snd_pci_quirk stac925x_cfg_tbl[] = {
1598 /* SigmaTel reference board */ 1662 /* SigmaTel reference board */
1599 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), 1663 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
1600 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), 1664 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF),
1601 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), 1665
1602 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), 1666 /* Default table for unknown ID */
1603 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), 1667 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2),
1604 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6), 1668
1605 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2),
1606 {} /* terminator */ 1669 {} /* terminator */
1607}; 1670};
1608 1671
@@ -1682,7 +1745,7 @@ static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
1682static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { 1745static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1683 /* SigmaTel reference board */ 1746 /* SigmaTel reference board */
1684 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1747 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1685 "DFI LanParty", STAC_92HD71BXX_REF), 1748 "DFI LanParty", STAC_92HD83XXX_REF),
1686 {} /* terminator */ 1749 {} /* terminator */
1687}; 1750};
1688 1751
@@ -1716,6 +1779,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
1716 [STAC_DELL_M4_2] = dell_m4_2_pin_configs, 1779 [STAC_DELL_M4_2] = dell_m4_2_pin_configs,
1717 [STAC_DELL_M4_3] = dell_m4_3_pin_configs, 1780 [STAC_DELL_M4_3] = dell_m4_3_pin_configs,
1718 [STAC_HP_M4] = NULL, 1781 [STAC_HP_M4] = NULL,
1782 [STAC_HP_DV5] = NULL,
1719}; 1783};
1720 1784
1721static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { 1785static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
@@ -1724,6 +1788,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1724 [STAC_DELL_M4_2] = "dell-m4-2", 1788 [STAC_DELL_M4_2] = "dell-m4-2",
1725 [STAC_DELL_M4_3] = "dell-m4-3", 1789 [STAC_DELL_M4_3] = "dell-m4-3",
1726 [STAC_HP_M4] = "hp-m4", 1790 [STAC_HP_M4] = "hp-m4",
1791 [STAC_HP_DV5] = "hp-dv5",
1727}; 1792};
1728 1793
1729static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { 1794static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
@@ -1736,6 +1801,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1736 "HP dv7", STAC_HP_M4), 1801 "HP dv7", STAC_HP_M4),
1737 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, 1802 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
1738 "HP dv7", STAC_HP_M4), 1803 "HP dv7", STAC_HP_M4),
1804 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
1805 "HP dv5", STAC_HP_DV5),
1739 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, 1806 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
1740 "unknown HP", STAC_HP_M4), 1807 "unknown HP", STAC_HP_M4),
1741 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, 1808 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
@@ -4163,8 +4230,19 @@ static void stac92xx_hp_detect(struct hda_codec *codec)
4163 continue; 4230 continue;
4164 if (presence) 4231 if (presence)
4165 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); 4232 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
4233#if 0 /* FIXME */
4234/* Resetting the pinctl like below may lead to (a sort of) regressions
4235 * on some devices since they use the HP pin actually for line/speaker
4236 * outs although the default pin config shows a different pin (that is
4237 * wrong and useless).
4238 *
4239 * So, it's basically a problem of default pin configs, likely a BIOS issue.
4240 * But, disabling the code below just works around it, and I'm too tired of
4241 * bug reports with such devices...
4242 */
4166 else 4243 else
4167 stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val); 4244 stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val);
4245#endif /* FIXME */
4168 } 4246 }
4169} 4247}
4170 4248
@@ -4390,7 +4468,8 @@ static int patch_stac9200(struct hda_codec *codec)
4390 spec->num_adcs = 1; 4468 spec->num_adcs = 1;
4391 spec->num_pwrs = 0; 4469 spec->num_pwrs = 0;
4392 4470
4393 if (spec->board_config == STAC_9200_GATEWAY || 4471 if (spec->board_config == STAC_9200_M4 ||
4472 spec->board_config == STAC_9200_M4_2 ||
4394 spec->board_config == STAC_9200_OQO) 4473 spec->board_config == STAC_9200_OQO)
4395 spec->init = stac9200_eapd_init; 4474 spec->init = stac9200_eapd_init;
4396 else 4475 else
@@ -4408,6 +4487,12 @@ static int patch_stac9200(struct hda_codec *codec)
4408 return err; 4487 return err;
4409 } 4488 }
4410 4489
4490 /* CF-74 has no headphone detection, and the driver should *NOT*
4491 * do detection and HP/speaker toggle because the hardware does it.
4492 */
4493 if (spec->board_config == STAC_9200_PANASONIC)
4494 spec->hp_detect = 0;
4495
4411 codec->patch_ops = stac92xx_patch_ops; 4496 codec->patch_ops = stac92xx_patch_ops;
4412 4497
4413 return 0; 4498 return 0;
@@ -4425,12 +4510,22 @@ static int patch_stac925x(struct hda_codec *codec)
4425 codec->spec = spec; 4510 codec->spec = spec;
4426 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); 4511 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
4427 spec->pin_nids = stac925x_pin_nids; 4512 spec->pin_nids = stac925x_pin_nids;
4428 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, 4513
4514 /* Check first for codec ID */
4515 spec->board_config = snd_hda_check_board_codec_sid_config(codec,
4516 STAC_925x_MODELS,
4517 stac925x_models,
4518 stac925x_codec_id_cfg_tbl);
4519
4520 /* Now checks for PCI ID, if codec ID is not found */
4521 if (spec->board_config < 0)
4522 spec->board_config = snd_hda_check_board_config(codec,
4523 STAC_925x_MODELS,
4429 stac925x_models, 4524 stac925x_models,
4430 stac925x_cfg_tbl); 4525 stac925x_cfg_tbl);
4431 again: 4526 again:
4432 if (spec->board_config < 0) { 4527 if (spec->board_config < 0) {
4433 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," 4528 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
4434 "using BIOS defaults\n"); 4529 "using BIOS defaults\n");
4435 err = stac92xx_save_bios_config_regs(codec); 4530 err = stac92xx_save_bios_config_regs(codec);
4436 } else 4531 } else
@@ -4672,6 +4767,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4672 spec->dmux_nids = stac92hd83xxx_dmux_nids; 4767 spec->dmux_nids = stac92hd83xxx_dmux_nids;
4673 spec->adc_nids = stac92hd83xxx_adc_nids; 4768 spec->adc_nids = stac92hd83xxx_adc_nids;
4674 spec->pwr_nids = stac92hd83xxx_pwr_nids; 4769 spec->pwr_nids = stac92hd83xxx_pwr_nids;
4770 spec->amp_nids = stac92hd83xxx_amp_nids;
4675 spec->pwr_mapping = stac92hd83xxx_pwr_mapping; 4771 spec->pwr_mapping = stac92hd83xxx_pwr_mapping;
4676 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); 4772 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4677 spec->multiout.dac_nids = spec->dac_nids; 4773 spec->multiout.dac_nids = spec->dac_nids;
@@ -4689,6 +4785,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4689 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); 4785 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids);
4690 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); 4786 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids);
4691 spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); 4787 spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids);
4788 spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids);
4692 spec->num_dmics = STAC92HD83XXX_NUM_DMICS; 4789 spec->num_dmics = STAC92HD83XXX_NUM_DMICS;
4693 spec->dinput_mux = &stac92hd83xxx_dmux; 4790 spec->dinput_mux = &stac92hd83xxx_dmux;
4694 spec->pin_nids = stac92hd83xxx_pin_nids; 4791 spec->pin_nids = stac92hd83xxx_pin_nids;
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index 3782b52bc0e8..dda562081d7e 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -345,8 +345,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
345 status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); 345 status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET ));
346 346
347 /* motherboard xilinx status 5 will say that the board is performing a reset */ 347 /* motherboard xilinx status 5 will say that the board is performing a reset */
348 if( status_xilinx == 5 ) { 348 if (status_xilinx == 5) {
349 snd_printk( KERN_ERR "miXart is resetting !\n"); 349 snd_printk(KERN_ERR "miXart is resetting !\n");
350 return -EAGAIN; /* try again later */ 350 return -EAGAIN; /* try again later */
351 } 351 }
352 352
@@ -354,13 +354,14 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
354 case MIXART_MOTHERBOARD_XLX_INDEX: 354 case MIXART_MOTHERBOARD_XLX_INDEX:
355 355
356 /* xilinx already loaded ? */ 356 /* xilinx already loaded ? */
357 if( status_xilinx == 4 ) { 357 if (status_xilinx == 4) {
358 snd_printk( KERN_DEBUG "xilinx is already loaded !\n"); 358 snd_printk(KERN_DEBUG "xilinx is already loaded !\n");
359 return 0; 359 return 0;
360 } 360 }
361 /* the status should be 0 == "idle" */ 361 /* the status should be 0 == "idle" */
362 if( status_xilinx != 0 ) { 362 if (status_xilinx != 0) {
363 snd_printk( KERN_ERR "xilinx load error ! status = %d\n", status_xilinx); 363 snd_printk(KERN_ERR "xilinx load error ! status = %d\n",
364 status_xilinx);
364 return -EIO; /* modprob -r may help ? */ 365 return -EIO; /* modprob -r may help ? */
365 } 366 }
366 367
@@ -389,21 +390,23 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
389 390
390 case MIXART_MOTHERBOARD_ELF_INDEX: 391 case MIXART_MOTHERBOARD_ELF_INDEX:
391 392
392 if( status_elf == 4 ) { 393 if (status_elf == 4) {
393 snd_printk( KERN_DEBUG "elf file already loaded !\n"); 394 snd_printk(KERN_DEBUG "elf file already loaded !\n");
394 return 0; 395 return 0;
395 } 396 }
396 397
397 /* the status should be 0 == "idle" */ 398 /* the status should be 0 == "idle" */
398 if( status_elf != 0 ) { 399 if (status_elf != 0) {
399 snd_printk( KERN_ERR "elf load error ! status = %d\n", status_elf); 400 snd_printk(KERN_ERR "elf load error ! status = %d\n",
401 status_elf);
400 return -EIO; /* modprob -r may help ? */ 402 return -EIO; /* modprob -r may help ? */
401 } 403 }
402 404
403 /* wait for xilinx status == 4 */ 405 /* wait for xilinx status == 4 */
404 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */ 406 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */
405 if (err < 0) { 407 if (err < 0) {
406 snd_printk( KERN_ERR "xilinx was not loaded or could not be started\n"); 408 snd_printk(KERN_ERR "xilinx was not loaded or "
409 "could not be started\n");
407 return err; 410 return err;
408 } 411 }
409 412
@@ -424,7 +427,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
424 /* wait for elf status == 4 */ 427 /* wait for elf status == 4 */
425 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */ 428 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */
426 if (err < 0) { 429 if (err < 0) {
427 snd_printk( KERN_ERR "elf could not be started\n"); 430 snd_printk(KERN_ERR "elf could not be started\n");
428 return err; 431 return err;
429 } 432 }
430 433
@@ -437,15 +440,16 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
437 default: 440 default:
438 441
439 /* elf and xilinx should be loaded */ 442 /* elf and xilinx should be loaded */
440 if( (status_elf != 4) || (status_xilinx != 4) ) { 443 if (status_elf != 4 || status_xilinx != 4) {
441 printk( KERN_ERR "xilinx or elf not successfully loaded\n"); 444 printk(KERN_ERR "xilinx or elf not "
445 "successfully loaded\n");
442 return -EIO; /* modprob -r may help ? */ 446 return -EIO; /* modprob -r may help ? */
443 } 447 }
444 448
445 /* wait for daughter detection != 0 */ 449 /* wait for daughter detection != 0 */
446 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */ 450 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */
447 if (err < 0) { 451 if (err < 0) {
448 snd_printk( KERN_ERR "error starting elf file\n"); 452 snd_printk(KERN_ERR "error starting elf file\n");
449 return err; 453 return err;
450 } 454 }
451 455
@@ -460,8 +464,9 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
460 return -EINVAL; 464 return -EINVAL;
461 465
462 /* daughter should be idle */ 466 /* daughter should be idle */
463 if( status_daught != 0 ) { 467 if (status_daught != 0) {
464 printk( KERN_ERR "daughter load error ! status = %d\n", status_daught); 468 printk(KERN_ERR "daughter load error ! status = %d\n",
469 status_daught);
465 return -EIO; /* modprob -r may help ? */ 470 return -EIO; /* modprob -r may help ? */
466 } 471 }
467 472
@@ -480,7 +485,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
480 /* wait for status == 2 */ 485 /* wait for status == 2 */
481 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */ 486 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */
482 if (err < 0) { 487 if (err < 0) {
483 snd_printk( KERN_ERR "daughter board load error\n"); 488 snd_printk(KERN_ERR "daughter board load error\n");
484 return err; 489 return err;
485 } 490 }
486 491
@@ -502,7 +507,8 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
502 /* wait for daughter status == 3 */ 507 /* wait for daughter status == 3 */
503 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */ 508 err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */
504 if (err < 0) { 509 if (err < 0) {
505 snd_printk( KERN_ERR "daughter board could not be initialised\n"); 510 snd_printk(KERN_ERR
511 "daughter board could not be initialised\n");
506 return err; 512 return err;
507 } 513 }
508 514
@@ -512,7 +518,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
512 /* first communication with embedded */ 518 /* first communication with embedded */
513 err = mixart_first_init(mgr); 519 err = mixart_first_init(mgr);
514 if (err < 0) { 520 if (err < 0) {
515 snd_printk( KERN_ERR "miXart could not be set up\n"); 521 snd_printk(KERN_ERR "miXart could not be set up\n");
516 return err; 522 return err;
517 } 523 }
518 524
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index 98c6a8c65d81..e9e829e83d7a 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -26,7 +26,7 @@
26 * SPI 0 -> 1st PCM1796 (front) 26 * SPI 0 -> 1st PCM1796 (front)
27 * SPI 1 -> 2nd PCM1796 (surround) 27 * SPI 1 -> 2nd PCM1796 (surround)
28 * SPI 2 -> 3rd PCM1796 (center/LFE) 28 * SPI 2 -> 3rd PCM1796 (center/LFE)
29 * SPI 4 -> 4th PCM1796 (back) 29 * SPI 4 -> 4th PCM1796 (back) and EEPROM self-destruct (do not use!)
30 * 30 *
31 * GPIO 2 -> M0 of CS5381 31 * GPIO 2 -> M0 of CS5381
32 * GPIO 3 -> M1 of CS5381 32 * GPIO 3 -> M1 of CS5381
@@ -207,6 +207,12 @@ static void xonar_gpio_changed(struct oxygen *chip);
207static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec, 207static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
208 u8 reg, u8 value) 208 u8 reg, u8 value)
209{ 209{
210 /*
211 * We don't want to do writes on SPI 4 because the EEPROM, which shares
212 * the same pin, might get confused and broken. We'd better take care
213 * that the driver works with the default register values ...
214 */
215#if 0
210 /* maps ALSA channel pair number to SPI output */ 216 /* maps ALSA channel pair number to SPI output */
211 static const u8 codec_map[4] = { 217 static const u8 codec_map[4] = {
212 0, 1, 2, 4 218 0, 1, 2, 4
@@ -217,6 +223,7 @@ static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
217 (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) | 223 (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) |
218 OXYGEN_SPI_CEN_LATCH_CLOCK_HI, 224 OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
219 (reg << 8) | value); 225 (reg << 8) | value);
226#endif
220} 227}
221 228
222static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec, 229static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec,
@@ -750,6 +757,9 @@ static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -12700, 100, 0);
750 757
751static int xonar_d2_control_filter(struct snd_kcontrol_new *template) 758static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
752{ 759{
760 if (!strncmp(template->name, "Master Playback ", 16))
761 /* disable volume/mute because they would require SPI writes */
762 return 1;
753 if (!strncmp(template->name, "CD Capture ", 11)) 763 if (!strncmp(template->name, "CD Capture ", 11))
754 /* CD in is actually connected to the video in pin */ 764 /* CD in is actually connected to the video in pin */
755 template->private_value ^= AC97_CD ^ AC97_VIDEO; 765 template->private_value ^= AC97_CD ^ AC97_VIDEO;
@@ -840,9 +850,8 @@ static const struct oxygen_model model_xonar_d2 = {
840 .dac_volume_min = 0x0f, 850 .dac_volume_min = 0x0f,
841 .dac_volume_max = 0xff, 851 .dac_volume_max = 0xff,
842 .misc_flags = OXYGEN_MISC_MIDI, 852 .misc_flags = OXYGEN_MISC_MIDI,
843 .function_flags = OXYGEN_FUNCTION_SPI | 853 .function_flags = OXYGEN_FUNCTION_SPI,
844 OXYGEN_FUNCTION_ENABLE_SPI_4_5, 854 .dac_i2s_format = OXYGEN_I2S_FORMAT_I2S,
845 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
846 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 855 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
847}; 856};
848 857
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index c5601b0ad7cc..d989215f3556 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -273,7 +273,8 @@ static inline void snd_sonicvibes_setdmaa(struct sonicvibes * sonic,
273 outl(count, sonic->dmaa_port + SV_DMA_COUNT0); 273 outl(count, sonic->dmaa_port + SV_DMA_COUNT0);
274 outb(0x18, sonic->dmaa_port + SV_DMA_MODE); 274 outb(0x18, sonic->dmaa_port + SV_DMA_MODE);
275#if 0 275#if 0
276 printk("program dmaa: addr = 0x%x, paddr = 0x%x\n", addr, inl(sonic->dmaa_port + SV_DMA_ADDR0)); 276 printk(KERN_DEBUG "program dmaa: addr = 0x%x, paddr = 0x%x\n",
277 addr, inl(sonic->dmaa_port + SV_DMA_ADDR0));
277#endif 278#endif
278} 279}
279 280
@@ -288,7 +289,8 @@ static inline void snd_sonicvibes_setdmac(struct sonicvibes * sonic,
288 outl(count, sonic->dmac_port + SV_DMA_COUNT0); 289 outl(count, sonic->dmac_port + SV_DMA_COUNT0);
289 outb(0x14, sonic->dmac_port + SV_DMA_MODE); 290 outb(0x14, sonic->dmac_port + SV_DMA_MODE);
290#if 0 291#if 0
291 printk("program dmac: addr = 0x%x, paddr = 0x%x\n", addr, inl(sonic->dmac_port + SV_DMA_ADDR0)); 292 printk(KERN_DEBUG "program dmac: addr = 0x%x, paddr = 0x%x\n",
293 addr, inl(sonic->dmac_port + SV_DMA_ADDR0));
292#endif 294#endif
293} 295}
294 296
@@ -355,71 +357,104 @@ static unsigned char snd_sonicvibes_in(struct sonicvibes * sonic, unsigned char
355#if 0 357#if 0
356static void snd_sonicvibes_debug(struct sonicvibes * sonic) 358static void snd_sonicvibes_debug(struct sonicvibes * sonic)
357{ 359{
358 printk("SV REGS: INDEX = 0x%02x ", inb(SV_REG(sonic, INDEX))); 360 printk(KERN_DEBUG
361 "SV REGS: INDEX = 0x%02x ", inb(SV_REG(sonic, INDEX)));
359 printk(" STATUS = 0x%02x\n", inb(SV_REG(sonic, STATUS))); 362 printk(" STATUS = 0x%02x\n", inb(SV_REG(sonic, STATUS)));
360 printk(" 0x00: left input = 0x%02x ", snd_sonicvibes_in(sonic, 0x00)); 363 printk(KERN_DEBUG
364 " 0x00: left input = 0x%02x ", snd_sonicvibes_in(sonic, 0x00));
361 printk(" 0x20: synth rate low = 0x%02x\n", snd_sonicvibes_in(sonic, 0x20)); 365 printk(" 0x20: synth rate low = 0x%02x\n", snd_sonicvibes_in(sonic, 0x20));
362 printk(" 0x01: right input = 0x%02x ", snd_sonicvibes_in(sonic, 0x01)); 366 printk(KERN_DEBUG
367 " 0x01: right input = 0x%02x ", snd_sonicvibes_in(sonic, 0x01));
363 printk(" 0x21: synth rate high = 0x%02x\n", snd_sonicvibes_in(sonic, 0x21)); 368 printk(" 0x21: synth rate high = 0x%02x\n", snd_sonicvibes_in(sonic, 0x21));
364 printk(" 0x02: left AUX1 = 0x%02x ", snd_sonicvibes_in(sonic, 0x02)); 369 printk(KERN_DEBUG
370 " 0x02: left AUX1 = 0x%02x ", snd_sonicvibes_in(sonic, 0x02));
365 printk(" 0x22: ADC clock = 0x%02x\n", snd_sonicvibes_in(sonic, 0x22)); 371 printk(" 0x22: ADC clock = 0x%02x\n", snd_sonicvibes_in(sonic, 0x22));
366 printk(" 0x03: right AUX1 = 0x%02x ", snd_sonicvibes_in(sonic, 0x03)); 372 printk(KERN_DEBUG
373 " 0x03: right AUX1 = 0x%02x ", snd_sonicvibes_in(sonic, 0x03));
367 printk(" 0x23: ADC alt rate = 0x%02x\n", snd_sonicvibes_in(sonic, 0x23)); 374 printk(" 0x23: ADC alt rate = 0x%02x\n", snd_sonicvibes_in(sonic, 0x23));
368 printk(" 0x04: left CD = 0x%02x ", snd_sonicvibes_in(sonic, 0x04)); 375 printk(KERN_DEBUG
376 " 0x04: left CD = 0x%02x ", snd_sonicvibes_in(sonic, 0x04));
369 printk(" 0x24: ADC pll M = 0x%02x\n", snd_sonicvibes_in(sonic, 0x24)); 377 printk(" 0x24: ADC pll M = 0x%02x\n", snd_sonicvibes_in(sonic, 0x24));
370 printk(" 0x05: right CD = 0x%02x ", snd_sonicvibes_in(sonic, 0x05)); 378 printk(KERN_DEBUG
379 " 0x05: right CD = 0x%02x ", snd_sonicvibes_in(sonic, 0x05));
371 printk(" 0x25: ADC pll N = 0x%02x\n", snd_sonicvibes_in(sonic, 0x25)); 380 printk(" 0x25: ADC pll N = 0x%02x\n", snd_sonicvibes_in(sonic, 0x25));
372 printk(" 0x06: left line = 0x%02x ", snd_sonicvibes_in(sonic, 0x06)); 381 printk(KERN_DEBUG
382 " 0x06: left line = 0x%02x ", snd_sonicvibes_in(sonic, 0x06));
373 printk(" 0x26: Synth pll M = 0x%02x\n", snd_sonicvibes_in(sonic, 0x26)); 383 printk(" 0x26: Synth pll M = 0x%02x\n", snd_sonicvibes_in(sonic, 0x26));
374 printk(" 0x07: right line = 0x%02x ", snd_sonicvibes_in(sonic, 0x07)); 384 printk(KERN_DEBUG
385 " 0x07: right line = 0x%02x ", snd_sonicvibes_in(sonic, 0x07));
375 printk(" 0x27: Synth pll N = 0x%02x\n", snd_sonicvibes_in(sonic, 0x27)); 386 printk(" 0x27: Synth pll N = 0x%02x\n", snd_sonicvibes_in(sonic, 0x27));
376 printk(" 0x08: MIC = 0x%02x ", snd_sonicvibes_in(sonic, 0x08)); 387 printk(KERN_DEBUG
388 " 0x08: MIC = 0x%02x ", snd_sonicvibes_in(sonic, 0x08));
377 printk(" 0x28: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x28)); 389 printk(" 0x28: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x28));
378 printk(" 0x09: Game port = 0x%02x ", snd_sonicvibes_in(sonic, 0x09)); 390 printk(KERN_DEBUG
391 " 0x09: Game port = 0x%02x ", snd_sonicvibes_in(sonic, 0x09));
379 printk(" 0x29: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x29)); 392 printk(" 0x29: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x29));
380 printk(" 0x0a: left synth = 0x%02x ", snd_sonicvibes_in(sonic, 0x0a)); 393 printk(KERN_DEBUG
394 " 0x0a: left synth = 0x%02x ", snd_sonicvibes_in(sonic, 0x0a));
381 printk(" 0x2a: MPU401 = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2a)); 395 printk(" 0x2a: MPU401 = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2a));
382 printk(" 0x0b: right synth = 0x%02x ", snd_sonicvibes_in(sonic, 0x0b)); 396 printk(KERN_DEBUG
397 " 0x0b: right synth = 0x%02x ", snd_sonicvibes_in(sonic, 0x0b));
383 printk(" 0x2b: drive ctrl = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2b)); 398 printk(" 0x2b: drive ctrl = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2b));
384 printk(" 0x0c: left AUX2 = 0x%02x ", snd_sonicvibes_in(sonic, 0x0c)); 399 printk(KERN_DEBUG
400 " 0x0c: left AUX2 = 0x%02x ", snd_sonicvibes_in(sonic, 0x0c));
385 printk(" 0x2c: SRS space = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2c)); 401 printk(" 0x2c: SRS space = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2c));
386 printk(" 0x0d: right AUX2 = 0x%02x ", snd_sonicvibes_in(sonic, 0x0d)); 402 printk(KERN_DEBUG
403 " 0x0d: right AUX2 = 0x%02x ", snd_sonicvibes_in(sonic, 0x0d));
387 printk(" 0x2d: SRS center = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2d)); 404 printk(" 0x2d: SRS center = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2d));
388 printk(" 0x0e: left analog = 0x%02x ", snd_sonicvibes_in(sonic, 0x0e)); 405 printk(KERN_DEBUG
406 " 0x0e: left analog = 0x%02x ", snd_sonicvibes_in(sonic, 0x0e));
389 printk(" 0x2e: wave source = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2e)); 407 printk(" 0x2e: wave source = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2e));
390 printk(" 0x0f: right analog = 0x%02x ", snd_sonicvibes_in(sonic, 0x0f)); 408 printk(KERN_DEBUG
409 " 0x0f: right analog = 0x%02x ", snd_sonicvibes_in(sonic, 0x0f));
391 printk(" 0x2f: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2f)); 410 printk(" 0x2f: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2f));
392 printk(" 0x10: left PCM = 0x%02x ", snd_sonicvibes_in(sonic, 0x10)); 411 printk(KERN_DEBUG
412 " 0x10: left PCM = 0x%02x ", snd_sonicvibes_in(sonic, 0x10));
393 printk(" 0x30: analog power = 0x%02x\n", snd_sonicvibes_in(sonic, 0x30)); 413 printk(" 0x30: analog power = 0x%02x\n", snd_sonicvibes_in(sonic, 0x30));
394 printk(" 0x11: right PCM = 0x%02x ", snd_sonicvibes_in(sonic, 0x11)); 414 printk(KERN_DEBUG
415 " 0x11: right PCM = 0x%02x ", snd_sonicvibes_in(sonic, 0x11));
395 printk(" 0x31: analog power = 0x%02x\n", snd_sonicvibes_in(sonic, 0x31)); 416 printk(" 0x31: analog power = 0x%02x\n", snd_sonicvibes_in(sonic, 0x31));
396 printk(" 0x12: DMA data format = 0x%02x ", snd_sonicvibes_in(sonic, 0x12)); 417 printk(KERN_DEBUG
418 " 0x12: DMA data format = 0x%02x ", snd_sonicvibes_in(sonic, 0x12));
397 printk(" 0x32: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x32)); 419 printk(" 0x32: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x32));
398 printk(" 0x13: P/C enable = 0x%02x ", snd_sonicvibes_in(sonic, 0x13)); 420 printk(KERN_DEBUG
421 " 0x13: P/C enable = 0x%02x ", snd_sonicvibes_in(sonic, 0x13));
399 printk(" 0x33: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x33)); 422 printk(" 0x33: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x33));
400 printk(" 0x14: U/D button = 0x%02x ", snd_sonicvibes_in(sonic, 0x14)); 423 printk(KERN_DEBUG
424 " 0x14: U/D button = 0x%02x ", snd_sonicvibes_in(sonic, 0x14));
401 printk(" 0x34: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x34)); 425 printk(" 0x34: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x34));
402 printk(" 0x15: revision = 0x%02x ", snd_sonicvibes_in(sonic, 0x15)); 426 printk(KERN_DEBUG
427 " 0x15: revision = 0x%02x ", snd_sonicvibes_in(sonic, 0x15));
403 printk(" 0x35: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x35)); 428 printk(" 0x35: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x35));
404 printk(" 0x16: ADC output ctrl = 0x%02x ", snd_sonicvibes_in(sonic, 0x16)); 429 printk(KERN_DEBUG
430 " 0x16: ADC output ctrl = 0x%02x ", snd_sonicvibes_in(sonic, 0x16));
405 printk(" 0x36: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x36)); 431 printk(" 0x36: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x36));
406 printk(" 0x17: --- = 0x%02x ", snd_sonicvibes_in(sonic, 0x17)); 432 printk(KERN_DEBUG
433 " 0x17: --- = 0x%02x ", snd_sonicvibes_in(sonic, 0x17));
407 printk(" 0x37: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x37)); 434 printk(" 0x37: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x37));
408 printk(" 0x18: DMA A upper cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x18)); 435 printk(KERN_DEBUG
436 " 0x18: DMA A upper cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x18));
409 printk(" 0x38: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x38)); 437 printk(" 0x38: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x38));
410 printk(" 0x19: DMA A lower cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x19)); 438 printk(KERN_DEBUG
439 " 0x19: DMA A lower cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x19));
411 printk(" 0x39: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x39)); 440 printk(" 0x39: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x39));
412 printk(" 0x1a: --- = 0x%02x ", snd_sonicvibes_in(sonic, 0x1a)); 441 printk(KERN_DEBUG
442 " 0x1a: --- = 0x%02x ", snd_sonicvibes_in(sonic, 0x1a));
413 printk(" 0x3a: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3a)); 443 printk(" 0x3a: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3a));
414 printk(" 0x1b: --- = 0x%02x ", snd_sonicvibes_in(sonic, 0x1b)); 444 printk(KERN_DEBUG
445 " 0x1b: --- = 0x%02x ", snd_sonicvibes_in(sonic, 0x1b));
415 printk(" 0x3b: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3b)); 446 printk(" 0x3b: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3b));
416 printk(" 0x1c: DMA C upper cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x1c)); 447 printk(KERN_DEBUG
448 " 0x1c: DMA C upper cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x1c));
417 printk(" 0x3c: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3c)); 449 printk(" 0x3c: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3c));
418 printk(" 0x1d: DMA C upper cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x1d)); 450 printk(KERN_DEBUG
451 " 0x1d: DMA C upper cnt = 0x%02x ", snd_sonicvibes_in(sonic, 0x1d));
419 printk(" 0x3d: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3d)); 452 printk(" 0x3d: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3d));
420 printk(" 0x1e: PCM rate low = 0x%02x ", snd_sonicvibes_in(sonic, 0x1e)); 453 printk(KERN_DEBUG
454 " 0x1e: PCM rate low = 0x%02x ", snd_sonicvibes_in(sonic, 0x1e));
421 printk(" 0x3e: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3e)); 455 printk(" 0x3e: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3e));
422 printk(" 0x1f: PCM rate high = 0x%02x ", snd_sonicvibes_in(sonic, 0x1f)); 456 printk(KERN_DEBUG
457 " 0x1f: PCM rate high = 0x%02x ", snd_sonicvibes_in(sonic, 0x1f));
423 printk(" 0x3f: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3f)); 458 printk(" 0x3f: --- = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3f));
424} 459}
425 460
@@ -476,8 +511,8 @@ static void snd_sonicvibes_pll(unsigned int rate,
476 *res_m = m; 511 *res_m = m;
477 *res_n = n; 512 *res_n = n;
478#if 0 513#if 0
479 printk("metric = %i, xm = %i, xn = %i\n", metric, xm, xn); 514 printk(KERN_DEBUG "metric = %i, xm = %i, xn = %i\n", metric, xm, xn);
480 printk("pll: m = 0x%x, r = 0x%x, n = 0x%x\n", reg, m, r, n); 515 printk(KERN_DEBUG "pll: m = 0x%x, r = 0x%x, n = 0x%x\n", reg, m, r, n);
481#endif 516#endif
482} 517}
483 518
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index c612b435ca2b..a9da9c184660 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -68,40 +68,40 @@ static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
68{ 68{
69 unsigned int val, tmp; 69 unsigned int val, tmp;
70 70
71 printk("Trident voice %i:\n", voice); 71 printk(KERN_DEBUG "Trident voice %i:\n", voice);
72 outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR)); 72 outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR));
73 val = inl(TRID_REG(trident, CH_LBA)); 73 val = inl(TRID_REG(trident, CH_LBA));
74 printk("LBA: 0x%x\n", val); 74 printk(KERN_DEBUG "LBA: 0x%x\n", val);
75 val = inl(TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); 75 val = inl(TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
76 printk("GVSel: %i\n", val >> 31); 76 printk(KERN_DEBUG "GVSel: %i\n", val >> 31);
77 printk("Pan: 0x%x\n", (val >> 24) & 0x7f); 77 printk(KERN_DEBUG "Pan: 0x%x\n", (val >> 24) & 0x7f);
78 printk("Vol: 0x%x\n", (val >> 16) & 0xff); 78 printk(KERN_DEBUG "Vol: 0x%x\n", (val >> 16) & 0xff);
79 printk("CTRL: 0x%x\n", (val >> 12) & 0x0f); 79 printk(KERN_DEBUG "CTRL: 0x%x\n", (val >> 12) & 0x0f);
80 printk("EC: 0x%x\n", val & 0x0fff); 80 printk(KERN_DEBUG "EC: 0x%x\n", val & 0x0fff);
81 if (trident->device != TRIDENT_DEVICE_ID_NX) { 81 if (trident->device != TRIDENT_DEVICE_ID_NX) {
82 val = inl(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS)); 82 val = inl(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS));
83 printk("CSO: 0x%x\n", val >> 16); 83 printk(KERN_DEBUG "CSO: 0x%x\n", val >> 16);
84 printk("Alpha: 0x%x\n", (val >> 4) & 0x0fff); 84 printk("Alpha: 0x%x\n", (val >> 4) & 0x0fff);
85 printk("FMS: 0x%x\n", val & 0x0f); 85 printk(KERN_DEBUG "FMS: 0x%x\n", val & 0x0f);
86 val = inl(TRID_REG(trident, CH_DX_ESO_DELTA)); 86 val = inl(TRID_REG(trident, CH_DX_ESO_DELTA));
87 printk("ESO: 0x%x\n", val >> 16); 87 printk(KERN_DEBUG "ESO: 0x%x\n", val >> 16);
88 printk("Delta: 0x%x\n", val & 0xffff); 88 printk(KERN_DEBUG "Delta: 0x%x\n", val & 0xffff);
89 val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL)); 89 val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL));
90 } else { // TRIDENT_DEVICE_ID_NX 90 } else { // TRIDENT_DEVICE_ID_NX
91 val = inl(TRID_REG(trident, CH_NX_DELTA_CSO)); 91 val = inl(TRID_REG(trident, CH_NX_DELTA_CSO));
92 tmp = (val >> 24) & 0xff; 92 tmp = (val >> 24) & 0xff;
93 printk("CSO: 0x%x\n", val & 0x00ffffff); 93 printk(KERN_DEBUG "CSO: 0x%x\n", val & 0x00ffffff);
94 val = inl(TRID_REG(trident, CH_NX_DELTA_ESO)); 94 val = inl(TRID_REG(trident, CH_NX_DELTA_ESO));
95 tmp |= (val >> 16) & 0xff00; 95 tmp |= (val >> 16) & 0xff00;
96 printk("Delta: 0x%x\n", tmp); 96 printk(KERN_DEBUG "Delta: 0x%x\n", tmp);
97 printk("ESO: 0x%x\n", val & 0x00ffffff); 97 printk(KERN_DEBUG "ESO: 0x%x\n", val & 0x00ffffff);
98 val = inl(TRID_REG(trident, CH_NX_ALPHA_FMS_FMC_RVOL_CVOL)); 98 val = inl(TRID_REG(trident, CH_NX_ALPHA_FMS_FMC_RVOL_CVOL));
99 printk("Alpha: 0x%x\n", val >> 20); 99 printk(KERN_DEBUG "Alpha: 0x%x\n", val >> 20);
100 printk("FMS: 0x%x\n", (val >> 16) & 0x0f); 100 printk(KERN_DEBUG "FMS: 0x%x\n", (val >> 16) & 0x0f);
101 } 101 }
102 printk("FMC: 0x%x\n", (val >> 14) & 3); 102 printk(KERN_DEBUG "FMC: 0x%x\n", (val >> 14) & 3);
103 printk("RVol: 0x%x\n", (val >> 7) & 0x7f); 103 printk(KERN_DEBUG "RVol: 0x%x\n", (val >> 7) & 0x7f);
104 printk("CVol: 0x%x\n", val & 0x7f); 104 printk(KERN_DEBUG "CVol: 0x%x\n", val & 0x7f);
105} 105}
106#endif 106#endif
107 107
@@ -496,12 +496,17 @@ void snd_trident_write_voice_regs(struct snd_trident * trident,
496 outl(regs[4], TRID_REG(trident, CH_START + 16)); 496 outl(regs[4], TRID_REG(trident, CH_START + 16));
497 497
498#if 0 498#if 0
499 printk("written %i channel:\n", voice->number); 499 printk(KERN_DEBUG "written %i channel:\n", voice->number);
500 printk(" regs[0] = 0x%x/0x%x\n", regs[0], inl(TRID_REG(trident, CH_START + 0))); 500 printk(KERN_DEBUG " regs[0] = 0x%x/0x%x\n",
501 printk(" regs[1] = 0x%x/0x%x\n", regs[1], inl(TRID_REG(trident, CH_START + 4))); 501 regs[0], inl(TRID_REG(trident, CH_START + 0)));
502 printk(" regs[2] = 0x%x/0x%x\n", regs[2], inl(TRID_REG(trident, CH_START + 8))); 502 printk(KERN_DEBUG " regs[1] = 0x%x/0x%x\n",
503 printk(" regs[3] = 0x%x/0x%x\n", regs[3], inl(TRID_REG(trident, CH_START + 12))); 503 regs[1], inl(TRID_REG(trident, CH_START + 4)));
504 printk(" regs[4] = 0x%x/0x%x\n", regs[4], inl(TRID_REG(trident, CH_START + 16))); 504 printk(KERN_DEBUG " regs[2] = 0x%x/0x%x\n",
505 regs[2], inl(TRID_REG(trident, CH_START + 8)));
506 printk(KERN_DEBUG " regs[3] = 0x%x/0x%x\n",
507 regs[3], inl(TRID_REG(trident, CH_START + 12)));
508 printk(KERN_DEBUG " regs[4] = 0x%x/0x%x\n",
509 regs[4], inl(TRID_REG(trident, CH_START + 16)));
505#endif 510#endif
506} 511}
507 512
@@ -583,7 +588,7 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident,
583 outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2)); 588 outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2));
584 break; 589 break;
585 case TRIDENT_DEVICE_ID_SI7018: 590 case TRIDENT_DEVICE_ID_SI7018:
586 // printk("voice->Vol = 0x%x\n", voice->Vol); 591 /* printk(KERN_DEBUG "voice->Vol = 0x%x\n", voice->Vol); */
587 outw((voice->CTRL << 12) | voice->Vol, 592 outw((voice->CTRL << 12) | voice->Vol,
588 TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); 593 TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
589 break; 594 break;
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index d8705547dae1..8dbffe6a4af2 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -466,7 +466,10 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
466 flag = VIA_TBL_BIT_FLAG; /* period boundary */ 466 flag = VIA_TBL_BIT_FLAG; /* period boundary */
467 } else 467 } else
468 flag = 0; /* period continues to the next */ 468 flag = 0; /* period continues to the next */
469 // printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest); 469 /*
470 printk(KERN_DEBUG "via: tbl %d: at %d size %d "
471 "(rest %d)\n", idx, ofs, r, rest);
472 */
470 ((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag); 473 ((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
471 dev->idx_table[idx].offset = ofs; 474 dev->idx_table[idx].offset = ofs;
472 dev->idx_table[idx].size = r; 475 dev->idx_table[idx].size = r;
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index c086b762c150..0d54e3503c1e 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -328,7 +328,10 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
328 flag = VIA_TBL_BIT_FLAG; /* period boundary */ 328 flag = VIA_TBL_BIT_FLAG; /* period boundary */
329 } else 329 } else
330 flag = 0; /* period continues to the next */ 330 flag = 0; /* period continues to the next */
331 // printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest); 331 /*
332 printk(KERN_DEBUG "via: tbl %d: at %d size %d "
333 "(rest %d)\n", idx, ofs, r, rest);
334 */
332 ((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag); 335 ((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
333 dev->idx_table[idx].offset = ofs; 336 dev->idx_table[idx].offset = ofs;
334 dev->idx_table[idx].size = r; 337 dev->idx_table[idx].size = r;
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index 7e87f398ff0b..c0efe4491116 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -107,7 +107,9 @@ static unsigned char vx2_inb(struct vx_core *chip, int offset)
107static void vx2_outb(struct vx_core *chip, int offset, unsigned char val) 107static void vx2_outb(struct vx_core *chip, int offset, unsigned char val)
108{ 108{
109 outb(val, vx2_reg_addr(chip, offset)); 109 outb(val, vx2_reg_addr(chip, offset));
110 //printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset)); 110 /*
111 printk(KERN_DEBUG "outb: %x -> %x\n", val, vx2_reg_addr(chip, offset));
112 */
111} 113}
112 114
113/** 115/**
@@ -126,7 +128,9 @@ static unsigned int vx2_inl(struct vx_core *chip, int offset)
126 */ 128 */
127static void vx2_outl(struct vx_core *chip, int offset, unsigned int val) 129static void vx2_outl(struct vx_core *chip, int offset, unsigned int val)
128{ 130{
129 // printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset)); 131 /*
132 printk(KERN_DEBUG "outl: %x -> %x\n", val, vx2_reg_addr(chip, offset));
133 */
130 outl(val, vx2_reg_addr(chip, offset)); 134 outl(val, vx2_reg_addr(chip, offset));
131} 135}
132 136
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 90d0d62bd0b4..2f0925236a1b 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -318,7 +318,12 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
318 ypcm->period_pos += delta; 318 ypcm->period_pos += delta;
319 ypcm->last_pos = pos; 319 ypcm->last_pos = pos;
320 if (ypcm->period_pos >= ypcm->period_size) { 320 if (ypcm->period_pos >= ypcm->period_size) {
321 // printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start); 321 /*
322 printk(KERN_DEBUG
323 "done - active_bank = 0x%x, start = 0x%x\n",
324 chip->active_bank,
325 voice->bank[chip->active_bank].start);
326 */
322 ypcm->period_pos %= ypcm->period_size; 327 ypcm->period_pos %= ypcm->period_size;
323 spin_unlock(&chip->reg_lock); 328 spin_unlock(&chip->reg_lock);
324 snd_pcm_period_elapsed(ypcm->substream); 329 snd_pcm_period_elapsed(ypcm->substream);
@@ -366,7 +371,12 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream
366 ypcm->last_pos = pos; 371 ypcm->last_pos = pos;
367 if (ypcm->period_pos >= ypcm->period_size) { 372 if (ypcm->period_pos >= ypcm->period_size) {
368 ypcm->period_pos %= ypcm->period_size; 373 ypcm->period_pos %= ypcm->period_size;
369 // printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start); 374 /*
375 printk(KERN_DEBUG
376 "done - active_bank = 0x%x, start = 0x%x\n",
377 chip->active_bank,
378 voice->bank[chip->active_bank].start);
379 */
370 spin_unlock(&chip->reg_lock); 380 spin_unlock(&chip->reg_lock);
371 snd_pcm_period_elapsed(substream); 381 snd_pcm_period_elapsed(substream);
372 spin_lock(&chip->reg_lock); 382 spin_lock(&chip->reg_lock);
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c
index dfa40b0ed86d..5d2afa0b0ce4 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c
@@ -82,14 +82,21 @@ static void pdacf_ak4117_write(void *private_data, unsigned char reg, unsigned c
82#if 0 82#if 0
83void pdacf_dump(struct snd_pdacf *chip) 83void pdacf_dump(struct snd_pdacf *chip)
84{ 84{
85 printk("PDAUDIOCF DUMP (0x%lx):\n", chip->port); 85 printk(KERN_DEBUG "PDAUDIOCF DUMP (0x%lx):\n", chip->port);
86 printk("WPD : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_WDP)); 86 printk(KERN_DEBUG "WPD : 0x%x\n",
87 printk("RDP : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_RDP)); 87 inw(chip->port + PDAUDIOCF_REG_WDP));
88 printk("TCR : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_TCR)); 88 printk(KERN_DEBUG "RDP : 0x%x\n",
89 printk("SCR : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_SCR)); 89 inw(chip->port + PDAUDIOCF_REG_RDP));
90 printk("ISR : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_ISR)); 90 printk(KERN_DEBUG "TCR : 0x%x\n",
91 printk("IER : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_IER)); 91 inw(chip->port + PDAUDIOCF_REG_TCR));
92 printk("AK_IFR : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_AK_IFR)); 92 printk(KERN_DEBUG "SCR : 0x%x\n",
93 inw(chip->port + PDAUDIOCF_REG_SCR));
94 printk(KERN_DEBUG "ISR : 0x%x\n",
95 inw(chip->port + PDAUDIOCF_REG_ISR));
96 printk(KERN_DEBUG "IER : 0x%x\n",
97 inw(chip->port + PDAUDIOCF_REG_IER));
98 printk(KERN_DEBUG "AK_IFR : 0x%x\n",
99 inw(chip->port + PDAUDIOCF_REG_AK_IFR));
93} 100}
94#endif 101#endif
95 102
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
index ea903c8e90dd..dcd32201bc8c 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
@@ -269,7 +269,7 @@ void pdacf_tasklet(unsigned long private_data)
269 269
270 rdp = inw(chip->port + PDAUDIOCF_REG_RDP); 270 rdp = inw(chip->port + PDAUDIOCF_REG_RDP);
271 wdp = inw(chip->port + PDAUDIOCF_REG_WDP); 271 wdp = inw(chip->port + PDAUDIOCF_REG_WDP);
272 // printk("TASKLET: rdp = %x, wdp = %x\n", rdp, wdp); 272 /* printk(KERN_DEBUG "TASKLET: rdp = %x, wdp = %x\n", rdp, wdp); */
273 size = wdp - rdp; 273 size = wdp - rdp;
274 if (size < 0) 274 if (size < 0)
275 size += 0x10000; 275 size += 0x10000;
@@ -321,5 +321,5 @@ void pdacf_tasklet(unsigned long private_data)
321 spin_lock(&chip->reg_lock); 321 spin_lock(&chip->reg_lock);
322 } 322 }
323 spin_unlock(&chip->reg_lock); 323 spin_unlock(&chip->reg_lock);
324 // printk("TASKLET: end\n"); 324 /* printk(KERN_DEBUG "TASKLET: end\n"); */
325} 325}
diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index ef2c3f417175..f361c26506aa 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -477,7 +477,7 @@ static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream)
477 card->dma_start_bus_addr[SND_PS3_CH_R] = 477 card->dma_start_bus_addr[SND_PS3_CH_R] =
478 runtime->dma_addr + (runtime->dma_bytes / 2); 478 runtime->dma_addr + (runtime->dma_bytes / 2);
479 479
480 pr_debug("%s: vaddr=%p bus=%#lx\n", __func__, 480 pr_debug("%s: vaddr=%p bus=%#llx\n", __func__,
481 card->dma_start_vaddr[SND_PS3_CH_L], 481 card->dma_start_vaddr[SND_PS3_CH_L],
482 card->dma_start_bus_addr[SND_PS3_CH_L]); 482 card->dma_start_bus_addr[SND_PS3_CH_L]);
483 483
@@ -1028,7 +1028,7 @@ static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
1028 pr_info("%s: nullbuffer alloc failed\n", __func__); 1028 pr_info("%s: nullbuffer alloc failed\n", __func__);
1029 goto clean_preallocate; 1029 goto clean_preallocate;
1030 } 1030 }
1031 pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__, 1031 pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__,
1032 the_card.null_buffer_start_vaddr, 1032 the_card.null_buffer_start_vaddr,
1033 the_card.null_buffer_start_dma_addr); 1033 the_card.null_buffer_start_dma_addr);
1034 /* set default sample rate/word width */ 1034 /* set default sample rate/word width */
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index fd0f338374a7..ea370a4f86d5 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -197,7 +197,7 @@ static const char *twl4030_earpiece_texts[] =
197static const unsigned int twl4030_earpiece_values[] = 197static const unsigned int twl4030_earpiece_values[] =
198 {0x0, 0x1, 0x2, 0x4}; 198 {0x0, 0x1, 0x2, 0x4};
199 199
200static const struct soc_value_enum twl4030_earpiece_enum = 200static const struct soc_enum twl4030_earpiece_enum =
201 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 1, 0x7, 201 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 1, 0x7,
202 ARRAY_SIZE(twl4030_earpiece_texts), 202 ARRAY_SIZE(twl4030_earpiece_texts),
203 twl4030_earpiece_texts, 203 twl4030_earpiece_texts,
@@ -213,7 +213,7 @@ static const char *twl4030_predrivel_texts[] =
213static const unsigned int twl4030_predrivel_values[] = 213static const unsigned int twl4030_predrivel_values[] =
214 {0x0, 0x1, 0x2, 0x4}; 214 {0x0, 0x1, 0x2, 0x4};
215 215
216static const struct soc_value_enum twl4030_predrivel_enum = 216static const struct soc_enum twl4030_predrivel_enum =
217 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 1, 0x7, 217 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 1, 0x7,
218 ARRAY_SIZE(twl4030_predrivel_texts), 218 ARRAY_SIZE(twl4030_predrivel_texts),
219 twl4030_predrivel_texts, 219 twl4030_predrivel_texts,
@@ -229,7 +229,7 @@ static const char *twl4030_predriver_texts[] =
229static const unsigned int twl4030_predriver_values[] = 229static const unsigned int twl4030_predriver_values[] =
230 {0x0, 0x1, 0x2, 0x4}; 230 {0x0, 0x1, 0x2, 0x4};
231 231
232static const struct soc_value_enum twl4030_predriver_enum = 232static const struct soc_enum twl4030_predriver_enum =
233 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 1, 0x7, 233 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 1, 0x7,
234 ARRAY_SIZE(twl4030_predriver_texts), 234 ARRAY_SIZE(twl4030_predriver_texts),
235 twl4030_predriver_texts, 235 twl4030_predriver_texts,
@@ -317,7 +317,7 @@ static const char *twl4030_analoglmic_texts[] =
317static const unsigned int twl4030_analoglmic_values[] = 317static const unsigned int twl4030_analoglmic_values[] =
318 {0x0, 0x1, 0x2, 0x4, 0x8}; 318 {0x0, 0x1, 0x2, 0x4, 0x8};
319 319
320static const struct soc_value_enum twl4030_analoglmic_enum = 320static const struct soc_enum twl4030_analoglmic_enum =
321 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICL, 0, 0xf, 321 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICL, 0, 0xf,
322 ARRAY_SIZE(twl4030_analoglmic_texts), 322 ARRAY_SIZE(twl4030_analoglmic_texts),
323 twl4030_analoglmic_texts, 323 twl4030_analoglmic_texts,
@@ -333,7 +333,7 @@ static const char *twl4030_analogrmic_texts[] =
333static const unsigned int twl4030_analogrmic_values[] = 333static const unsigned int twl4030_analogrmic_values[] =
334 {0x0, 0x1, 0x4}; 334 {0x0, 0x1, 0x4};
335 335
336static const struct soc_value_enum twl4030_analogrmic_enum = 336static const struct soc_enum twl4030_analogrmic_enum =
337 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICR, 0, 0x5, 337 SOC_VALUE_ENUM_SINGLE(TWL4030_REG_ANAMICR, 0, 0x5,
338 ARRAY_SIZE(twl4030_analogrmic_texts), 338 ARRAY_SIZE(twl4030_analogrmic_texts),
339 twl4030_analogrmic_texts, 339 twl4030_analogrmic_texts,
@@ -1280,6 +1280,8 @@ static int twl4030_remove(struct platform_device *pdev)
1280 struct snd_soc_codec *codec = socdev->codec; 1280 struct snd_soc_codec *codec = socdev->codec;
1281 1281
1282 printk(KERN_INFO "TWL4030 Audio Codec remove\n"); 1282 printk(KERN_INFO "TWL4030 Audio Codec remove\n");
1283 snd_soc_free_pcms(socdev);
1284 snd_soc_dapm_free(socdev);
1283 kfree(codec); 1285 kfree(codec);
1284 1286
1285 return 0; 1287 return 0;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 318dfdd54d7f..8592d95023ed 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1585,37 +1585,6 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
1585EXPORT_SYMBOL_GPL(snd_soc_put_enum_double); 1585EXPORT_SYMBOL_GPL(snd_soc_put_enum_double);
1586 1586
1587/** 1587/**
1588 * snd_soc_info_value_enum_double - semi enumerated double mixer info callback
1589 * @kcontrol: mixer control
1590 * @uinfo: control element information
1591 *
1592 * Callback to provide information about a double semi enumerated
1593 * mixer control.
1594 *
1595 * Semi enumerated mixer: the enumerated items are referred as values. Can be
1596 * used for handling bitfield coded enumeration for example.
1597 *
1598 * Returns 0 for success.
1599 */
1600int snd_soc_info_value_enum_double(struct snd_kcontrol *kcontrol,
1601 struct snd_ctl_elem_info *uinfo)
1602{
1603 struct soc_value_enum *e = (struct soc_value_enum *)
1604 kcontrol->private_value;
1605
1606 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1607 uinfo->count = e->shift_l == e->shift_r ? 1 : 2;
1608 uinfo->value.enumerated.items = e->max;
1609
1610 if (uinfo->value.enumerated.item > e->max - 1)
1611 uinfo->value.enumerated.item = e->max - 1;
1612 strcpy(uinfo->value.enumerated.name,
1613 e->texts[uinfo->value.enumerated.item]);
1614 return 0;
1615}
1616EXPORT_SYMBOL_GPL(snd_soc_info_value_enum_double);
1617
1618/**
1619 * snd_soc_get_value_enum_double - semi enumerated double mixer get callback 1588 * snd_soc_get_value_enum_double - semi enumerated double mixer get callback
1620 * @kcontrol: mixer control 1589 * @kcontrol: mixer control
1621 * @ucontrol: control element information 1590 * @ucontrol: control element information
@@ -1631,8 +1600,7 @@ int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
1631 struct snd_ctl_elem_value *ucontrol) 1600 struct snd_ctl_elem_value *ucontrol)
1632{ 1601{
1633 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1602 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
1634 struct soc_value_enum *e = (struct soc_value_enum *) 1603 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1635 kcontrol->private_value;
1636 unsigned short reg_val, val, mux; 1604 unsigned short reg_val, val, mux;
1637 1605
1638 reg_val = snd_soc_read(codec, e->reg); 1606 reg_val = snd_soc_read(codec, e->reg);
@@ -1671,8 +1639,7 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
1671 struct snd_ctl_elem_value *ucontrol) 1639 struct snd_ctl_elem_value *ucontrol)
1672{ 1640{
1673 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 1641 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
1674 struct soc_value_enum *e = (struct soc_value_enum *) 1642 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1675 kcontrol->private_value;
1676 unsigned short val; 1643 unsigned short val;
1677 unsigned short mask; 1644 unsigned short mask;
1678 1645
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index ad0d801677c1..a2f1da8b4646 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -137,7 +137,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
137 } 137 }
138 break; 138 break;
139 case snd_soc_dapm_value_mux: { 139 case snd_soc_dapm_value_mux: {
140 struct soc_value_enum *e = (struct soc_value_enum *) 140 struct soc_enum *e = (struct soc_enum *)
141 w->kcontrols[i].private_value; 141 w->kcontrols[i].private_value;
142 int val, item; 142 int val, item;
143 143
@@ -200,30 +200,6 @@ static int dapm_connect_mux(struct snd_soc_codec *codec,
200 return -ENODEV; 200 return -ENODEV;
201} 201}
202 202
203/* connect value_mux widget to it's interconnecting audio paths */
204static int dapm_connect_value_mux(struct snd_soc_codec *codec,
205 struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
206 struct snd_soc_dapm_path *path, const char *control_name,
207 const struct snd_kcontrol_new *kcontrol)
208{
209 struct soc_value_enum *e = (struct soc_value_enum *)
210 kcontrol->private_value;
211 int i;
212
213 for (i = 0; i < e->max; i++) {
214 if (!(strcmp(control_name, e->texts[i]))) {
215 list_add(&path->list, &codec->dapm_paths);
216 list_add(&path->list_sink, &dest->sources);
217 list_add(&path->list_source, &src->sinks);
218 path->name = (char *)e->texts[i];
219 dapm_set_path_status(dest, path, 0);
220 return 0;
221 }
222 }
223
224 return -ENODEV;
225}
226
227/* connect mixer widget to it's interconnecting audio paths */ 203/* connect mixer widget to it's interconnecting audio paths */
228static int dapm_connect_mixer(struct snd_soc_codec *codec, 204static int dapm_connect_mixer(struct snd_soc_codec *codec,
229 struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest, 205 struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
@@ -744,7 +720,8 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
744 struct snd_soc_dapm_path *path; 720 struct snd_soc_dapm_path *path;
745 int found = 0; 721 int found = 0;
746 722
747 if (widget->id != snd_soc_dapm_mux) 723 if (widget->id != snd_soc_dapm_mux &&
724 widget->id != snd_soc_dapm_value_mux)
748 return -ENODEV; 725 return -ENODEV;
749 726
750 if (!snd_soc_test_bits(widget->codec, e->reg, mask, val)) 727 if (!snd_soc_test_bits(widget->codec, e->reg, mask, val))
@@ -774,45 +751,6 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
774 return 0; 751 return 0;
775} 752}
776 753
777/* test and update the power status of a value_mux widget */
778static int dapm_value_mux_update_power(struct snd_soc_dapm_widget *widget,
779 struct snd_kcontrol *kcontrol, int mask,
780 int mux, int val, struct soc_value_enum *e)
781{
782 struct snd_soc_dapm_path *path;
783 int found = 0;
784
785 if (widget->id != snd_soc_dapm_value_mux)
786 return -ENODEV;
787
788 if (!snd_soc_test_bits(widget->codec, e->reg, mask, val))
789 return 0;
790
791 /* find dapm widget path assoc with kcontrol */
792 list_for_each_entry(path, &widget->codec->dapm_paths, list) {
793 if (path->kcontrol != kcontrol)
794 continue;
795
796 if (!path->name || !e->texts[mux])
797 continue;
798
799 found = 1;
800 /* we now need to match the string in the enum to the path */
801 if (!(strcmp(path->name, e->texts[mux])))
802 path->connect = 1; /* new connection */
803 else
804 path->connect = 0; /* old connection must be
805 powered down */
806 }
807
808 if (found) {
809 dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP);
810 dump_dapm(widget->codec, "mux power update");
811 }
812
813 return 0;
814}
815
816/* test and update the power status of a mixer or switch widget */ 754/* test and update the power status of a mixer or switch widget */
817static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, 755static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
818 struct snd_kcontrol *kcontrol, int reg, 756 struct snd_kcontrol *kcontrol, int reg,
@@ -1045,17 +983,12 @@ static int snd_soc_dapm_add_route(struct snd_soc_codec *codec,
1045 path->connect = 1; 983 path->connect = 1;
1046 return 0; 984 return 0;
1047 case snd_soc_dapm_mux: 985 case snd_soc_dapm_mux:
986 case snd_soc_dapm_value_mux:
1048 ret = dapm_connect_mux(codec, wsource, wsink, path, control, 987 ret = dapm_connect_mux(codec, wsource, wsink, path, control,
1049 &wsink->kcontrols[0]); 988 &wsink->kcontrols[0]);
1050 if (ret != 0) 989 if (ret != 0)
1051 goto err; 990 goto err;
1052 break; 991 break;
1053 case snd_soc_dapm_value_mux:
1054 ret = dapm_connect_value_mux(codec, wsource, wsink, path,
1055 control, &wsink->kcontrols[0]);
1056 if (ret != 0)
1057 goto err;
1058 break;
1059 case snd_soc_dapm_switch: 992 case snd_soc_dapm_switch:
1060 case snd_soc_dapm_mixer: 993 case snd_soc_dapm_mixer:
1061 ret = dapm_connect_mixer(codec, wsource, wsink, path, control); 994 ret = dapm_connect_mixer(codec, wsource, wsink, path, control);
@@ -1382,8 +1315,7 @@ int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
1382 struct snd_ctl_elem_value *ucontrol) 1315 struct snd_ctl_elem_value *ucontrol)
1383{ 1316{
1384 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 1317 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1385 struct soc_value_enum *e = (struct soc_value_enum *) 1318 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1386 kcontrol->private_value;
1387 unsigned short reg_val, val, mux; 1319 unsigned short reg_val, val, mux;
1388 1320
1389 reg_val = snd_soc_read(widget->codec, e->reg); 1321 reg_val = snd_soc_read(widget->codec, e->reg);
@@ -1423,8 +1355,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
1423 struct snd_ctl_elem_value *ucontrol) 1355 struct snd_ctl_elem_value *ucontrol)
1424{ 1356{
1425 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); 1357 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1426 struct soc_value_enum *e = (struct soc_value_enum *) 1358 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1427 kcontrol->private_value;
1428 unsigned short val, mux; 1359 unsigned short val, mux;
1429 unsigned short mask; 1360 unsigned short mask;
1430 int ret = 0; 1361 int ret = 0;
@@ -1443,7 +1374,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
1443 1374
1444 mutex_lock(&widget->codec->mutex); 1375 mutex_lock(&widget->codec->mutex);
1445 widget->value = val; 1376 widget->value = val;
1446 dapm_value_mux_update_power(widget, kcontrol, mask, mux, val, e); 1377 dapm_mux_update_power(widget, kcontrol, mask, mux, val, e);
1447 if (widget->event) { 1378 if (widget->event) {
1448 if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { 1379 if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
1449 ret = widget->event(widget, 1380 ret = widget->event(widget,
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index ba38912614b4..574af56ba8a6 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -954,7 +954,8 @@ static int __devinit snd_amd7930_create(struct snd_card *card,
954 amd->regs = of_ioremap(&op->resource[0], 0, 954 amd->regs = of_ioremap(&op->resource[0], 0,
955 resource_size(&op->resource[0]), "amd7930"); 955 resource_size(&op->resource[0]), "amd7930");
956 if (!amd->regs) { 956 if (!amd->regs) {
957 snd_printk("amd7930-%d: Unable to map chip registers.\n", dev); 957 snd_printk(KERN_ERR
958 "amd7930-%d: Unable to map chip registers.\n", dev);
958 return -EIO; 959 return -EIO;
959 } 960 }
960 961
@@ -962,7 +963,7 @@ static int __devinit snd_amd7930_create(struct snd_card *card,
962 963
963 if (request_irq(irq, snd_amd7930_interrupt, 964 if (request_irq(irq, snd_amd7930_interrupt,
964 IRQF_DISABLED | IRQF_SHARED, "amd7930", amd)) { 965 IRQF_DISABLED | IRQF_SHARED, "amd7930", amd)) {
965 snd_printk("amd7930-%d: Unable to grab IRQ %d\n", 966 snd_printk(KERN_ERR "amd7930-%d: Unable to grab IRQ %d\n",
966 dev, irq); 967 dev, irq);
967 snd_amd7930_free(amd); 968 snd_amd7930_free(amd);
968 return -EBUSY; 969 return -EBUSY;
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index 5c47b6c09264..87e42206c4ef 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -132,7 +132,7 @@ snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
132 p = snd_emux_create_port(emu, tmpname, 32, 132 p = snd_emux_create_port(emu, tmpname, 32,
133 1, &callback); 133 1, &callback);
134 if (p == NULL) { 134 if (p == NULL) {
135 snd_printk("can't create port\n"); 135 snd_printk(KERN_ERR "can't create port\n");
136 snd_emux_dec_count(emu); 136 snd_emux_dec_count(emu);
137 mutex_unlock(&emu->register_mutex); 137 mutex_unlock(&emu->register_mutex);
138 return -ENOMEM; 138 return -ENOMEM;
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 335aa2ce2574..ca5f7effb4df 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -74,15 +74,15 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
74 emu->client = snd_seq_create_kernel_client(card, index, 74 emu->client = snd_seq_create_kernel_client(card, index,
75 "%s WaveTable", emu->name); 75 "%s WaveTable", emu->name);
76 if (emu->client < 0) { 76 if (emu->client < 0) {
77 snd_printk("can't create client\n"); 77 snd_printk(KERN_ERR "can't create client\n");
78 return -ENODEV; 78 return -ENODEV;
79 } 79 }
80 80
81 if (emu->num_ports < 0) { 81 if (emu->num_ports < 0) {
82 snd_printk("seqports must be greater than zero\n"); 82 snd_printk(KERN_WARNING "seqports must be greater than zero\n");
83 emu->num_ports = 1; 83 emu->num_ports = 1;
84 } else if (emu->num_ports >= SNDRV_EMUX_MAX_PORTS) { 84 } else if (emu->num_ports >= SNDRV_EMUX_MAX_PORTS) {
85 snd_printk("too many ports." 85 snd_printk(KERN_WARNING "too many ports."
86 "limited max. ports %d\n", SNDRV_EMUX_MAX_PORTS); 86 "limited max. ports %d\n", SNDRV_EMUX_MAX_PORTS);
87 emu->num_ports = SNDRV_EMUX_MAX_PORTS; 87 emu->num_ports = SNDRV_EMUX_MAX_PORTS;
88 } 88 }
@@ -100,7 +100,7 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
100 p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, 100 p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS,
101 0, &pinfo); 101 0, &pinfo);
102 if (p == NULL) { 102 if (p == NULL) {
103 snd_printk("can't create port\n"); 103 snd_printk(KERN_ERR "can't create port\n");
104 return -ENOMEM; 104 return -ENOMEM;
105 } 105 }
106 106
@@ -147,12 +147,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
147 147
148 /* Allocate structures for this channel */ 148 /* Allocate structures for this channel */
149 if ((p = kzalloc(sizeof(*p), GFP_KERNEL)) == NULL) { 149 if ((p = kzalloc(sizeof(*p), GFP_KERNEL)) == NULL) {
150 snd_printk("no memory\n"); 150 snd_printk(KERN_ERR "no memory\n");
151 return NULL; 151 return NULL;
152 } 152 }
153 p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL); 153 p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL);
154 if (p->chset.channels == NULL) { 154 if (p->chset.channels == NULL) {
155 snd_printk("no memory\n"); 155 snd_printk(KERN_ERR "no memory\n");
156 kfree(p); 156 kfree(p);
157 return NULL; 157 return NULL;
158 } 158 }
@@ -376,12 +376,12 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)
376 goto __error; 376 goto __error;
377 } 377 }
378 emu->vmidi[i] = rmidi; 378 emu->vmidi[i] = rmidi;
379 //snd_printk("virmidi %d ok\n", i); 379 /* snd_printk(KERN_DEBUG "virmidi %d ok\n", i); */
380 } 380 }
381 return 0; 381 return 0;
382 382
383__error: 383__error:
384 //snd_printk("error init..\n"); 384 /* snd_printk(KERN_DEBUG "error init..\n"); */
385 snd_emux_delete_virmidi(emu); 385 snd_emux_delete_virmidi(emu);
386 return -ENOMEM; 386 return -ENOMEM;
387} 387}
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c
index 2cc6f6f79065..3e921b386fd5 100644
--- a/sound/synth/emux/emux_synth.c
+++ b/sound/synth/emux/emux_synth.c
@@ -956,7 +956,8 @@ void snd_emux_lock_voice(struct snd_emux *emu, int voice)
956 if (emu->voices[voice].state == SNDRV_EMUX_ST_OFF) 956 if (emu->voices[voice].state == SNDRV_EMUX_ST_OFF)
957 emu->voices[voice].state = SNDRV_EMUX_ST_LOCKED; 957 emu->voices[voice].state = SNDRV_EMUX_ST_LOCKED;
958 else 958 else
959 snd_printk("invalid voice for lock %d (state = %x)\n", 959 snd_printk(KERN_WARNING
960 "invalid voice for lock %d (state = %x)\n",
960 voice, emu->voices[voice].state); 961 voice, emu->voices[voice].state);
961 spin_unlock_irqrestore(&emu->voice_lock, flags); 962 spin_unlock_irqrestore(&emu->voice_lock, flags);
962} 963}
@@ -973,7 +974,8 @@ void snd_emux_unlock_voice(struct snd_emux *emu, int voice)
973 if (emu->voices[voice].state == SNDRV_EMUX_ST_LOCKED) 974 if (emu->voices[voice].state == SNDRV_EMUX_ST_LOCKED)
974 emu->voices[voice].state = SNDRV_EMUX_ST_OFF; 975 emu->voices[voice].state = SNDRV_EMUX_ST_OFF;
975 else 976 else
976 snd_printk("invalid voice for unlock %d (state = %x)\n", 977 snd_printk(KERN_WARNING
978 "invalid voice for unlock %d (state = %x)\n",
977 voice, emu->voices[voice].state); 979 voice, emu->voices[voice].state);
978 spin_unlock_irqrestore(&emu->voice_lock, flags); 980 spin_unlock_irqrestore(&emu->voice_lock, flags);
979} 981}
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 36d53bd317ed..63c8f45c0c22 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -133,7 +133,7 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
133 int rc; 133 int rc;
134 134
135 if (count < (long)sizeof(patch)) { 135 if (count < (long)sizeof(patch)) {
136 snd_printk("patch record too small %ld\n", count); 136 snd_printk(KERN_ERR "patch record too small %ld\n", count);
137 return -EINVAL; 137 return -EINVAL;
138 } 138 }
139 if (copy_from_user(&patch, data, sizeof(patch))) 139 if (copy_from_user(&patch, data, sizeof(patch)))
@@ -143,15 +143,16 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
143 data += sizeof(patch); 143 data += sizeof(patch);
144 144
145 if (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) { 145 if (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) {
146 snd_printk("'The wrong kind of patch' %x\n", patch.key); 146 snd_printk(KERN_ERR "The wrong kind of patch %x\n", patch.key);
147 return -EINVAL; 147 return -EINVAL;
148 } 148 }
149 if (count < patch.len) { 149 if (count < patch.len) {
150 snd_printk("Patch too short %ld, need %d\n", count, patch.len); 150 snd_printk(KERN_ERR "Patch too short %ld, need %d\n",
151 count, patch.len);
151 return -EINVAL; 152 return -EINVAL;
152 } 153 }
153 if (patch.len < 0) { 154 if (patch.len < 0) {
154 snd_printk("poor length %d\n", patch.len); 155 snd_printk(KERN_ERR "poor length %d\n", patch.len);
155 return -EINVAL; 156 return -EINVAL;
156 } 157 }
157 158
@@ -195,7 +196,8 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
195 case SNDRV_SFNT_REMOVE_INFO: 196 case SNDRV_SFNT_REMOVE_INFO:
196 /* patch must be opened */ 197 /* patch must be opened */
197 if (!sflist->currsf) { 198 if (!sflist->currsf) {
198 snd_printk("soundfont: remove_info: patch not opened\n"); 199 snd_printk(KERN_ERR "soundfont: remove_info: "
200 "patch not opened\n");
199 rc = -EINVAL; 201 rc = -EINVAL;
200 } else { 202 } else {
201 int bank, instr; 203 int bank, instr;
@@ -531,7 +533,7 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
531 return -EINVAL; 533 return -EINVAL;
532 534
533 if (count < (long)sizeof(hdr)) { 535 if (count < (long)sizeof(hdr)) {
534 printk("Soundfont error: invalid patch zone length\n"); 536 printk(KERN_ERR "Soundfont error: invalid patch zone length\n");
535 return -EINVAL; 537 return -EINVAL;
536 } 538 }
537 if (copy_from_user((char*)&hdr, data, sizeof(hdr))) 539 if (copy_from_user((char*)&hdr, data, sizeof(hdr)))
@@ -541,12 +543,14 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
541 count -= sizeof(hdr); 543 count -= sizeof(hdr);
542 544
543 if (hdr.nvoices <= 0 || hdr.nvoices >= 100) { 545 if (hdr.nvoices <= 0 || hdr.nvoices >= 100) {
544 printk("Soundfont error: Illegal voice number %d\n", hdr.nvoices); 546 printk(KERN_ERR "Soundfont error: Illegal voice number %d\n",
547 hdr.nvoices);
545 return -EINVAL; 548 return -EINVAL;
546 } 549 }
547 550
548 if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) { 551 if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {
549 printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", 552 printk(KERN_ERR "Soundfont Error: "
553 "patch length(%ld) is smaller than nvoices(%d)\n",
550 count, hdr.nvoices); 554 count, hdr.nvoices);
551 return -EINVAL; 555 return -EINVAL;
552 } 556 }
@@ -952,7 +956,7 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
952 int rc; 956 int rc;
953 957
954 if (count < (long)sizeof(patch)) { 958 if (count < (long)sizeof(patch)) {
955 snd_printk("patch record too small %ld\n", count); 959 snd_printk(KERN_ERR "patch record too small %ld\n", count);
956 return -EINVAL; 960 return -EINVAL;
957 } 961 }
958 if (copy_from_user(&patch, data, sizeof(patch))) 962 if (copy_from_user(&patch, data, sizeof(patch)))
@@ -1034,7 +1038,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
1034 /* panning position; -128 - 127 => 0-127 */ 1038 /* panning position; -128 - 127 => 0-127 */
1035 zone->v.pan = (patch.panning + 128) / 2; 1039 zone->v.pan = (patch.panning + 128) / 2;
1036#if 0 1040#if 0
1037 snd_printk("gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\n", 1041 snd_printk(KERN_DEBUG
1042 "gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\n",
1038 (int)patch.base_freq, zone->v.rate_offset, 1043 (int)patch.base_freq, zone->v.rate_offset,
1039 zone->v.root, zone->v.tune, zone->v.low, zone->v.high); 1044 zone->v.root, zone->v.tune, zone->v.low, zone->v.high);
1040#endif 1045#endif
@@ -1068,7 +1073,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
1068 zone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release); 1073 zone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release);
1069 zone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]); 1074 zone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]);
1070#if 0 1075#if 0
1071 snd_printk("gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\n", 1076 snd_printk(KERN_DEBUG
1077 "gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\n",
1072 zone->v.parm.volatkhld, 1078 zone->v.parm.volatkhld,
1073 zone->v.parm.voldcysus, 1079 zone->v.parm.voldcysus,
1074 zone->v.parm.volrelease, 1080 zone->v.parm.volrelease,
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index 55a9075cb097..09aed2363cc9 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -42,7 +42,7 @@
42#endif 42#endif
43 43
44MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 44MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
45MODULE_DESCRIPTION("caiaq USB audio, version 1.3.9"); 45MODULE_DESCRIPTION("caiaq USB audio, version 1.3.10");
46MODULE_LICENSE("GPL"); 46MODULE_LICENSE("GPL");
47MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," 47MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
48 "{Native Instruments, RigKontrol3}," 48 "{Native Instruments, RigKontrol3},"
diff --git a/sound/usb/caiaq/caiaq-device.h b/sound/usb/caiaq/caiaq-device.h
index f9fbdbae269d..ab56e738c5fc 100644
--- a/sound/usb/caiaq/caiaq-device.h
+++ b/sound/usb/caiaq/caiaq-device.h
@@ -75,6 +75,7 @@ struct snd_usb_caiaqdev {
75 wait_queue_head_t ep1_wait_queue; 75 wait_queue_head_t ep1_wait_queue;
76 wait_queue_head_t prepare_wait_queue; 76 wait_queue_head_t prepare_wait_queue;
77 int spec_received, audio_parm_answer; 77 int spec_received, audio_parm_answer;
78 int midi_out_active;
78 79
79 char vendor_name[CAIAQ_USB_STR_LEN]; 80 char vendor_name[CAIAQ_USB_STR_LEN];
80 char product_name[CAIAQ_USB_STR_LEN]; 81 char product_name[CAIAQ_USB_STR_LEN];
diff --git a/sound/usb/caiaq/caiaq-midi.c b/sound/usb/caiaq/caiaq-midi.c
index 30b57f97c6e4..f19fd360c936 100644
--- a/sound/usb/caiaq/caiaq-midi.c
+++ b/sound/usb/caiaq/caiaq-midi.c
@@ -59,6 +59,11 @@ static int snd_usb_caiaq_midi_output_open(struct snd_rawmidi_substream *substrea
59 59
60static int snd_usb_caiaq_midi_output_close(struct snd_rawmidi_substream *substream) 60static int snd_usb_caiaq_midi_output_close(struct snd_rawmidi_substream *substream)
61{ 61{
62 struct snd_usb_caiaqdev *dev = substream->rmidi->private_data;
63 if (dev->midi_out_active) {
64 usb_kill_urb(&dev->midi_out_urb);
65 dev->midi_out_active = 0;
66 }
62 return 0; 67 return 0;
63} 68}
64 69
@@ -69,7 +74,8 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev,
69 74
70 dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; 75 dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE;
71 dev->midi_out_buf[1] = 0; /* port */ 76 dev->midi_out_buf[1] = 0; /* port */
72 len = snd_rawmidi_transmit_peek(substream, dev->midi_out_buf+3, EP1_BUFSIZE-3); 77 len = snd_rawmidi_transmit(substream, dev->midi_out_buf + 3,
78 EP1_BUFSIZE - 3);
73 79
74 if (len <= 0) 80 if (len <= 0)
75 return; 81 return;
@@ -79,24 +85,24 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev,
79 85
80 ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC); 86 ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC);
81 if (ret < 0) 87 if (ret < 0)
82 log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed, %d\n", 88 log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed,"
83 substream, ret); 89 "ret=%d, len=%d\n",
90 substream, ret, len);
91 else
92 dev->midi_out_active = 1;
84} 93}
85 94
86static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) 95static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
87{ 96{
88 struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; 97 struct snd_usb_caiaqdev *dev = substream->rmidi->private_data;
89 98
90 if (dev->midi_out_substream != NULL) 99 if (up) {
91 return; 100 dev->midi_out_substream = substream;
92 101 if (!dev->midi_out_active)
93 if (!up) { 102 snd_usb_caiaq_midi_send(dev, substream);
103 } else {
94 dev->midi_out_substream = NULL; 104 dev->midi_out_substream = NULL;
95 return;
96 } 105 }
97
98 dev->midi_out_substream = substream;
99 snd_usb_caiaq_midi_send(dev, substream);
100} 106}
101 107
102 108
@@ -161,16 +167,14 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device)
161void snd_usb_caiaq_midi_output_done(struct urb* urb) 167void snd_usb_caiaq_midi_output_done(struct urb* urb)
162{ 168{
163 struct snd_usb_caiaqdev *dev = urb->context; 169 struct snd_usb_caiaqdev *dev = urb->context;
164 char *buf = urb->transfer_buffer;
165 170
171 dev->midi_out_active = 0;
166 if (urb->status != 0) 172 if (urb->status != 0)
167 return; 173 return;
168 174
169 if (!dev->midi_out_substream) 175 if (!dev->midi_out_substream)
170 return; 176 return;
171 177
172 snd_rawmidi_transmit_ack(dev->midi_out_substream, buf[2]);
173 dev->midi_out_substream = NULL;
174 snd_usb_caiaq_midi_send(dev, dev->midi_out_substream); 178 snd_usb_caiaq_midi_send(dev, dev->midi_out_substream);
175} 179}
176 180
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 92115755d98e..5d8ef09b9dcc 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -128,6 +128,14 @@
128 .bInterfaceClass = USB_CLASS_AUDIO, 128 .bInterfaceClass = USB_CLASS_AUDIO,
129 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL 129 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
130}, 130},
131{
132 USB_DEVICE(0x046d, 0x0990),
133 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
134 .vendor_name = "Logitech, Inc.",
135 .product_name = "QuickCam Pro 9000",
136 .ifnum = QUIRK_NO_INTERFACE
137 }
138},
131 139
132/* 140/*
133 * Yamaha devices 141 * Yamaha devices