aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-23 02:17:28 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-23 02:17:28 -0500
commit66a101dda6b26ee566aa9cadcbea904a41d2b268 (patch)
treee03b5d40b7b88bb0a2f432bceba4680086d6d3a1 /sound
parentb1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff)
parent28b7e343ee63454d563a71d2d5f769fc297fd5ad (diff)
Merge branch 'topic/hwdep-cleanup' into topic/hdsp
Diffstat (limited to 'sound')
-rw-r--r--sound/core/hwdep.c9
-rw-r--r--sound/drivers/vx/vx_hwdep.c12
-rw-r--r--sound/oss/dmasound/dmasound_atari.c5
-rw-r--r--sound/oss/dmasound/dmasound_q40.c16
-rw-r--r--sound/pci/Kconfig4
-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.c21
-rw-r--r--sound/pci/hda/patch_sigmatel.c209
-rw-r--r--sound/pci/mixart/mixart_hwdep.c12
-rw-r--r--sound/pci/oxygen/virtuoso.c20
-rw-r--r--sound/pci/pcxhr/pcxhr_hwdep.c12
-rw-r--r--sound/pci/rme9652/hdsp.c9
-rw-r--r--sound/pci/rme9652/hdspm.c9
-rw-r--r--sound/ppc/snd_ps3.c4
-rw-r--r--sound/soc/atmel/atmel-pcm.c2
-rw-r--r--sound/soc/codecs/twl4030.c12
-rw-r--r--sound/soc/fsl/mpc8610_hpcd.c18
-rw-r--r--sound/soc/soc-core.c37
-rw-r--r--sound/soc/soc-dapm.c83
-rw-r--r--sound/synth/emux/emux_hwdep.c21
-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/usbmixer.c22
-rw-r--r--sound/usb/usbquirks.h8
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c12
32 files changed, 370 insertions, 354 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 195cafc5a553..a70ee7f1ed98 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -99,9 +99,6 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
99 if (hw == NULL) 99 if (hw == NULL)
100 return -ENODEV; 100 return -ENODEV;
101 101
102 if (!hw->ops.open)
103 return -ENXIO;
104
105 if (!try_module_get(hw->card->module)) 102 if (!try_module_get(hw->card->module))
106 return -EFAULT; 103 return -EFAULT;
107 104
@@ -113,6 +110,10 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
113 err = -EBUSY; 110 err = -EBUSY;
114 break; 111 break;
115 } 112 }
113 if (!hw->ops.open) {
114 err = 0;
115 break;
116 }
116 err = hw->ops.open(hw, file); 117 err = hw->ops.open(hw, file);
117 if (err >= 0) 118 if (err >= 0)
118 break; 119 break;
@@ -151,7 +152,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
151 152
152static int snd_hwdep_release(struct inode *inode, struct file * file) 153static int snd_hwdep_release(struct inode *inode, struct file * file)
153{ 154{
154 int err = -ENXIO; 155 int err = 0;
155 struct snd_hwdep *hw = file->private_data; 156 struct snd_hwdep *hw = file->private_data;
156 struct module *mod = hw->card->module; 157 struct module *mod = hw->card->module;
157 158
diff --git a/sound/drivers/vx/vx_hwdep.c b/sound/drivers/vx/vx_hwdep.c
index 8d6362e2d4c9..46df8817c18f 100644
--- a/sound/drivers/vx/vx_hwdep.c
+++ b/sound/drivers/vx/vx_hwdep.c
@@ -119,16 +119,6 @@ void snd_vx_free_firmware(struct vx_core *chip)
119 119
120#else /* old style firmware loading */ 120#else /* old style firmware loading */
121 121
122static int vx_hwdep_open(struct snd_hwdep *hw, struct file *file)
123{
124 return 0;
125}
126
127static int vx_hwdep_release(struct snd_hwdep *hw, struct file *file)
128{
129 return 0;
130}
131
132static int vx_hwdep_dsp_status(struct snd_hwdep *hw, 122static int vx_hwdep_dsp_status(struct snd_hwdep *hw,
133 struct snd_hwdep_dsp_status *info) 123 struct snd_hwdep_dsp_status *info)
134{ 124{
@@ -243,8 +233,6 @@ int snd_vx_setup_firmware(struct vx_core *chip)
243 233
244 hw->iface = SNDRV_HWDEP_IFACE_VX; 234 hw->iface = SNDRV_HWDEP_IFACE_VX;
245 hw->private_data = chip; 235 hw->private_data = chip;
246 hw->ops.open = vx_hwdep_open;
247 hw->ops.release = vx_hwdep_release;
248 hw->ops.dsp_status = vx_hwdep_dsp_status; 236 hw->ops.dsp_status = vx_hwdep_dsp_status;
249 hw->ops.dsp_load = vx_hwdep_dsp_load; 237 hw->ops.dsp_load = vx_hwdep_dsp_load;
250 hw->exclusive = 1; 238 hw->exclusive = 1;
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/Kconfig b/sound/pci/Kconfig
index 6e3a1848447c..82b9bddcdcd6 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -744,8 +744,8 @@ config SND_VIRTUOSO
744 select SND_OXYGEN_LIB 744 select SND_OXYGEN_LIB
745 help 745 help
746 Say Y here to include support for sound cards based on the 746 Say Y here to include support for sound cards based on the
747 Asus AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X and 747 Asus AV100/AV200 chips, i.e., Xonar D1, DX, D2 and D2X.
748 HDAV1.3 (Deluxe). 748 Support for the HDAV1.3 (Deluxe) is very experimental.
749 749
750 To compile this driver as a module, choose M here: the module 750 To compile this driver as a module, choose M here: the module
751 will be called snd-virtuoso. 751 will be called snd-virtuoso.
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..5d249a547fbf 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),
@@ -8474,6 +8478,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8474 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601), 8478 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601),
8475 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG), 8479 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
8476 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG), 8480 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG),
8481 SND_PCI_QUIRK(0x1071, 0x8227, "Mitac 82801H", ALC883_MITAC),
8477 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC), 8482 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC),
8478 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 8483 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
8479 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL), 8484 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL),
@@ -8522,6 +8527,8 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8522 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), 8527 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
8523 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), 8528 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
8524 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL), 8529 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL),
8530 SND_PCI_QUIRK(0x8086, 0x2503, "82801H", ALC883_MITAC),
8531 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC883_3ST_6ch_INTEL),
8525 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 8532 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch),
8526 {} 8533 {}
8527}; 8534};
@@ -10568,6 +10575,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
10568 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), 10575 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
10569 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), 10576 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA),
10570 SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA), 10577 SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA),
10578 SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO),
10571 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000), 10579 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000),
10572 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), 10580 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
10573 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31), 10581 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31),
@@ -11689,6 +11697,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
11689 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", 11697 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
11690 ALC268_ACER_ASPIRE_ONE), 11698 ALC268_ACER_ASPIRE_ONE),
11691 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), 11699 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
11700 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL),
11692 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), 11701 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA),
11693 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 11702 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
11694 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), 11703 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..3dd4eee70b7c 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};
@@ -80,6 +81,7 @@ enum {
80 81
81enum { 82enum {
82 STAC_92HD83XXX_REF, 83 STAC_92HD83XXX_REF,
84 STAC_92HD83XXX_PWR_REF,
83 STAC_92HD83XXX_MODELS 85 STAC_92HD83XXX_MODELS
84}; 86};
85 87
@@ -89,14 +91,19 @@ enum {
89 STAC_DELL_M4_2, 91 STAC_DELL_M4_2,
90 STAC_DELL_M4_3, 92 STAC_DELL_M4_3,
91 STAC_HP_M4, 93 STAC_HP_M4,
94 STAC_HP_DV5,
92 STAC_92HD71BXX_MODELS 95 STAC_92HD71BXX_MODELS
93}; 96};
94 97
95enum { 98enum {
96 STAC_925x_REF, 99 STAC_925x_REF,
100 STAC_M1,
101 STAC_M1_2,
102 STAC_M2,
97 STAC_M2_2, 103 STAC_M2_2,
98 STAC_MA6, 104 STAC_M3,
99 STAC_PA6, 105 STAC_M5,
106 STAC_M6,
100 STAC_925x_MODELS 107 STAC_925x_MODELS
101}; 108};
102 109
@@ -328,7 +335,11 @@ static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
328}; 335};
329 336
330static unsigned int stac92hd83xxx_pwr_mapping[4] = { 337static unsigned int stac92hd83xxx_pwr_mapping[4] = {
331 0x03, 0x0c, 0x10, 0x40, 338 0x03, 0x0c, 0x20, 0x40,
339};
340
341static hda_nid_t stac92hd83xxx_amp_nids[1] = {
342 0xc,
332}; 343};
333 344
334static hda_nid_t stac92hd71bxx_pwr_nids[3] = { 345static hda_nid_t stac92hd71bxx_pwr_nids[3] = {
@@ -831,10 +842,6 @@ static struct hda_verb stac92hd73xx_10ch_core_init[] = {
831}; 842};
832 843
833static struct hda_verb stac92hd83xxx_core_init[] = { 844static struct hda_verb stac92hd83xxx_core_init[] = {
834 /* start of config #1 */
835 { 0xe, AC_VERB_SET_CONNECT_SEL, 0x3},
836
837 /* start of config #2 */
838 { 0xa, AC_VERB_SET_CONNECT_SEL, 0x0}, 845 { 0xa, AC_VERB_SET_CONNECT_SEL, 0x0},
839 { 0xb, AC_VERB_SET_CONNECT_SEL, 0x0}, 846 { 0xb, AC_VERB_SET_CONNECT_SEL, 0x0},
840 { 0xd, AC_VERB_SET_CONNECT_SEL, 0x1}, 847 { 0xd, AC_VERB_SET_CONNECT_SEL, 0x1},
@@ -875,6 +882,8 @@ static struct hda_verb stac92hd71bxx_analog_core_init[] = {
875static struct hda_verb stac925x_core_init[] = { 882static struct hda_verb stac925x_core_init[] = {
876 /* set dac0mux for dac converter */ 883 /* set dac0mux for dac converter */
877 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, 884 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
885 /* mute the master volume */
886 { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
878 {} 887 {}
879}; 888};
880 889
@@ -1126,6 +1135,8 @@ static struct snd_kcontrol_new stac92hd71bxx_mixer[] = {
1126}; 1135};
1127 1136
1128static struct snd_kcontrol_new stac925x_mixer[] = { 1137static struct snd_kcontrol_new stac925x_mixer[] = {
1138 HDA_CODEC_VOLUME("Master Playback Volume", 0x0e, 0, HDA_OUTPUT),
1139 HDA_CODEC_MUTE("Master Playback Switch", 0x0e, 0, HDA_OUTPUT),
1129 STAC_INPUT_SOURCE(1), 1140 STAC_INPUT_SOURCE(1),
1130 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), 1141 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT),
1131 HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT), 1142 HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT),
@@ -1334,7 +1345,16 @@ static unsigned int ref9200_pin_configs[8] = {
1334 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, 1345 0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
1335}; 1346};
1336 1347
1337/* 1348static unsigned int gateway9200_m4_pin_configs[8] = {
1349 0x400000fe, 0x404500f4, 0x400100f0, 0x90110010,
1350 0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3,
1351};
1352static unsigned int gateway9200_m4_2_pin_configs[8] = {
1353 0x400000fe, 0x404500f4, 0x400100f0, 0x90110010,
1354 0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3,
1355};
1356
1357/*
1338 STAC 9200 pin configs for 1358 STAC 9200 pin configs for
1339 102801A8 1359 102801A8
1340 102801DE 1360 102801DE
@@ -1464,6 +1484,8 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
1464 [STAC_9200_DELL_M25] = dell9200_m25_pin_configs, 1484 [STAC_9200_DELL_M25] = dell9200_m25_pin_configs,
1465 [STAC_9200_DELL_M26] = dell9200_m26_pin_configs, 1485 [STAC_9200_DELL_M26] = dell9200_m26_pin_configs,
1466 [STAC_9200_DELL_M27] = dell9200_m27_pin_configs, 1486 [STAC_9200_DELL_M27] = dell9200_m27_pin_configs,
1487 [STAC_9200_M4] = gateway9200_m4_pin_configs,
1488 [STAC_9200_M4_2] = gateway9200_m4_2_pin_configs,
1467 [STAC_9200_PANASONIC] = ref9200_pin_configs, 1489 [STAC_9200_PANASONIC] = ref9200_pin_configs,
1468}; 1490};
1469 1491
@@ -1480,7 +1502,8 @@ static const char *stac9200_models[STAC_9200_MODELS] = {
1480 [STAC_9200_DELL_M25] = "dell-m25", 1502 [STAC_9200_DELL_M25] = "dell-m25",
1481 [STAC_9200_DELL_M26] = "dell-m26", 1503 [STAC_9200_DELL_M26] = "dell-m26",
1482 [STAC_9200_DELL_M27] = "dell-m27", 1504 [STAC_9200_DELL_M27] = "dell-m27",
1483 [STAC_9200_GATEWAY] = "gateway", 1505 [STAC_9200_M4] = "gateway-m4",
1506 [STAC_9200_M4_2] = "gateway-m4-2",
1484 [STAC_9200_PANASONIC] = "panasonic", 1507 [STAC_9200_PANASONIC] = "panasonic",
1485}; 1508};
1486 1509
@@ -1550,11 +1573,9 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
1550 /* Panasonic */ 1573 /* Panasonic */
1551 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), 1574 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC),
1552 /* Gateway machines needs EAPD to be set on resume */ 1575 /* Gateway machines needs EAPD to be set on resume */
1553 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_GATEWAY), 1576 SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4),
1554 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", 1577 SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2),
1555 STAC_9200_GATEWAY), 1578 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 */ 1579 /* OQO Mobile */
1559 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO), 1580 SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO),
1560 {} /* terminator */ 1581 {} /* terminator */
@@ -1565,44 +1586,85 @@ static unsigned int ref925x_pin_configs[8] = {
1565 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, 1586 0x90a70320, 0x02214210, 0x01019020, 0x9033032e,
1566}; 1587};
1567 1588
1568static unsigned int stac925x_MA6_pin_configs[8] = { 1589static unsigned int stac925xM1_pin_configs[8] = {
1569 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, 1590 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1570 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, 1591 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1571}; 1592};
1572 1593
1573static unsigned int stac925x_PA6_pin_configs[8] = { 1594static unsigned int stac925xM1_2_pin_configs[8] = {
1574 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, 1595 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1575 0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e, 1596 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1597};
1598
1599static unsigned int stac925xM2_pin_configs[8] = {
1600 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1601 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1576}; 1602};
1577 1603
1578static unsigned int stac925xM2_2_pin_configs[8] = { 1604static unsigned int stac925xM2_2_pin_configs[8] = {
1579 0x40c003f3, 0x424503f2, 0x04180011, 0x02a19020, 1605 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1580 0x50a103f0, 0x90100212, 0x400003f1, 0x9033032e, 1606 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1607};
1608
1609static unsigned int stac925xM3_pin_configs[8] = {
1610 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1611 0x40a000f0, 0x90100210, 0x400003f1, 0x503303f3,
1612};
1613
1614static unsigned int stac925xM5_pin_configs[8] = {
1615 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1616 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
1617};
1618
1619static unsigned int stac925xM6_pin_configs[8] = {
1620 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
1621 0x40a000f0, 0x90100210, 0x400003f1, 0x90330320,
1581}; 1622};
1582 1623
1583static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { 1624static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
1584 [STAC_REF] = ref925x_pin_configs, 1625 [STAC_REF] = ref925x_pin_configs,
1626 [STAC_M1] = stac925xM1_pin_configs,
1627 [STAC_M1_2] = stac925xM1_2_pin_configs,
1628 [STAC_M2] = stac925xM2_pin_configs,
1585 [STAC_M2_2] = stac925xM2_2_pin_configs, 1629 [STAC_M2_2] = stac925xM2_2_pin_configs,
1586 [STAC_MA6] = stac925x_MA6_pin_configs, 1630 [STAC_M3] = stac925xM3_pin_configs,
1587 [STAC_PA6] = stac925x_PA6_pin_configs, 1631 [STAC_M5] = stac925xM5_pin_configs,
1632 [STAC_M6] = stac925xM6_pin_configs,
1588}; 1633};
1589 1634
1590static const char *stac925x_models[STAC_925x_MODELS] = { 1635static const char *stac925x_models[STAC_925x_MODELS] = {
1591 [STAC_REF] = "ref", 1636 [STAC_REF] = "ref",
1637 [STAC_M1] = "m1",
1638 [STAC_M1_2] = "m1-2",
1639 [STAC_M2] = "m2",
1592 [STAC_M2_2] = "m2-2", 1640 [STAC_M2_2] = "m2-2",
1593 [STAC_MA6] = "m6", 1641 [STAC_M3] = "m3",
1594 [STAC_PA6] = "pa6", 1642 [STAC_M5] = "m5",
1643 [STAC_M6] = "m6",
1644};
1645
1646static struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = {
1647 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2),
1648 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5),
1649 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1),
1650 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2),
1651 SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2),
1652 /* Not sure about the brand name for those */
1653 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1),
1654 SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3),
1655 SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6),
1656 SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2),
1657 {} /* terminator */
1595}; 1658};
1596 1659
1597static struct snd_pci_quirk stac925x_cfg_tbl[] = { 1660static struct snd_pci_quirk stac925x_cfg_tbl[] = {
1598 /* SigmaTel reference board */ 1661 /* SigmaTel reference board */
1599 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), 1662 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
1600 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), 1663 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF),
1601 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), 1664
1602 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), 1665 /* Default table for unknown ID */
1603 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), 1666 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2),
1604 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6), 1667
1605 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2),
1606 {} /* terminator */ 1668 {} /* terminator */
1607}; 1669};
1608 1670
@@ -1673,16 +1735,18 @@ static unsigned int ref92hd83xxx_pin_configs[14] = {
1673 1735
1674static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = { 1736static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
1675 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, 1737 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs,
1738 [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs,
1676}; 1739};
1677 1740
1678static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { 1741static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
1679 [STAC_92HD83XXX_REF] = "ref", 1742 [STAC_92HD83XXX_REF] = "ref",
1743 [STAC_92HD83XXX_PWR_REF] = "mic-ref",
1680}; 1744};
1681 1745
1682static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { 1746static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1683 /* SigmaTel reference board */ 1747 /* SigmaTel reference board */
1684 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1748 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1685 "DFI LanParty", STAC_92HD71BXX_REF), 1749 "DFI LanParty", STAC_92HD83XXX_REF),
1686 {} /* terminator */ 1750 {} /* terminator */
1687}; 1751};
1688 1752
@@ -1716,6 +1780,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
1716 [STAC_DELL_M4_2] = dell_m4_2_pin_configs, 1780 [STAC_DELL_M4_2] = dell_m4_2_pin_configs,
1717 [STAC_DELL_M4_3] = dell_m4_3_pin_configs, 1781 [STAC_DELL_M4_3] = dell_m4_3_pin_configs,
1718 [STAC_HP_M4] = NULL, 1782 [STAC_HP_M4] = NULL,
1783 [STAC_HP_DV5] = NULL,
1719}; 1784};
1720 1785
1721static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { 1786static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
@@ -1724,6 +1789,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1724 [STAC_DELL_M4_2] = "dell-m4-2", 1789 [STAC_DELL_M4_2] = "dell-m4-2",
1725 [STAC_DELL_M4_3] = "dell-m4-3", 1790 [STAC_DELL_M4_3] = "dell-m4-3",
1726 [STAC_HP_M4] = "hp-m4", 1791 [STAC_HP_M4] = "hp-m4",
1792 [STAC_HP_DV5] = "hp-dv5",
1727}; 1793};
1728 1794
1729static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { 1795static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
@@ -1734,8 +1800,12 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1734 "HP dv5", STAC_HP_M4), 1800 "HP dv5", STAC_HP_M4),
1735 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4, 1801 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4,
1736 "HP dv7", STAC_HP_M4), 1802 "HP dv7", STAC_HP_M4),
1803 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f7,
1804 "HP dv4", STAC_HP_DV5),
1737 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, 1805 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
1738 "HP dv7", STAC_HP_M4), 1806 "HP dv7", STAC_HP_M4),
1807 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
1808 "HP dv5", STAC_HP_DV5),
1739 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, 1809 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
1740 "unknown HP", STAC_HP_M4), 1810 "unknown HP", STAC_HP_M4),
1741 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, 1811 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
@@ -3506,13 +3576,12 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3506 err = stac92xx_auto_fill_dac_nids(codec); 3576 err = stac92xx_auto_fill_dac_nids(codec);
3507 if (err < 0) 3577 if (err < 0)
3508 return err; 3578 return err;
3579 err = stac92xx_auto_create_multi_out_ctls(codec,
3580 &spec->autocfg);
3581 if (err < 0)
3582 return err;
3509 } 3583 }
3510 3584
3511 err = stac92xx_auto_create_multi_out_ctls(codec, &spec->autocfg);
3512
3513 if (err < 0)
3514 return err;
3515
3516 /* setup analog beep controls */ 3585 /* setup analog beep controls */
3517 if (spec->anabeep_nid > 0) { 3586 if (spec->anabeep_nid > 0) {
3518 err = stac92xx_auto_create_beep_ctls(codec, 3587 err = stac92xx_auto_create_beep_ctls(codec,
@@ -4163,8 +4232,19 @@ static void stac92xx_hp_detect(struct hda_codec *codec)
4163 continue; 4232 continue;
4164 if (presence) 4233 if (presence)
4165 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); 4234 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
4235#if 0 /* FIXME */
4236/* Resetting the pinctl like below may lead to (a sort of) regressions
4237 * on some devices since they use the HP pin actually for line/speaker
4238 * outs although the default pin config shows a different pin (that is
4239 * wrong and useless).
4240 *
4241 * So, it's basically a problem of default pin configs, likely a BIOS issue.
4242 * But, disabling the code below just works around it, and I'm too tired of
4243 * bug reports with such devices...
4244 */
4166 else 4245 else
4167 stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val); 4246 stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val);
4247#endif /* FIXME */
4168 } 4248 }
4169} 4249}
4170 4250
@@ -4390,7 +4470,8 @@ static int patch_stac9200(struct hda_codec *codec)
4390 spec->num_adcs = 1; 4470 spec->num_adcs = 1;
4391 spec->num_pwrs = 0; 4471 spec->num_pwrs = 0;
4392 4472
4393 if (spec->board_config == STAC_9200_GATEWAY || 4473 if (spec->board_config == STAC_9200_M4 ||
4474 spec->board_config == STAC_9200_M4_2 ||
4394 spec->board_config == STAC_9200_OQO) 4475 spec->board_config == STAC_9200_OQO)
4395 spec->init = stac9200_eapd_init; 4476 spec->init = stac9200_eapd_init;
4396 else 4477 else
@@ -4408,6 +4489,12 @@ static int patch_stac9200(struct hda_codec *codec)
4408 return err; 4489 return err;
4409 } 4490 }
4410 4491
4492 /* CF-74 has no headphone detection, and the driver should *NOT*
4493 * do detection and HP/speaker toggle because the hardware does it.
4494 */
4495 if (spec->board_config == STAC_9200_PANASONIC)
4496 spec->hp_detect = 0;
4497
4411 codec->patch_ops = stac92xx_patch_ops; 4498 codec->patch_ops = stac92xx_patch_ops;
4412 4499
4413 return 0; 4500 return 0;
@@ -4425,12 +4512,22 @@ static int patch_stac925x(struct hda_codec *codec)
4425 codec->spec = spec; 4512 codec->spec = spec;
4426 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); 4513 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
4427 spec->pin_nids = stac925x_pin_nids; 4514 spec->pin_nids = stac925x_pin_nids;
4428 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, 4515
4516 /* Check first for codec ID */
4517 spec->board_config = snd_hda_check_board_codec_sid_config(codec,
4518 STAC_925x_MODELS,
4519 stac925x_models,
4520 stac925x_codec_id_cfg_tbl);
4521
4522 /* Now checks for PCI ID, if codec ID is not found */
4523 if (spec->board_config < 0)
4524 spec->board_config = snd_hda_check_board_config(codec,
4525 STAC_925x_MODELS,
4429 stac925x_models, 4526 stac925x_models,
4430 stac925x_cfg_tbl); 4527 stac925x_cfg_tbl);
4431 again: 4528 again:
4432 if (spec->board_config < 0) { 4529 if (spec->board_config < 0) {
4433 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," 4530 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
4434 "using BIOS defaults\n"); 4531 "using BIOS defaults\n");
4435 err = stac92xx_save_bios_config_regs(codec); 4532 err = stac92xx_save_bios_config_regs(codec);
4436 } else 4533 } else
@@ -4658,7 +4755,9 @@ static struct hda_input_mux stac92hd83xxx_dmux = {
4658static int patch_stac92hd83xxx(struct hda_codec *codec) 4755static int patch_stac92hd83xxx(struct hda_codec *codec)
4659{ 4756{
4660 struct sigmatel_spec *spec; 4757 struct sigmatel_spec *spec;
4758 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1];
4661 int err; 4759 int err;
4760 int num_dacs;
4662 4761
4663 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 4762 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
4664 if (spec == NULL) 4763 if (spec == NULL)
@@ -4672,23 +4771,26 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4672 spec->dmux_nids = stac92hd83xxx_dmux_nids; 4771 spec->dmux_nids = stac92hd83xxx_dmux_nids;
4673 spec->adc_nids = stac92hd83xxx_adc_nids; 4772 spec->adc_nids = stac92hd83xxx_adc_nids;
4674 spec->pwr_nids = stac92hd83xxx_pwr_nids; 4773 spec->pwr_nids = stac92hd83xxx_pwr_nids;
4774 spec->amp_nids = stac92hd83xxx_amp_nids;
4675 spec->pwr_mapping = stac92hd83xxx_pwr_mapping; 4775 spec->pwr_mapping = stac92hd83xxx_pwr_mapping;
4676 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); 4776 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4677 spec->multiout.dac_nids = spec->dac_nids; 4777 spec->multiout.dac_nids = spec->dac_nids;
4678 4778
4679 spec->init = stac92hd83xxx_core_init;
4680 switch (codec->vendor_id) {
4681 case 0x111d7605:
4682 break;
4683 default:
4684 spec->num_pwrs--;
4685 spec->init++; /* switch to config #2 */
4686 }
4687 4779
4780 /* set port 0xe to select the last DAC
4781 */
4782 num_dacs = snd_hda_get_connections(codec, 0x0e,
4783 conn, STAC92HD83_DAC_COUNT + 1) - 1;
4784
4785 snd_hda_codec_write_cache(codec, 0xe, 0,
4786 AC_VERB_SET_CONNECT_SEL, num_dacs);
4787
4788 spec->init = stac92hd83xxx_core_init;
4688 spec->mixer = stac92hd83xxx_mixer; 4789 spec->mixer = stac92hd83xxx_mixer;
4689 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); 4790 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids);
4690 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); 4791 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids);
4691 spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); 4792 spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids);
4793 spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids);
4692 spec->num_dmics = STAC92HD83XXX_NUM_DMICS; 4794 spec->num_dmics = STAC92HD83XXX_NUM_DMICS;
4693 spec->dinput_mux = &stac92hd83xxx_dmux; 4795 spec->dinput_mux = &stac92hd83xxx_dmux;
4694 spec->pin_nids = stac92hd83xxx_pin_nids; 4796 spec->pin_nids = stac92hd83xxx_pin_nids;
@@ -4709,6 +4811,15 @@ again:
4709 return err; 4811 return err;
4710 } 4812 }
4711 4813
4814 switch (codec->vendor_id) {
4815 case 0x111d7604:
4816 case 0x111d7605:
4817 if (spec->board_config == STAC_92HD83XXX_PWR_REF)
4818 break;
4819 spec->num_pwrs = 0;
4820 break;
4821 }
4822
4712 err = stac92xx_parse_auto_config(codec, 0x1d, 0); 4823 err = stac92xx_parse_auto_config(codec, 0x1d, 0);
4713 if (!err) { 4824 if (!err) {
4714 if (spec->board_config < 0) { 4825 if (spec->board_config < 0) {
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index 3782b52bc0e8..fa4de985fc4c 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -581,16 +581,6 @@ MODULE_FIRMWARE("mixart/miXart8AES.xlx");
581/* miXart hwdep interface id string */ 581/* miXart hwdep interface id string */
582#define SND_MIXART_HWDEP_ID "miXart Loader" 582#define SND_MIXART_HWDEP_ID "miXart Loader"
583 583
584static int mixart_hwdep_open(struct snd_hwdep *hw, struct file *file)
585{
586 return 0;
587}
588
589static int mixart_hwdep_release(struct snd_hwdep *hw, struct file *file)
590{
591 return 0;
592}
593
594static int mixart_hwdep_dsp_status(struct snd_hwdep *hw, 584static int mixart_hwdep_dsp_status(struct snd_hwdep *hw,
595 struct snd_hwdep_dsp_status *info) 585 struct snd_hwdep_dsp_status *info)
596{ 586{
@@ -643,8 +633,6 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
643 633
644 hw->iface = SNDRV_HWDEP_IFACE_MIXART; 634 hw->iface = SNDRV_HWDEP_IFACE_MIXART;
645 hw->private_data = mgr; 635 hw->private_data = mgr;
646 hw->ops.open = mixart_hwdep_open;
647 hw->ops.release = mixart_hwdep_release;
648 hw->ops.dsp_status = mixart_hwdep_dsp_status; 636 hw->ops.dsp_status = mixart_hwdep_dsp_status;
649 hw->ops.dsp_load = mixart_hwdep_dsp_load; 637 hw->ops.dsp_load = mixart_hwdep_dsp_load;
650 hw->exclusive = 1; 638 hw->exclusive = 1;
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index 98c6a8c65d81..18c7c91786bc 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,
@@ -676,7 +683,7 @@ static void xonar_hdav_uart_input(struct oxygen *chip)
676 if (chip->uart_input_count >= 2 && 683 if (chip->uart_input_count >= 2 &&
677 chip->uart_input[chip->uart_input_count - 2] == 'O' && 684 chip->uart_input[chip->uart_input_count - 2] == 'O' &&
678 chip->uart_input[chip->uart_input_count - 1] == 'K') { 685 chip->uart_input[chip->uart_input_count - 1] == 'K') {
679 printk(KERN_DEBUG "message from Xonar HDAV HDMI chip received:"); 686 printk(KERN_DEBUG "message from Xonar HDAV HDMI chip received:\n");
680 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, 687 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
681 chip->uart_input, chip->uart_input_count); 688 chip->uart_input, chip->uart_input_count);
682 chip->uart_input_count = 0; 689 chip->uart_input_count = 0;
@@ -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
@@ -899,6 +908,7 @@ static const struct oxygen_model model_xonar_hdav = {
899 .dac_channels = 8, 908 .dac_channels = 8,
900 .dac_volume_min = 0x0f, 909 .dac_volume_min = 0x0f,
901 .dac_volume_max = 0xff, 910 .dac_volume_max = 0xff,
911 .misc_flags = OXYGEN_MISC_MIDI,
902 .function_flags = OXYGEN_FUNCTION_2WIRE, 912 .function_flags = OXYGEN_FUNCTION_2WIRE,
903 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 913 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
904 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 914 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
diff --git a/sound/pci/pcxhr/pcxhr_hwdep.c b/sound/pci/pcxhr/pcxhr_hwdep.c
index 592743a298b0..17cb1233a903 100644
--- a/sound/pci/pcxhr/pcxhr_hwdep.c
+++ b/sound/pci/pcxhr/pcxhr_hwdep.c
@@ -471,16 +471,6 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
471 return 0; 471 return 0;
472} 472}
473 473
474static int pcxhr_hwdep_open(struct snd_hwdep *hw, struct file *file)
475{
476 return 0;
477}
478
479static int pcxhr_hwdep_release(struct snd_hwdep *hw, struct file *file)
480{
481 return 0;
482}
483
484int pcxhr_setup_firmware(struct pcxhr_mgr *mgr) 474int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
485{ 475{
486 int err; 476 int err;
@@ -495,8 +485,6 @@ int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
495 485
496 hw->iface = SNDRV_HWDEP_IFACE_PCXHR; 486 hw->iface = SNDRV_HWDEP_IFACE_PCXHR;
497 hw->private_data = mgr; 487 hw->private_data = mgr;
498 hw->ops.open = pcxhr_hwdep_open;
499 hw->ops.release = pcxhr_hwdep_release;
500 hw->ops.dsp_status = pcxhr_hwdep_dsp_status; 488 hw->ops.dsp_status = pcxhr_hwdep_dsp_status;
501 hw->ops.dsp_load = pcxhr_hwdep_dsp_load; 489 hw->ops.dsp_load = pcxhr_hwdep_dsp_load;
502 hw->exclusive = 1; 490 hw->exclusive = 1;
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 05b3f795a168..bacfdd12619b 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -4413,13 +4413,6 @@ static int snd_hdsp_capture_release(struct snd_pcm_substream *substream)
4413 return 0; 4413 return 0;
4414} 4414}
4415 4415
4416static int snd_hdsp_hwdep_dummy_op(struct snd_hwdep *hw, struct file *file)
4417{
4418 /* we have nothing to initialize but the call is required */
4419 return 0;
4420}
4421
4422
4423/* helper functions for copying meter values */ 4416/* helper functions for copying meter values */
4424static inline int copy_u32_le(void __user *dest, void __iomem *src) 4417static inline int copy_u32_le(void __user *dest, void __iomem *src)
4425{ 4418{
@@ -4738,9 +4731,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
4738 hw->private_data = hdsp; 4731 hw->private_data = hdsp;
4739 strcpy(hw->name, "HDSP hwdep interface"); 4732 strcpy(hw->name, "HDSP hwdep interface");
4740 4733
4741 hw->ops.open = snd_hdsp_hwdep_dummy_op;
4742 hw->ops.ioctl = snd_hdsp_hwdep_ioctl; 4734 hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
4743 hw->ops.release = snd_hdsp_hwdep_dummy_op;
4744 4735
4745 return 0; 4736 return 0;
4746} 4737}
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index d4b4e0d0fee8..bac2dc0c5d85 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -4100,13 +4100,6 @@ static int snd_hdspm_capture_release(struct snd_pcm_substream *substream)
4100 return 0; 4100 return 0;
4101} 4101}
4102 4102
4103static int snd_hdspm_hwdep_dummy_op(struct snd_hwdep * hw, struct file *file)
4104{
4105 /* we have nothing to initialize but the call is required */
4106 return 0;
4107}
4108
4109
4110static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file, 4103static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
4111 unsigned int cmd, unsigned long arg) 4104 unsigned int cmd, unsigned long arg)
4112{ 4105{
@@ -4213,9 +4206,7 @@ static int __devinit snd_hdspm_create_hwdep(struct snd_card *card,
4213 hw->private_data = hdspm; 4206 hw->private_data = hdspm;
4214 strcpy(hw->name, "HDSPM hwdep interface"); 4207 strcpy(hw->name, "HDSPM hwdep interface");
4215 4208
4216 hw->ops.open = snd_hdspm_hwdep_dummy_op;
4217 hw->ops.ioctl = snd_hdspm_hwdep_ioctl; 4209 hw->ops.ioctl = snd_hdspm_hwdep_ioctl;
4218 hw->ops.release = snd_hdspm_hwdep_dummy_op;
4219 4210
4220 return 0; 4211 return 0;
4221} 4212}
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/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
index 1fac5efd285b..3dcdc4e3cfa0 100644
--- a/sound/soc/atmel/atmel-pcm.c
+++ b/sound/soc/atmel/atmel-pcm.c
@@ -44,8 +44,6 @@
44#include <sound/pcm_params.h> 44#include <sound/pcm_params.h>
45#include <sound/soc.h> 45#include <sound/soc.h>
46 46
47#include <mach/hardware.h>
48
49#include "atmel-pcm.h" 47#include "atmel-pcm.h"
50 48
51 49
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/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index bcec3f60bad9..acf39a646b2f 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -183,16 +183,6 @@ static struct snd_soc_ops mpc8610_hpcd_ops = {
183}; 183};
184 184
185/** 185/**
186 * mpc8610_hpcd_machine: ASoC machine data
187 */
188static struct snd_soc_card mpc8610_hpcd_machine = {
189 .probe = mpc8610_hpcd_machine_probe,
190 .remove = mpc8610_hpcd_machine_remove,
191 .name = "MPC8610 HPCD",
192 .num_links = 1,
193};
194
195/**
196 * mpc8610_hpcd_probe: OF probe function for the fabric driver 186 * mpc8610_hpcd_probe: OF probe function for the fabric driver
197 * 187 *
198 * This function gets called when an SSI node is found in the device tree. 188 * This function gets called when an SSI node is found in the device tree.
@@ -455,7 +445,11 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
455 machine_data->dai.codec_dai = &cs4270_dai; /* The codec_dai we want */ 445 machine_data->dai.codec_dai = &cs4270_dai; /* The codec_dai we want */
456 machine_data->dai.ops = &mpc8610_hpcd_ops; 446 machine_data->dai.ops = &mpc8610_hpcd_ops;
457 447
458 mpc8610_hpcd_machine.dai_link = &machine_data->dai; 448 machine_data->machine.probe = mpc8610_hpcd_machine_probe;
449 machine_data->machine.remove = mpc8610_hpcd_machine_remove;
450 machine_data->machine.name = "MPC8610 HPCD";
451 machine_data->machine.num_links = 1;
452 machine_data->machine.dai_link = &machine_data->dai;
459 453
460 /* Allocate a new audio platform device structure */ 454 /* Allocate a new audio platform device structure */
461 sound_device = platform_device_alloc("soc-audio", -1); 455 sound_device = platform_device_alloc("soc-audio", -1);
@@ -465,7 +459,7 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
465 goto error; 459 goto error;
466 } 460 }
467 461
468 machine_data->sound_devdata.card = &mpc8610_hpcd_machine; 462 machine_data->sound_devdata.card = &machine_data->machine;
469 machine_data->sound_devdata.codec_dev = &soc_codec_device_cs4270; 463 machine_data->sound_devdata.codec_dev = &soc_codec_device_cs4270;
470 machine_data->machine.platform = &fsl_soc_platform; 464 machine_data->machine.platform = &fsl_soc_platform;
471 465
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/synth/emux/emux_hwdep.c b/sound/synth/emux/emux_hwdep.c
index 0a5391436add..ff0b2a8fd25b 100644
--- a/sound/synth/emux/emux_hwdep.c
+++ b/sound/synth/emux/emux_hwdep.c
@@ -24,25 +24,6 @@
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include "emux_voice.h" 25#include "emux_voice.h"
26 26
27/*
28 * open the hwdep device
29 */
30static int
31snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file)
32{
33 return 0;
34}
35
36
37/*
38 * close the device
39 */
40static int
41snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file)
42{
43 return 0;
44}
45
46 27
47#define TMP_CLIENT_ID 0x1001 28#define TMP_CLIENT_ID 0x1001
48 29
@@ -146,8 +127,6 @@ snd_emux_init_hwdep(struct snd_emux *emu)
146 emu->hwdep = hw; 127 emu->hwdep = hw;
147 strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME); 128 strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME);
148 hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE; 129 hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE;
149 hw->ops.open = snd_emux_hwdep_open;
150 hw->ops.release = snd_emux_hwdep_release;
151 hw->ops.ioctl = snd_emux_hwdep_ioctl; 130 hw->ops.ioctl = snd_emux_hwdep_ioctl;
152 hw->exclusive = 1; 131 hw->exclusive = 1;
153 hw->private_data = emu; 132 hw->private_data = emu;
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/usbmixer.c b/sound/usb/usbmixer.c
index 00397c8a765b..2bde79216fa5 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -78,7 +78,6 @@ struct usb_mixer_interface {
78 78
79 /* Sound Blaster remote control stuff */ 79 /* Sound Blaster remote control stuff */
80 const struct rc_config *rc_cfg; 80 const struct rc_config *rc_cfg;
81 unsigned long rc_hwdep_open;
82 u32 rc_code; 81 u32 rc_code;
83 wait_queue_head_t rc_waitq; 82 wait_queue_head_t rc_waitq;
84 struct urb *rc_urb; 83 struct urb *rc_urb;
@@ -1797,24 +1796,6 @@ static void snd_usb_soundblaster_remote_complete(struct urb *urb)
1797 wake_up(&mixer->rc_waitq); 1796 wake_up(&mixer->rc_waitq);
1798} 1797}
1799 1798
1800static int snd_usb_sbrc_hwdep_open(struct snd_hwdep *hw, struct file *file)
1801{
1802 struct usb_mixer_interface *mixer = hw->private_data;
1803
1804 if (test_and_set_bit(0, &mixer->rc_hwdep_open))
1805 return -EBUSY;
1806 return 0;
1807}
1808
1809static int snd_usb_sbrc_hwdep_release(struct snd_hwdep *hw, struct file *file)
1810{
1811 struct usb_mixer_interface *mixer = hw->private_data;
1812
1813 clear_bit(0, &mixer->rc_hwdep_open);
1814 smp_mb__after_clear_bit();
1815 return 0;
1816}
1817
1818static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf, 1799static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf,
1819 long count, loff_t *offset) 1800 long count, loff_t *offset)
1820{ 1801{
@@ -1867,9 +1848,8 @@ static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
1867 hwdep->iface = SNDRV_HWDEP_IFACE_SB_RC; 1848 hwdep->iface = SNDRV_HWDEP_IFACE_SB_RC;
1868 hwdep->private_data = mixer; 1849 hwdep->private_data = mixer;
1869 hwdep->ops.read = snd_usb_sbrc_hwdep_read; 1850 hwdep->ops.read = snd_usb_sbrc_hwdep_read;
1870 hwdep->ops.open = snd_usb_sbrc_hwdep_open;
1871 hwdep->ops.release = snd_usb_sbrc_hwdep_release;
1872 hwdep->ops.poll = snd_usb_sbrc_hwdep_poll; 1851 hwdep->ops.poll = snd_usb_sbrc_hwdep_poll;
1852 hwdep->exclusive = 1;
1873 1853
1874 mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL); 1854 mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL);
1875 if (!mixer->rc_urb) 1855 if (!mixer->rc_urb)
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
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index 1558a5c4094f..a26d8d83d3eb 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -106,16 +106,6 @@ static unsigned int snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file,
106} 106}
107 107
108 108
109static int snd_usX2Y_hwdep_open(struct snd_hwdep *hw, struct file *file)
110{
111 return 0;
112}
113
114static int snd_usX2Y_hwdep_release(struct snd_hwdep *hw, struct file *file)
115{
116 return 0;
117}
118
119static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, 109static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw,
120 struct snd_hwdep_dsp_status *info) 110 struct snd_hwdep_dsp_status *info)
121{ 111{
@@ -267,8 +257,6 @@ int usX2Y_hwdep_new(struct snd_card *card, struct usb_device* device)
267 257
268 hw->iface = SNDRV_HWDEP_IFACE_USX2Y; 258 hw->iface = SNDRV_HWDEP_IFACE_USX2Y;
269 hw->private_data = usX2Y(card); 259 hw->private_data = usX2Y(card);
270 hw->ops.open = snd_usX2Y_hwdep_open;
271 hw->ops.release = snd_usX2Y_hwdep_release;
272 hw->ops.dsp_status = snd_usX2Y_hwdep_dsp_status; 260 hw->ops.dsp_status = snd_usX2Y_hwdep_dsp_status;
273 hw->ops.dsp_load = snd_usX2Y_hwdep_dsp_load; 261 hw->ops.dsp_load = snd_usX2Y_hwdep_dsp_load;
274 hw->ops.mmap = snd_us428ctls_mmap; 262 hw->ops.mmap = snd_us428ctls_mmap;