diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_beep.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 48 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 5 | ||||
-rw-r--r-- | sound/pci/hda/patch_nvhdmi.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 18 | ||||
-rw-r--r-- | sound/soc/au1x/dbdma2.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/twl4030.c | 12 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 37 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 80 |
12 files changed, 68 insertions, 147 deletions
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index e00421c0d8b..960fd797038 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 e16cf63821a..3c596da2b9b 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 | } |
1429 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get); | 1441 | EXPORT_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 | } |
1453 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put); | 1465 | EXPORT_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 | } |
1473 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info); | 1485 | EXPORT_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 | } |
1490 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get); | 1502 | EXPORT_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 | } |
1513 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put); | 1525 | EXPORT_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 | } |
1530 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv); | 1542 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv); |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 729fc7642d7..5810ef58840 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 f04de115ee1..11e791b965f 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 | ||
1747 | static struct snd_pcm_ops azx_pcm_ops = { | 1747 | static struct snd_pcm_ops azx_pcm_ops = { |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 26247cfe749..2e7371ec2e2 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 | ||
3901 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { | 3901 | static 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 0270fda0bda..96952a37d88 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -162,12 +162,14 @@ static 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 = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi }, | 163 | { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi }, |
164 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi }, | 164 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi }, |
165 | { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi }, | ||
165 | {} /* terminator */ | 166 | {} /* terminator */ |
166 | }; | 167 | }; |
167 | 168 | ||
168 | MODULE_ALIAS("snd-hda-codec-id:10de0002"); | 169 | MODULE_ALIAS("snd-hda-codec-id:10de0002"); |
169 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); | 170 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); |
170 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); | 171 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); |
172 | MODULE_ALIAS("snd-hda-codec-id:10de8001"); | ||
171 | 173 | ||
172 | MODULE_LICENSE("GPL"); | 174 | MODULE_LICENSE("GPL"); |
173 | MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec"); | 175 | MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec"); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 9065ebf9c06..ea4c88fe05c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1502,11 +1502,11 @@ static int alc_cap_vol_info(struct snd_kcontrol *kcontrol, | |||
1502 | struct alc_spec *spec = codec->spec; | 1502 | struct alc_spec *spec = codec->spec; |
1503 | int err; | 1503 | int err; |
1504 | 1504 | ||
1505 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1505 | mutex_lock(&codec->control_mutex); |
1506 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, | 1506 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, |
1507 | HDA_INPUT); | 1507 | HDA_INPUT); |
1508 | err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); | 1508 | err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); |
1509 | mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1509 | mutex_unlock(&codec->control_mutex); |
1510 | return err; | 1510 | return err; |
1511 | } | 1511 | } |
1512 | 1512 | ||
@@ -1517,11 +1517,11 @@ static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1517 | struct alc_spec *spec = codec->spec; | 1517 | struct alc_spec *spec = codec->spec; |
1518 | int err; | 1518 | int err; |
1519 | 1519 | ||
1520 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1520 | mutex_lock(&codec->control_mutex); |
1521 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, | 1521 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, |
1522 | HDA_INPUT); | 1522 | HDA_INPUT); |
1523 | err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); | 1523 | err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); |
1524 | mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1524 | mutex_unlock(&codec->control_mutex); |
1525 | return err; | 1525 | return err; |
1526 | } | 1526 | } |
1527 | 1527 | ||
@@ -1537,11 +1537,11 @@ static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, | |||
1537 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 1537 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
1538 | int err; | 1538 | int err; |
1539 | 1539 | ||
1540 | mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1540 | mutex_lock(&codec->control_mutex); |
1541 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], | 1541 | kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], |
1542 | 3, 0, HDA_INPUT); | 1542 | 3, 0, HDA_INPUT); |
1543 | err = func(kcontrol, ucontrol); | 1543 | err = func(kcontrol, ucontrol); |
1544 | mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ | 1544 | mutex_unlock(&codec->control_mutex); |
1545 | return err; | 1545 | return err; |
1546 | } | 1546 | } |
1547 | 1547 | ||
@@ -8461,6 +8461,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
8461 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), | 8461 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), |
8462 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", | 8462 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
8463 | ALC888_ACER_ASPIRE_4930G), | 8463 | ALC888_ACER_ASPIRE_4930G), |
8464 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", | ||
8465 | ALC888_ACER_ASPIRE_4930G), | ||
8466 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", | ||
8467 | ALC888_ACER_ASPIRE_4930G), | ||
8464 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ | 8468 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ |
8465 | SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), | 8469 | SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), |
8466 | SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), | 8470 | SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), |
@@ -8522,6 +8526,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
8522 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), | 8526 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), |
8523 | SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), | 8527 | SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL), |
8524 | SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL), | 8528 | SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL), |
8529 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC883_3ST_6ch_INTEL), | ||
8525 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), | 8530 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), |
8526 | {} | 8531 | {} |
8527 | }; | 8532 | }; |
@@ -11689,6 +11694,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { | |||
11689 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", | 11694 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", |
11690 | ALC268_ACER_ASPIRE_ONE), | 11695 | ALC268_ACER_ASPIRE_ONE), |
11691 | SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), | 11696 | SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), |
11697 | SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL), | ||
11692 | SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), | 11698 | SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), |
11693 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), | 11699 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), |
11694 | SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), | 11700 | SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), |
diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index 74c823d60f9..bc8d654576c 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c | |||
@@ -187,7 +187,7 @@ static int au1x_pcm_dbdma_realloc(struct au1xpsc_audio_dmadata *pcd, | |||
187 | au1x_pcm_dmatx_cb, (void *)pcd); | 187 | au1x_pcm_dmatx_cb, (void *)pcd); |
188 | 188 | ||
189 | if (!pcd->ddma_chan) | 189 | if (!pcd->ddma_chan) |
190 | return -ENOMEM;; | 190 | return -ENOMEM; |
191 | 191 | ||
192 | au1xxx_dbdma_set_devwidth(pcd->ddma_chan, msbits); | 192 | au1xxx_dbdma_set_devwidth(pcd->ddma_chan, msbits); |
193 | au1xxx_dbdma_ring_alloc(pcd->ddma_chan, 2); | 193 | au1xxx_dbdma_ring_alloc(pcd->ddma_chan, 2); |
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index fd0f338374a..ea370a4f86d 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -197,7 +197,7 @@ static const char *twl4030_earpiece_texts[] = | |||
197 | static const unsigned int twl4030_earpiece_values[] = | 197 | static const unsigned int twl4030_earpiece_values[] = |
198 | {0x0, 0x1, 0x2, 0x4}; | 198 | {0x0, 0x1, 0x2, 0x4}; |
199 | 199 | ||
200 | static const struct soc_value_enum twl4030_earpiece_enum = | 200 | static 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[] = | |||
213 | static const unsigned int twl4030_predrivel_values[] = | 213 | static const unsigned int twl4030_predrivel_values[] = |
214 | {0x0, 0x1, 0x2, 0x4}; | 214 | {0x0, 0x1, 0x2, 0x4}; |
215 | 215 | ||
216 | static const struct soc_value_enum twl4030_predrivel_enum = | 216 | static 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[] = | |||
229 | static const unsigned int twl4030_predriver_values[] = | 229 | static const unsigned int twl4030_predriver_values[] = |
230 | {0x0, 0x1, 0x2, 0x4}; | 230 | {0x0, 0x1, 0x2, 0x4}; |
231 | 231 | ||
232 | static const struct soc_value_enum twl4030_predriver_enum = | 232 | static 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[] = | |||
317 | static const unsigned int twl4030_analoglmic_values[] = | 317 | static const unsigned int twl4030_analoglmic_values[] = |
318 | {0x0, 0x1, 0x2, 0x4, 0x8}; | 318 | {0x0, 0x1, 0x2, 0x4, 0x8}; |
319 | 319 | ||
320 | static const struct soc_value_enum twl4030_analoglmic_enum = | 320 | static 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[] = | |||
333 | static const unsigned int twl4030_analogrmic_values[] = | 333 | static const unsigned int twl4030_analogrmic_values[] = |
334 | {0x0, 0x1, 0x4}; | 334 | {0x0, 0x1, 0x4}; |
335 | 335 | ||
336 | static const struct soc_value_enum twl4030_analogrmic_enum = | 336 | static 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/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 74abc9b4f1c..366049d8578 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -212,7 +212,7 @@ davinci_pcm_pointer(struct snd_pcm_substream *substream) | |||
212 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 212 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
213 | count = src - runtime->dma_addr; | 213 | count = src - runtime->dma_addr; |
214 | else | 214 | else |
215 | count = dst - runtime->dma_addr;; | 215 | count = dst - runtime->dma_addr; |
216 | 216 | ||
217 | spin_unlock(&prtd->lock); | 217 | spin_unlock(&prtd->lock); |
218 | 218 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6cbe7e82f23..55fdb4abb17 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, | |||
1585 | EXPORT_SYMBOL_GPL(snd_soc_put_enum_double); | 1585 | EXPORT_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 | */ | ||
1600 | int 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 | } | ||
1616 | EXPORT_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 ad0d801677c..493a4e8aa27 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 */ | ||
204 | static 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 */ |
228 | static int dapm_connect_mixer(struct snd_soc_codec *codec, | 204 | static 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, |
@@ -774,45 +750,6 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | |||
774 | return 0; | 750 | return 0; |
775 | } | 751 | } |
776 | 752 | ||
777 | /* test and update the power status of a value_mux widget */ | ||
778 | static 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 */ | 753 | /* test and update the power status of a mixer or switch widget */ |
817 | static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | 754 | static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, |
818 | struct snd_kcontrol *kcontrol, int reg, | 755 | struct snd_kcontrol *kcontrol, int reg, |
@@ -1045,17 +982,12 @@ static int snd_soc_dapm_add_route(struct snd_soc_codec *codec, | |||
1045 | path->connect = 1; | 982 | path->connect = 1; |
1046 | return 0; | 983 | return 0; |
1047 | case snd_soc_dapm_mux: | 984 | case snd_soc_dapm_mux: |
985 | case snd_soc_dapm_value_mux: | ||
1048 | ret = dapm_connect_mux(codec, wsource, wsink, path, control, | 986 | ret = dapm_connect_mux(codec, wsource, wsink, path, control, |
1049 | &wsink->kcontrols[0]); | 987 | &wsink->kcontrols[0]); |
1050 | if (ret != 0) | 988 | if (ret != 0) |
1051 | goto err; | 989 | goto err; |
1052 | break; | 990 | 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: | 991 | case snd_soc_dapm_switch: |
1060 | case snd_soc_dapm_mixer: | 992 | case snd_soc_dapm_mixer: |
1061 | ret = dapm_connect_mixer(codec, wsource, wsink, path, control); | 993 | ret = dapm_connect_mixer(codec, wsource, wsink, path, control); |
@@ -1382,8 +1314,7 @@ int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1382 | struct snd_ctl_elem_value *ucontrol) | 1314 | struct snd_ctl_elem_value *ucontrol) |
1383 | { | 1315 | { |
1384 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 1316 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); |
1385 | struct soc_value_enum *e = (struct soc_value_enum *) | 1317 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1386 | kcontrol->private_value; | ||
1387 | unsigned short reg_val, val, mux; | 1318 | unsigned short reg_val, val, mux; |
1388 | 1319 | ||
1389 | reg_val = snd_soc_read(widget->codec, e->reg); | 1320 | reg_val = snd_soc_read(widget->codec, e->reg); |
@@ -1423,8 +1354,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1423 | struct snd_ctl_elem_value *ucontrol) | 1354 | struct snd_ctl_elem_value *ucontrol) |
1424 | { | 1355 | { |
1425 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 1356 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); |
1426 | struct soc_value_enum *e = (struct soc_value_enum *) | 1357 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1427 | kcontrol->private_value; | ||
1428 | unsigned short val, mux; | 1358 | unsigned short val, mux; |
1429 | unsigned short mask; | 1359 | unsigned short mask; |
1430 | int ret = 0; | 1360 | int ret = 0; |
@@ -1443,7 +1373,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1443 | 1373 | ||
1444 | mutex_lock(&widget->codec->mutex); | 1374 | mutex_lock(&widget->codec->mutex); |
1445 | widget->value = val; | 1375 | widget->value = val; |
1446 | dapm_value_mux_update_power(widget, kcontrol, mask, mux, val, e); | 1376 | dapm_mux_update_power(widget, kcontrol, mask, mux, val, e); |
1447 | if (widget->event) { | 1377 | if (widget->event) { |
1448 | if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { | 1378 | if (widget->event_flags & SND_SOC_DAPM_PRE_REG) { |
1449 | ret = widget->event(widget, | 1379 | ret = widget->event(widget, |