diff options
Diffstat (limited to 'sound/pci')
71 files changed, 693 insertions, 806 deletions
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c index e120a11c69e8..20516b6907b5 100644 --- a/sound/pci/ac97/ac97_proc.c +++ b/sound/pci/ac97/ac97_proc.c | |||
@@ -436,25 +436,20 @@ void snd_ac97_proc_init(struct snd_ac97 * ac97) | |||
436 | return; | 436 | return; |
437 | prefix = ac97_is_audio(ac97) ? "ac97" : "mc97"; | 437 | prefix = ac97_is_audio(ac97) ? "ac97" : "mc97"; |
438 | sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num); | 438 | sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num); |
439 | if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) { | 439 | entry = snd_info_create_card_entry(ac97->bus->card, name, |
440 | ac97->bus->proc); | ||
441 | if (entry) | ||
440 | snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read); | 442 | snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read); |
441 | if (snd_info_register(entry) < 0) { | ||
442 | snd_info_free_entry(entry); | ||
443 | entry = NULL; | ||
444 | } | ||
445 | } | ||
446 | ac97->proc = entry; | 443 | ac97->proc = entry; |
447 | sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num); | 444 | sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num); |
448 | if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) { | 445 | entry = snd_info_create_card_entry(ac97->bus->card, name, |
446 | ac97->bus->proc); | ||
447 | if (entry) { | ||
449 | snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read); | 448 | snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read); |
450 | #ifdef CONFIG_SND_DEBUG | 449 | #ifdef CONFIG_SND_DEBUG |
451 | entry->mode |= 0200; | 450 | entry->mode |= 0200; |
452 | entry->c.text.write = snd_ac97_proc_regs_write; | 451 | entry->c.text.write = snd_ac97_proc_regs_write; |
453 | #endif | 452 | #endif |
454 | if (snd_info_register(entry) < 0) { | ||
455 | snd_info_free_entry(entry); | ||
456 | entry = NULL; | ||
457 | } | ||
458 | } | 453 | } |
459 | ac97->proc_regs = entry; | 454 | ac97->proc_regs = entry; |
460 | } | 455 | } |
@@ -473,13 +468,10 @@ void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus) | |||
473 | char name[32]; | 468 | char name[32]; |
474 | 469 | ||
475 | sprintf(name, "codec97#%d", bus->num); | 470 | sprintf(name, "codec97#%d", bus->num); |
476 | if ((entry = snd_info_create_card_entry(bus->card, name, bus->card->proc_root)) != NULL) { | 471 | entry = snd_info_create_card_entry(bus->card, name, |
472 | bus->card->proc_root); | ||
473 | if (entry) | ||
477 | entry->mode = S_IFDIR | 0555; | 474 | entry->mode = S_IFDIR | 0555; |
478 | if (snd_info_register(entry) < 0) { | ||
479 | snd_info_free_entry(entry); | ||
480 | entry = NULL; | ||
481 | } | ||
482 | } | ||
483 | bus->proc = entry; | 475 | bus->proc = entry; |
484 | } | 476 | } |
485 | 477 | ||
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c index d9c54c08e2db..fef07ae648e6 100644 --- a/sound/pci/ad1889.c +++ b/sound/pci/ad1889.c | |||
@@ -644,16 +644,11 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device) | |||
644 | chip->psubs = NULL; | 644 | chip->psubs = NULL; |
645 | chip->csubs = NULL; | 645 | chip->csubs = NULL; |
646 | 646 | ||
647 | err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 647 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
648 | snd_dma_pci_data(chip->pci), | 648 | snd_dma_pci_data(chip->pci), |
649 | BUFFER_BYTES_MAX / 2, | 649 | BUFFER_BYTES_MAX / 2, |
650 | BUFFER_BYTES_MAX); | 650 | BUFFER_BYTES_MAX); |
651 | 651 | ||
652 | if (err < 0) { | ||
653 | dev_err(chip->card->dev, "buffer allocation error: %d\n", err); | ||
654 | return err; | ||
655 | } | ||
656 | |||
657 | return 0; | 652 | return 0; |
658 | } | 653 | } |
659 | 654 | ||
@@ -741,10 +736,8 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe | |||
741 | static void | 736 | static void |
742 | snd_ad1889_proc_init(struct snd_ad1889 *chip) | 737 | snd_ad1889_proc_init(struct snd_ad1889 *chip) |
743 | { | 738 | { |
744 | struct snd_info_entry *entry; | 739 | snd_card_ro_proc_new(chip->card, chip->card->driver, |
745 | 740 | chip, snd_ad1889_proc_read); | |
746 | if (!snd_card_proc_new(chip->card, chip->card->driver, &entry)) | ||
747 | snd_info_set_text_ops(entry, chip, snd_ad1889_proc_read); | ||
748 | } | 741 | } |
749 | 742 | ||
750 | static const struct ac97_quirk ac97_quirks[] = { | 743 | static const struct ac97_quirk ac97_quirks[] = { |
diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c index 2fb1fbba3e5e..11e902cac71b 100644 --- a/sound/pci/ak4531_codec.c +++ b/sound/pci/ak4531_codec.c | |||
@@ -481,8 +481,5 @@ static void snd_ak4531_proc_read(struct snd_info_entry *entry, | |||
481 | static void | 481 | static void |
482 | snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531) | 482 | snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531) |
483 | { | 483 | { |
484 | struct snd_info_entry *entry; | 484 | snd_card_ro_proc_new(card, "ak4531", ak4531, snd_ak4531_proc_read); |
485 | |||
486 | if (! snd_card_proc_new(card, "ak4531", &entry)) | ||
487 | snd_info_set_text_ops(entry, ak4531, snd_ak4531_proc_read); | ||
488 | } | 485 | } |
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 9f569379b77e..f7fbe05836b3 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -1882,10 +1882,8 @@ static int ali_suspend(struct device *dev) | |||
1882 | return 0; | 1882 | return 0; |
1883 | 1883 | ||
1884 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1884 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1885 | for (i = 0; i < chip->num_of_codecs; i++) { | 1885 | for (i = 0; i < chip->num_of_codecs; i++) |
1886 | snd_pcm_suspend_all(chip->pcm[i]); | ||
1887 | snd_ac97_suspend(chip->ac97[i]); | 1886 | snd_ac97_suspend(chip->ac97[i]); |
1888 | } | ||
1889 | 1887 | ||
1890 | spin_lock_irq(&chip->reg_lock); | 1888 | spin_lock_irq(&chip->reg_lock); |
1891 | 1889 | ||
@@ -2051,9 +2049,7 @@ static void snd_ali_proc_read(struct snd_info_entry *entry, | |||
2051 | 2049 | ||
2052 | static void snd_ali_proc_init(struct snd_ali *codec) | 2050 | static void snd_ali_proc_init(struct snd_ali *codec) |
2053 | { | 2051 | { |
2054 | struct snd_info_entry *entry; | 2052 | snd_card_ro_proc_new(codec->card, "ali5451", codec, snd_ali_proc_read); |
2055 | if (!snd_card_proc_new(codec->card, "ali5451", &entry)) | ||
2056 | snd_info_set_text_ops(entry, codec, snd_ali_proc_read); | ||
2057 | } | 2053 | } |
2058 | 2054 | ||
2059 | static int snd_ali_resources(struct snd_ali *codec) | 2055 | static int snd_ali_resources(struct snd_ali *codec) |
diff --git a/sound/pci/als300.c b/sound/pci/als300.c index eaa2d853d922..516b3d9cbfdf 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c | |||
@@ -731,7 +731,6 @@ static int snd_als300_suspend(struct device *dev) | |||
731 | struct snd_als300 *chip = card->private_data; | 731 | struct snd_als300 *chip = card->private_data; |
732 | 732 | ||
733 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 733 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
734 | snd_pcm_suspend_all(chip->pcm); | ||
735 | snd_ac97_suspend(chip->ac97); | 734 | snd_ac97_suspend(chip->ac97); |
736 | return 0; | 735 | return 0; |
737 | } | 736 | } |
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index 26b097edec8c..45fa38382e79 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c | |||
@@ -994,7 +994,6 @@ static int snd_als4000_suspend(struct device *dev) | |||
994 | 994 | ||
995 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 995 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
996 | 996 | ||
997 | snd_pcm_suspend_all(chip->pcm); | ||
998 | snd_sbmixer_suspend(chip); | 997 | snd_sbmixer_suspend(chip); |
999 | return 0; | 998 | return 0; |
1000 | } | 999 | } |
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index aad74e809797..32b2f9802479 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
@@ -2782,10 +2782,8 @@ snd_asihpi_proc_read(struct snd_info_entry *entry, | |||
2782 | 2782 | ||
2783 | static void snd_asihpi_proc_init(struct snd_card_asihpi *asihpi) | 2783 | static void snd_asihpi_proc_init(struct snd_card_asihpi *asihpi) |
2784 | { | 2784 | { |
2785 | struct snd_info_entry *entry; | 2785 | snd_card_ro_proc_new(asihpi->card, "info", asihpi, |
2786 | 2786 | snd_asihpi_proc_read); | |
2787 | if (!snd_card_proc_new(asihpi->card, "info", &entry)) | ||
2788 | snd_info_set_text_ops(entry, asihpi, snd_asihpi_proc_read); | ||
2789 | } | 2787 | } |
2790 | 2788 | ||
2791 | /*------------------------------------------------------------ | 2789 | /*------------------------------------------------------------ |
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 1a41f8c80243..169763c88f5e 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -733,6 +733,10 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
733 | case SNDRV_PCM_TRIGGER_START: | 733 | case SNDRV_PCM_TRIGGER_START: |
734 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 734 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
735 | case SNDRV_PCM_TRIGGER_RESUME: | 735 | case SNDRV_PCM_TRIGGER_RESUME: |
736 | if (dma->running && dma->suspended && | ||
737 | cmd == SNDRV_PCM_TRIGGER_RESUME) | ||
738 | writel(dma->saved_curptr, chip->remap_addr + | ||
739 | dma->ops->dt_cur); | ||
736 | dma->ops->enable_transfer(chip, 1); | 740 | dma->ops->enable_transfer(chip, 1); |
737 | dma->running = 1; | 741 | dma->running = 1; |
738 | dma->suspended = 0; | 742 | dma->suspended = 0; |
@@ -740,9 +744,12 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
740 | case SNDRV_PCM_TRIGGER_STOP: | 744 | case SNDRV_PCM_TRIGGER_STOP: |
741 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 745 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
742 | case SNDRV_PCM_TRIGGER_SUSPEND: | 746 | case SNDRV_PCM_TRIGGER_SUSPEND: |
747 | dma->suspended = cmd == SNDRV_PCM_TRIGGER_SUSPEND; | ||
748 | if (dma->running && dma->suspended) | ||
749 | dma->saved_curptr = readl(chip->remap_addr + | ||
750 | dma->ops->dt_cur); | ||
743 | dma->ops->enable_transfer(chip, 0); | 751 | dma->ops->enable_transfer(chip, 0); |
744 | dma->running = 0; | 752 | dma->running = 0; |
745 | dma->suspended = cmd == SNDRV_PCM_TRIGGER_SUSPEND; | ||
746 | break; | 753 | break; |
747 | default: | 754 | default: |
748 | err = -EINVAL; | 755 | err = -EINVAL; |
@@ -1479,14 +1486,6 @@ static int snd_atiixp_suspend(struct device *dev) | |||
1479 | int i; | 1486 | int i; |
1480 | 1487 | ||
1481 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1488 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1482 | for (i = 0; i < NUM_ATI_PCMDEVS; i++) | ||
1483 | if (chip->pcmdevs[i]) { | ||
1484 | struct atiixp_dma *dma = &chip->dmas[i]; | ||
1485 | if (dma->substream && dma->running) | ||
1486 | dma->saved_curptr = readl(chip->remap_addr + | ||
1487 | dma->ops->dt_cur); | ||
1488 | snd_pcm_suspend_all(chip->pcmdevs[i]); | ||
1489 | } | ||
1490 | for (i = 0; i < NUM_ATI_CODECS; i++) | 1489 | for (i = 0; i < NUM_ATI_CODECS; i++) |
1491 | snd_ac97_suspend(chip->ac97[i]); | 1490 | snd_ac97_suspend(chip->ac97[i]); |
1492 | snd_atiixp_aclink_down(chip); | 1491 | snd_atiixp_aclink_down(chip); |
@@ -1514,8 +1513,6 @@ static int snd_atiixp_resume(struct device *dev) | |||
1514 | dma->substream->ops->prepare(dma->substream); | 1513 | dma->substream->ops->prepare(dma->substream); |
1515 | writel((u32)dma->desc_buf.addr | ATI_REG_LINKPTR_EN, | 1514 | writel((u32)dma->desc_buf.addr | ATI_REG_LINKPTR_EN, |
1516 | chip->remap_addr + dma->ops->llp_offset); | 1515 | chip->remap_addr + dma->ops->llp_offset); |
1517 | writel(dma->saved_curptr, chip->remap_addr + | ||
1518 | dma->ops->dt_cur); | ||
1519 | } | 1516 | } |
1520 | } | 1517 | } |
1521 | 1518 | ||
@@ -1546,10 +1543,7 @@ static void snd_atiixp_proc_read(struct snd_info_entry *entry, | |||
1546 | 1543 | ||
1547 | static void snd_atiixp_proc_init(struct atiixp *chip) | 1544 | static void snd_atiixp_proc_init(struct atiixp *chip) |
1548 | { | 1545 | { |
1549 | struct snd_info_entry *entry; | 1546 | snd_card_ro_proc_new(chip->card, "atiixp", chip, snd_atiixp_proc_read); |
1550 | |||
1551 | if (! snd_card_proc_new(chip->card, "atiixp", &entry)) | ||
1552 | snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read); | ||
1553 | } | 1547 | } |
1554 | 1548 | ||
1555 | 1549 | ||
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index dc1de860cedf..cece66bb3644 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c | |||
@@ -1125,8 +1125,6 @@ static int snd_atiixp_suspend(struct device *dev) | |||
1125 | int i; | 1125 | int i; |
1126 | 1126 | ||
1127 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1127 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1128 | for (i = 0; i < NUM_ATI_PCMDEVS; i++) | ||
1129 | snd_pcm_suspend_all(chip->pcmdevs[i]); | ||
1130 | for (i = 0; i < NUM_ATI_CODECS; i++) | 1128 | for (i = 0; i < NUM_ATI_CODECS; i++) |
1131 | snd_ac97_suspend(chip->ac97[i]); | 1129 | snd_ac97_suspend(chip->ac97[i]); |
1132 | snd_atiixp_aclink_down(chip); | 1130 | snd_atiixp_aclink_down(chip); |
@@ -1172,10 +1170,8 @@ static void snd_atiixp_proc_read(struct snd_info_entry *entry, | |||
1172 | 1170 | ||
1173 | static void snd_atiixp_proc_init(struct atiixp_modem *chip) | 1171 | static void snd_atiixp_proc_init(struct atiixp_modem *chip) |
1174 | { | 1172 | { |
1175 | struct snd_info_entry *entry; | 1173 | snd_card_ro_proc_new(chip->card, "atiixp-modem", chip, |
1176 | 1174 | snd_atiixp_proc_read); | |
1177 | if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry)) | ||
1178 | snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read); | ||
1179 | } | 1175 | } |
1180 | 1176 | ||
1181 | 1177 | ||
diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c index 9a49e4243a9c..b07c5fc1da56 100644 --- a/sound/pci/aw2/aw2-alsa.c +++ b/sound/pci/aw2/aw2-alsa.c | |||
@@ -624,15 +624,10 @@ static int snd_aw2_new_pcm(struct aw2 *chip) | |||
624 | 624 | ||
625 | /* pre-allocation of buffers */ | 625 | /* pre-allocation of buffers */ |
626 | /* Preallocate continuous pages. */ | 626 | /* Preallocate continuous pages. */ |
627 | err = snd_pcm_lib_preallocate_pages_for_all(pcm_playback_ana, | 627 | snd_pcm_lib_preallocate_pages_for_all(pcm_playback_ana, |
628 | SNDRV_DMA_TYPE_DEV, | 628 | SNDRV_DMA_TYPE_DEV, |
629 | snd_dma_pci_data | 629 | snd_dma_pci_data(chip->pci), |
630 | (chip->pci), | 630 | 64 * 1024, 64 * 1024); |
631 | 64 * 1024, 64 * 1024); | ||
632 | if (err) | ||
633 | dev_err(chip->card->dev, | ||
634 | "snd_pcm_lib_preallocate_pages_for_all error (0x%X)\n", | ||
635 | err); | ||
636 | 631 | ||
637 | err = snd_pcm_new(chip->card, "Audiowerk2 digital playback", 1, 1, 0, | 632 | err = snd_pcm_new(chip->card, "Audiowerk2 digital playback", 1, 1, 0, |
638 | &pcm_playback_num); | 633 | &pcm_playback_num); |
@@ -661,15 +656,10 @@ static int snd_aw2_new_pcm(struct aw2 *chip) | |||
661 | 656 | ||
662 | /* pre-allocation of buffers */ | 657 | /* pre-allocation of buffers */ |
663 | /* Preallocate continuous pages. */ | 658 | /* Preallocate continuous pages. */ |
664 | err = snd_pcm_lib_preallocate_pages_for_all(pcm_playback_num, | 659 | snd_pcm_lib_preallocate_pages_for_all(pcm_playback_num, |
665 | SNDRV_DMA_TYPE_DEV, | 660 | SNDRV_DMA_TYPE_DEV, |
666 | snd_dma_pci_data | 661 | snd_dma_pci_data(chip->pci), |
667 | (chip->pci), | 662 | 64 * 1024, 64 * 1024); |
668 | 64 * 1024, 64 * 1024); | ||
669 | if (err) | ||
670 | dev_err(chip->card->dev, | ||
671 | "snd_pcm_lib_preallocate_pages_for_all error (0x%X)\n", | ||
672 | err); | ||
673 | 663 | ||
674 | err = snd_pcm_new(chip->card, "Audiowerk2 capture", 2, 0, 1, | 664 | err = snd_pcm_new(chip->card, "Audiowerk2 capture", 2, 0, 1, |
675 | &pcm_capture); | 665 | &pcm_capture); |
@@ -699,16 +689,10 @@ static int snd_aw2_new_pcm(struct aw2 *chip) | |||
699 | 689 | ||
700 | /* pre-allocation of buffers */ | 690 | /* pre-allocation of buffers */ |
701 | /* Preallocate continuous pages. */ | 691 | /* Preallocate continuous pages. */ |
702 | err = snd_pcm_lib_preallocate_pages_for_all(pcm_capture, | 692 | snd_pcm_lib_preallocate_pages_for_all(pcm_capture, |
703 | SNDRV_DMA_TYPE_DEV, | 693 | SNDRV_DMA_TYPE_DEV, |
704 | snd_dma_pci_data | 694 | snd_dma_pci_data(chip->pci), |
705 | (chip->pci), | 695 | 64 * 1024, 64 * 1024); |
706 | 64 * 1024, 64 * 1024); | ||
707 | if (err) | ||
708 | dev_err(chip->card->dev, | ||
709 | "snd_pcm_lib_preallocate_pages_for_all error (0x%X)\n", | ||
710 | err); | ||
711 | |||
712 | 696 | ||
713 | /* Create control */ | 697 | /* Create control */ |
714 | err = snd_ctl_add(chip->card, snd_ctl_new1(&aw2_control, chip)); | 698 | err = snd_ctl_add(chip->card, snd_ctl_new1(&aw2_control, chip)); |
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index fc18c29a8173..90348817f096 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -2699,10 +2699,6 @@ snd_azf3328_suspend(struct device *dev) | |||
2699 | 2699 | ||
2700 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2700 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2701 | 2701 | ||
2702 | /* same pcm object for playback/capture */ | ||
2703 | snd_pcm_suspend_all(chip->pcm[AZF_CODEC_PLAYBACK]); | ||
2704 | snd_pcm_suspend_all(chip->pcm[AZF_CODEC_I2S_OUT]); | ||
2705 | |||
2706 | snd_azf3328_suspend_ac97(chip); | 2702 | snd_azf3328_suspend_ac97(chip); |
2707 | 2703 | ||
2708 | snd_azf3328_suspend_regs(chip, chip->ctrl_io, | 2704 | snd_azf3328_suspend_regs(chip, chip->ctrl_io, |
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index ba971042f871..0adcba10c067 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c | |||
@@ -714,11 +714,11 @@ static int snd_bt87x_pcm(struct snd_bt87x *chip, int device, char *name) | |||
714 | pcm->private_data = chip; | 714 | pcm->private_data = chip; |
715 | strcpy(pcm->name, name); | 715 | strcpy(pcm->name, name); |
716 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_bt87x_pcm_ops); | 716 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_bt87x_pcm_ops); |
717 | return snd_pcm_lib_preallocate_pages_for_all(pcm, | 717 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
718 | SNDRV_DMA_TYPE_DEV_SG, | 718 | snd_dma_pci_data(chip->pci), |
719 | snd_dma_pci_data(chip->pci), | 719 | 128 * 1024, |
720 | 128 * 1024, | 720 | ALIGN(255 * 4092, 1024)); |
721 | ALIGN(255 * 4092, 1024)); | 721 | return 0; |
722 | } | 722 | } |
723 | 723 | ||
724 | static int snd_bt87x_create(struct snd_card *card, | 724 | static int snd_bt87x_create(struct snd_card *card, |
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index cd27b5536654..11ef0d636405 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -1402,21 +1402,17 @@ static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device) | |||
1402 | for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; | 1402 | for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; |
1403 | substream; | 1403 | substream; |
1404 | substream = substream->next) { | 1404 | substream = substream->next) { |
1405 | if ((err = snd_pcm_lib_preallocate_pages(substream, | 1405 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, |
1406 | SNDRV_DMA_TYPE_DEV, | 1406 | snd_dma_pci_data(emu->pci), |
1407 | snd_dma_pci_data(emu->pci), | 1407 | 64*1024, 64*1024); |
1408 | 64*1024, 64*1024)) < 0) /* FIXME: 32*1024 for sound buffer, between 32and64 for Periods table. */ | ||
1409 | return err; | ||
1410 | } | 1408 | } |
1411 | 1409 | ||
1412 | for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; | 1410 | for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; |
1413 | substream; | 1411 | substream; |
1414 | substream = substream->next) { | 1412 | substream = substream->next) { |
1415 | if ((err = snd_pcm_lib_preallocate_pages(substream, | 1413 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, |
1416 | SNDRV_DMA_TYPE_DEV, | 1414 | snd_dma_pci_data(emu->pci), |
1417 | snd_dma_pci_data(emu->pci), | 1415 | 64*1024, 64*1024); |
1418 | 64*1024, 64*1024)) < 0) | ||
1419 | return err; | ||
1420 | } | 1416 | } |
1421 | 1417 | ||
1422 | err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, 2, | 1418 | err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, 2, |
@@ -1910,11 +1906,8 @@ static int snd_ca0106_suspend(struct device *dev) | |||
1910 | { | 1906 | { |
1911 | struct snd_card *card = dev_get_drvdata(dev); | 1907 | struct snd_card *card = dev_get_drvdata(dev); |
1912 | struct snd_ca0106 *chip = card->private_data; | 1908 | struct snd_ca0106 *chip = card->private_data; |
1913 | int i; | ||
1914 | 1909 | ||
1915 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1910 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1916 | for (i = 0; i < 4; i++) | ||
1917 | snd_pcm_suspend_all(chip->pcm[i]); | ||
1918 | if (chip->details->ac97) | 1911 | if (chip->details->ac97) |
1919 | snd_ac97_suspend(chip->ac97); | 1912 | snd_ac97_suspend(chip->ac97); |
1920 | snd_ca0106_mixer_suspend(chip); | 1913 | snd_ca0106_mixer_suspend(chip); |
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c index a2c85cc37972..f5b8934db735 100644 --- a/sound/pci/ca0106/ca0106_proc.c +++ b/sound/pci/ca0106/ca0106_proc.c | |||
@@ -424,30 +424,20 @@ static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry, | |||
424 | 424 | ||
425 | int snd_ca0106_proc_init(struct snd_ca0106 *emu) | 425 | int snd_ca0106_proc_init(struct snd_ca0106 *emu) |
426 | { | 426 | { |
427 | struct snd_info_entry *entry; | 427 | snd_card_ro_proc_new(emu->card, "iec958", emu, snd_ca0106_proc_iec958); |
428 | 428 | snd_card_rw_proc_new(emu->card, "ca0106_reg32", emu, | |
429 | if(! snd_card_proc_new(emu->card, "iec958", &entry)) | 429 | snd_ca0106_proc_reg_read32, |
430 | snd_info_set_text_ops(entry, emu, snd_ca0106_proc_iec958); | 430 | snd_ca0106_proc_reg_write32); |
431 | if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) { | 431 | snd_card_ro_proc_new(emu->card, "ca0106_reg16", emu, |
432 | snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read32); | 432 | snd_ca0106_proc_reg_read16); |
433 | entry->c.text.write = snd_ca0106_proc_reg_write32; | 433 | snd_card_ro_proc_new(emu->card, "ca0106_reg8", emu, |
434 | entry->mode |= 0200; | 434 | snd_ca0106_proc_reg_read8); |
435 | } | 435 | snd_card_rw_proc_new(emu->card, "ca0106_regs1", emu, |
436 | if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry)) | 436 | snd_ca0106_proc_reg_read1, |
437 | snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read16); | 437 | snd_ca0106_proc_reg_write); |
438 | if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry)) | 438 | snd_card_rw_proc_new(emu->card, "ca0106_i2c", emu, NULL, |
439 | snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read8); | 439 | snd_ca0106_proc_i2c_write); |
440 | if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) { | 440 | snd_card_ro_proc_new(emu->card, "ca0106_regs2", emu, |
441 | snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1); | 441 | snd_ca0106_proc_reg_read2); |
442 | entry->c.text.write = snd_ca0106_proc_reg_write; | ||
443 | entry->mode |= 0200; | ||
444 | } | ||
445 | if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) { | ||
446 | entry->c.text.write = snd_ca0106_proc_i2c_write; | ||
447 | entry->private_data = emu; | ||
448 | entry->mode |= 0200; | ||
449 | } | ||
450 | if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry)) | ||
451 | snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2); | ||
452 | return 0; | 442 | return 0; |
453 | } | 443 | } |
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 452cc79b44af..701be04aed53 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -2792,10 +2792,7 @@ static void snd_cmipci_proc_read(struct snd_info_entry *entry, | |||
2792 | 2792 | ||
2793 | static void snd_cmipci_proc_init(struct cmipci *cm) | 2793 | static void snd_cmipci_proc_init(struct cmipci *cm) |
2794 | { | 2794 | { |
2795 | struct snd_info_entry *entry; | 2795 | snd_card_ro_proc_new(cm->card, "cmipci", cm, snd_cmipci_proc_read); |
2796 | |||
2797 | if (! snd_card_proc_new(cm->card, "cmipci", &entry)) | ||
2798 | snd_info_set_text_ops(entry, cm, snd_cmipci_proc_read); | ||
2799 | } | 2796 | } |
2800 | 2797 | ||
2801 | static const struct pci_device_id snd_cmipci_ids[] = { | 2798 | static const struct pci_device_id snd_cmipci_ids[] = { |
@@ -3351,10 +3348,6 @@ static int snd_cmipci_suspend(struct device *dev) | |||
3351 | 3348 | ||
3352 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 3349 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
3353 | 3350 | ||
3354 | snd_pcm_suspend_all(cm->pcm); | ||
3355 | snd_pcm_suspend_all(cm->pcm2); | ||
3356 | snd_pcm_suspend_all(cm->pcm_spdif); | ||
3357 | |||
3358 | /* save registers */ | 3351 | /* save registers */ |
3359 | for (i = 0; i < ARRAY_SIZE(saved_regs); i++) | 3352 | for (i = 0; i < ARRAY_SIZE(saved_regs); i++) |
3360 | cm->saved_regs[i] = snd_cmipci_read(cm, saved_regs[i]); | 3353 | cm->saved_regs[i] = snd_cmipci_read(cm, saved_regs[i]); |
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index ec4247638fa1..15bbf9564c82 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c | |||
@@ -1174,8 +1174,7 @@ static void snd_cs4281_proc_init(struct cs4281 *chip) | |||
1174 | { | 1174 | { |
1175 | struct snd_info_entry *entry; | 1175 | struct snd_info_entry *entry; |
1176 | 1176 | ||
1177 | if (! snd_card_proc_new(chip->card, "cs4281", &entry)) | 1177 | snd_card_ro_proc_new(chip->card, "cs4281", chip, snd_cs4281_proc_read); |
1178 | snd_info_set_text_ops(entry, chip, snd_cs4281_proc_read); | ||
1179 | if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) { | 1178 | if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) { |
1180 | entry->content = SNDRV_INFO_CONTENT_DATA; | 1179 | entry->content = SNDRV_INFO_CONTENT_DATA; |
1181 | entry->private_data = chip; | 1180 | entry->private_data = chip; |
@@ -2002,8 +2001,6 @@ static int cs4281_suspend(struct device *dev) | |||
2002 | unsigned int i; | 2001 | unsigned int i; |
2003 | 2002 | ||
2004 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2003 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2005 | snd_pcm_suspend_all(chip->pcm); | ||
2006 | |||
2007 | snd_ac97_suspend(chip->ac97); | 2004 | snd_ac97_suspend(chip->ac97); |
2008 | snd_ac97_suspend(chip->ac97_secondary); | 2005 | snd_ac97_suspend(chip->ac97_secondary); |
2009 | 2006 | ||
diff --git a/sound/pci/cs46xx/cs46xx_dsp_spos.h b/sound/pci/cs46xx/cs46xx_dsp_spos.h index 8008c59288a6..a02e1e19c021 100644 --- a/sound/pci/cs46xx/cs46xx_dsp_spos.h +++ b/sound/pci/cs46xx/cs46xx_dsp_spos.h | |||
@@ -177,22 +177,16 @@ struct dsp_spos_instance { | |||
177 | /* proc fs */ | 177 | /* proc fs */ |
178 | struct snd_card *snd_card; | 178 | struct snd_card *snd_card; |
179 | struct snd_info_entry * proc_dsp_dir; | 179 | struct snd_info_entry * proc_dsp_dir; |
180 | struct snd_info_entry * proc_sym_info_entry; | ||
181 | struct snd_info_entry * proc_modules_info_entry; | ||
182 | struct snd_info_entry * proc_parameter_dump_info_entry; | ||
183 | struct snd_info_entry * proc_sample_dump_info_entry; | ||
184 | 180 | ||
185 | /* SCB's descriptors */ | 181 | /* SCB's descriptors */ |
186 | int nscb; | 182 | int nscb; |
187 | int scb_highest_frag_index; | 183 | int scb_highest_frag_index; |
188 | struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC]; | 184 | struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC]; |
189 | struct snd_info_entry * proc_scb_info_entry; | ||
190 | struct dsp_scb_descriptor * the_null_scb; | 185 | struct dsp_scb_descriptor * the_null_scb; |
191 | 186 | ||
192 | /* Task's descriptors */ | 187 | /* Task's descriptors */ |
193 | int ntask; | 188 | int ntask; |
194 | struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC]; | 189 | struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC]; |
195 | struct snd_info_entry * proc_task_info_entry; | ||
196 | 190 | ||
197 | /* SPDIF status */ | 191 | /* SPDIF status */ |
198 | int spdif_status_out; | 192 | int spdif_status_out; |
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 750eec437a79..a77d4cc44028 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -3781,12 +3781,6 @@ static int snd_cs46xx_suspend(struct device *dev) | |||
3781 | 3781 | ||
3782 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 3782 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
3783 | chip->in_suspend = 1; | 3783 | chip->in_suspend = 1; |
3784 | snd_pcm_suspend_all(chip->pcm); | ||
3785 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | ||
3786 | snd_pcm_suspend_all(chip->pcm_rear); | ||
3787 | snd_pcm_suspend_all(chip->pcm_center_lfe); | ||
3788 | snd_pcm_suspend_all(chip->pcm_iec958); | ||
3789 | #endif | ||
3790 | // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL); | 3784 | // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL); |
3791 | // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE); | 3785 | // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE); |
3792 | 3786 | ||
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 5fc497c6d738..c28e58602679 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c | |||
@@ -799,92 +799,49 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip) | |||
799 | 799 | ||
800 | ins->snd_card = card; | 800 | ins->snd_card = card; |
801 | 801 | ||
802 | if ((entry = snd_info_create_card_entry(card, "dsp", card->proc_root)) != NULL) { | 802 | entry = snd_info_create_card_entry(card, "dsp", card->proc_root); |
803 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 803 | if (entry) |
804 | entry->mode = S_IFDIR | 0555; | 804 | entry->mode = S_IFDIR | 0555; |
805 | |||
806 | if (snd_info_register(entry) < 0) { | ||
807 | snd_info_free_entry(entry); | ||
808 | entry = NULL; | ||
809 | } | ||
810 | } | ||
811 | |||
812 | ins->proc_dsp_dir = entry; | 805 | ins->proc_dsp_dir = entry; |
813 | 806 | ||
814 | if (!ins->proc_dsp_dir) | 807 | if (!ins->proc_dsp_dir) |
815 | return -ENOMEM; | 808 | return -ENOMEM; |
816 | 809 | ||
817 | if ((entry = snd_info_create_card_entry(card, "spos_symbols", ins->proc_dsp_dir)) != NULL) { | 810 | entry = snd_info_create_card_entry(card, "spos_symbols", |
818 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 811 | ins->proc_dsp_dir); |
819 | entry->private_data = chip; | 812 | if (entry) |
820 | entry->mode = S_IFREG | 0644; | 813 | snd_info_set_text_ops(entry, chip, |
821 | entry->c.text.read = cs46xx_dsp_proc_symbol_table_read; | 814 | cs46xx_dsp_proc_symbol_table_read); |
822 | if (snd_info_register(entry) < 0) { | ||
823 | snd_info_free_entry(entry); | ||
824 | entry = NULL; | ||
825 | } | ||
826 | } | ||
827 | ins->proc_sym_info_entry = entry; | ||
828 | 815 | ||
829 | if ((entry = snd_info_create_card_entry(card, "spos_modules", ins->proc_dsp_dir)) != NULL) { | 816 | entry = snd_info_create_card_entry(card, "spos_modules", |
830 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 817 | ins->proc_dsp_dir); |
831 | entry->private_data = chip; | 818 | if (entry) |
832 | entry->mode = S_IFREG | 0644; | 819 | snd_info_set_text_ops(entry, chip, |
833 | entry->c.text.read = cs46xx_dsp_proc_modules_read; | 820 | cs46xx_dsp_proc_modules_read); |
834 | if (snd_info_register(entry) < 0) { | 821 | |
835 | snd_info_free_entry(entry); | 822 | entry = snd_info_create_card_entry(card, "parameter", |
836 | entry = NULL; | 823 | ins->proc_dsp_dir); |
837 | } | 824 | if (entry) |
838 | } | 825 | snd_info_set_text_ops(entry, chip, |
839 | ins->proc_modules_info_entry = entry; | 826 | cs46xx_dsp_proc_parameter_dump_read); |
840 | 827 | ||
841 | if ((entry = snd_info_create_card_entry(card, "parameter", ins->proc_dsp_dir)) != NULL) { | 828 | entry = snd_info_create_card_entry(card, "sample", |
842 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 829 | ins->proc_dsp_dir); |
843 | entry->private_data = chip; | 830 | if (entry) |
844 | entry->mode = S_IFREG | 0644; | 831 | snd_info_set_text_ops(entry, chip, |
845 | entry->c.text.read = cs46xx_dsp_proc_parameter_dump_read; | 832 | cs46xx_dsp_proc_sample_dump_read); |
846 | if (snd_info_register(entry) < 0) { | 833 | |
847 | snd_info_free_entry(entry); | 834 | entry = snd_info_create_card_entry(card, "task_tree", |
848 | entry = NULL; | 835 | ins->proc_dsp_dir); |
849 | } | 836 | if (entry) |
850 | } | 837 | snd_info_set_text_ops(entry, chip, |
851 | ins->proc_parameter_dump_info_entry = entry; | 838 | cs46xx_dsp_proc_task_tree_read); |
852 | 839 | ||
853 | if ((entry = snd_info_create_card_entry(card, "sample", ins->proc_dsp_dir)) != NULL) { | 840 | entry = snd_info_create_card_entry(card, "scb_info", |
854 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 841 | ins->proc_dsp_dir); |
855 | entry->private_data = chip; | 842 | if (entry) |
856 | entry->mode = S_IFREG | 0644; | 843 | snd_info_set_text_ops(entry, chip, |
857 | entry->c.text.read = cs46xx_dsp_proc_sample_dump_read; | 844 | cs46xx_dsp_proc_scb_read); |
858 | if (snd_info_register(entry) < 0) { | ||
859 | snd_info_free_entry(entry); | ||
860 | entry = NULL; | ||
861 | } | ||
862 | } | ||
863 | ins->proc_sample_dump_info_entry = entry; | ||
864 | |||
865 | if ((entry = snd_info_create_card_entry(card, "task_tree", ins->proc_dsp_dir)) != NULL) { | ||
866 | entry->content = SNDRV_INFO_CONTENT_TEXT; | ||
867 | entry->private_data = chip; | ||
868 | entry->mode = S_IFREG | 0644; | ||
869 | entry->c.text.read = cs46xx_dsp_proc_task_tree_read; | ||
870 | if (snd_info_register(entry) < 0) { | ||
871 | snd_info_free_entry(entry); | ||
872 | entry = NULL; | ||
873 | } | ||
874 | } | ||
875 | ins->proc_task_info_entry = entry; | ||
876 | |||
877 | if ((entry = snd_info_create_card_entry(card, "scb_info", ins->proc_dsp_dir)) != NULL) { | ||
878 | entry->content = SNDRV_INFO_CONTENT_TEXT; | ||
879 | entry->private_data = chip; | ||
880 | entry->mode = S_IFREG | 0644; | ||
881 | entry->c.text.read = cs46xx_dsp_proc_scb_read; | ||
882 | if (snd_info_register(entry) < 0) { | ||
883 | snd_info_free_entry(entry); | ||
884 | entry = NULL; | ||
885 | } | ||
886 | } | ||
887 | ins->proc_scb_info_entry = entry; | ||
888 | 845 | ||
889 | mutex_lock(&chip->spos_mutex); | 846 | mutex_lock(&chip->spos_mutex); |
890 | /* register/update SCB's entries on proc */ | 847 | /* register/update SCB's entries on proc */ |
@@ -906,24 +863,6 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) | |||
906 | if (!ins) | 863 | if (!ins) |
907 | return 0; | 864 | return 0; |
908 | 865 | ||
909 | snd_info_free_entry(ins->proc_sym_info_entry); | ||
910 | ins->proc_sym_info_entry = NULL; | ||
911 | |||
912 | snd_info_free_entry(ins->proc_modules_info_entry); | ||
913 | ins->proc_modules_info_entry = NULL; | ||
914 | |||
915 | snd_info_free_entry(ins->proc_parameter_dump_info_entry); | ||
916 | ins->proc_parameter_dump_info_entry = NULL; | ||
917 | |||
918 | snd_info_free_entry(ins->proc_sample_dump_info_entry); | ||
919 | ins->proc_sample_dump_info_entry = NULL; | ||
920 | |||
921 | snd_info_free_entry(ins->proc_scb_info_entry); | ||
922 | ins->proc_scb_info_entry = NULL; | ||
923 | |||
924 | snd_info_free_entry(ins->proc_task_info_entry); | ||
925 | ins->proc_task_info_entry = NULL; | ||
926 | |||
927 | mutex_lock(&chip->spos_mutex); | 866 | mutex_lock(&chip->spos_mutex); |
928 | for (i = 0; i < ins->nscb; ++i) { | 867 | for (i = 0; i < ins->nscb; ++i) { |
929 | if (ins->scbs[i].deleted) continue; | 868 | if (ins->scbs[i].deleted) continue; |
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 8d0a3d357345..1d9d610262de 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c | |||
@@ -254,8 +254,9 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, | |||
254 | if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL && | 254 | if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL && |
255 | scb->proc_info == NULL) { | 255 | scb->proc_info == NULL) { |
256 | 256 | ||
257 | if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, | 257 | entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, |
258 | ins->proc_dsp_dir)) != NULL) { | 258 | ins->proc_dsp_dir); |
259 | if (entry) { | ||
259 | scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL); | 260 | scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL); |
260 | if (!scb_info) { | 261 | if (!scb_info) { |
261 | snd_info_free_entry(entry); | 262 | snd_info_free_entry(entry); |
@@ -265,18 +266,8 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, | |||
265 | 266 | ||
266 | scb_info->chip = chip; | 267 | scb_info->chip = chip; |
267 | scb_info->scb_desc = scb; | 268 | scb_info->scb_desc = scb; |
268 | 269 | snd_info_set_text_ops(entry, scb_info, | |
269 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 270 | cs46xx_dsp_proc_scb_info_read); |
270 | entry->private_data = scb_info; | ||
271 | entry->mode = S_IFREG | 0644; | ||
272 | |||
273 | entry->c.text.read = cs46xx_dsp_proc_scb_info_read; | ||
274 | |||
275 | if (snd_info_register(entry) < 0) { | ||
276 | snd_info_free_entry(entry); | ||
277 | kfree (scb_info); | ||
278 | entry = NULL; | ||
279 | } | ||
280 | } | 271 | } |
281 | out: | 272 | out: |
282 | scb->proc_info = entry; | 273 | scb->proc_info = entry; |
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c index 82bd10b68a77..446ef1f1b45a 100644 --- a/sound/pci/cs5535audio/cs5535audio_pm.c +++ b/sound/pci/cs5535audio/cs5535audio_pm.c | |||
@@ -62,7 +62,6 @@ static int __maybe_unused snd_cs5535audio_suspend(struct device *dev) | |||
62 | int i; | 62 | int i; |
63 | 63 | ||
64 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 64 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
65 | snd_pcm_suspend_all(cs5535au->pcm); | ||
66 | snd_ac97_suspend(cs5535au->ac97); | 65 | snd_ac97_suspend(cs5535au->ac97); |
67 | for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) { | 66 | for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) { |
68 | struct cs5535audio_dma *dma = &cs5535au->dmas[i]; | 67 | struct cs5535audio_dma *dma = &cs5535au->dmas[i]; |
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 2ada8444abd9..e622613ea947 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
@@ -1548,18 +1548,10 @@ static void atc_connect_resources(struct ct_atc *atc) | |||
1548 | #ifdef CONFIG_PM_SLEEP | 1548 | #ifdef CONFIG_PM_SLEEP |
1549 | static int atc_suspend(struct ct_atc *atc) | 1549 | static int atc_suspend(struct ct_atc *atc) |
1550 | { | 1550 | { |
1551 | int i; | ||
1552 | struct hw *hw = atc->hw; | 1551 | struct hw *hw = atc->hw; |
1553 | 1552 | ||
1554 | snd_power_change_state(atc->card, SNDRV_CTL_POWER_D3hot); | 1553 | snd_power_change_state(atc->card, SNDRV_CTL_POWER_D3hot); |
1555 | 1554 | ||
1556 | for (i = FRONT; i < NUM_PCMS; i++) { | ||
1557 | if (!atc->pcms[i]) | ||
1558 | continue; | ||
1559 | |||
1560 | snd_pcm_suspend_all(atc->pcms[i]); | ||
1561 | } | ||
1562 | |||
1563 | atc_release_resources(atc); | 1555 | atc_release_resources(atc); |
1564 | 1556 | ||
1565 | hw->suspend(hw); | 1557 | hw->suspend(hw); |
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 907cf1a46712..ea876b0b02b9 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -884,17 +884,15 @@ static const struct snd_pcm_ops digital_capture_ops = { | |||
884 | static int snd_echo_preallocate_pages(struct snd_pcm *pcm, struct device *dev) | 884 | static int snd_echo_preallocate_pages(struct snd_pcm *pcm, struct device *dev) |
885 | { | 885 | { |
886 | struct snd_pcm_substream *ss; | 886 | struct snd_pcm_substream *ss; |
887 | int stream, err; | 887 | int stream; |
888 | 888 | ||
889 | for (stream = 0; stream < 2; stream++) | 889 | for (stream = 0; stream < 2; stream++) |
890 | for (ss = pcm->streams[stream].substream; ss; ss = ss->next) { | 890 | for (ss = pcm->streams[stream].substream; ss; ss = ss->next) |
891 | err = snd_pcm_lib_preallocate_pages(ss, SNDRV_DMA_TYPE_DEV_SG, | 891 | snd_pcm_lib_preallocate_pages(ss, SNDRV_DMA_TYPE_DEV_SG, |
892 | dev, | 892 | dev, |
893 | ss->number ? 0 : 128<<10, | 893 | ss->number ? 0 : 128<<10, |
894 | 256<<10); | 894 | 256<<10); |
895 | if (err < 0) | 895 | |
896 | return err; | ||
897 | } | ||
898 | return 0; | 896 | return 0; |
899 | } | 897 | } |
900 | 898 | ||
@@ -2165,9 +2163,6 @@ static int snd_echo_suspend(struct device *dev) | |||
2165 | { | 2163 | { |
2166 | struct echoaudio *chip = dev_get_drvdata(dev); | 2164 | struct echoaudio *chip = dev_get_drvdata(dev); |
2167 | 2165 | ||
2168 | snd_pcm_suspend_all(chip->analog_pcm); | ||
2169 | snd_pcm_suspend_all(chip->digital_pcm); | ||
2170 | |||
2171 | #ifdef ECHOCARD_HAS_MIDI | 2166 | #ifdef ECHOCARD_HAS_MIDI |
2172 | /* This call can sleep */ | 2167 | /* This call can sleep */ |
2173 | if (chip->midi_out) | 2168 | if (chip->midi_out) |
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index d3203df50a1a..3c41a0edcfb0 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c | |||
@@ -224,12 +224,6 @@ static int snd_emu10k1_suspend(struct device *dev) | |||
224 | 224 | ||
225 | cancel_delayed_work_sync(&emu->emu1010.firmware_work); | 225 | cancel_delayed_work_sync(&emu->emu1010.firmware_work); |
226 | 226 | ||
227 | snd_pcm_suspend_all(emu->pcm); | ||
228 | snd_pcm_suspend_all(emu->pcm_mic); | ||
229 | snd_pcm_suspend_all(emu->pcm_efx); | ||
230 | snd_pcm_suspend_all(emu->pcm_multi); | ||
231 | snd_pcm_suspend_all(emu->pcm_p16v); | ||
232 | |||
233 | snd_ac97_suspend(emu->ac97); | 227 | snd_ac97_suspend(emu->ac97); |
234 | 228 | ||
235 | snd_emu10k1_efx_suspend(emu); | 229 | snd_emu10k1_efx_suspend(emu); |
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 611589cbdad6..576c7bd03a1a 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c | |||
@@ -1065,15 +1065,9 @@ static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry, | |||
1065 | 1065 | ||
1066 | static int snd_emu10k1x_proc_init(struct emu10k1x *emu) | 1066 | static int snd_emu10k1x_proc_init(struct emu10k1x *emu) |
1067 | { | 1067 | { |
1068 | struct snd_info_entry *entry; | 1068 | snd_card_rw_proc_new(emu->card, "emu10k1x_regs", emu, |
1069 | 1069 | snd_emu10k1x_proc_reg_read, | |
1070 | if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) { | 1070 | snd_emu10k1x_proc_reg_write); |
1071 | snd_info_set_text_ops(entry, emu, snd_emu10k1x_proc_reg_read); | ||
1072 | entry->c.text.write = snd_emu10k1x_proc_reg_write; | ||
1073 | entry->mode |= 0200; | ||
1074 | entry->private_data = emu; | ||
1075 | } | ||
1076 | |||
1077 | return 0; | 1071 | return 0; |
1078 | } | 1072 | } |
1079 | 1073 | ||
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 30b3472d0b75..f6b4cb9ac75c 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c | |||
@@ -1427,11 +1427,14 @@ int snd_emu10k1_pcm(struct snd_emu10k1 *emu, int device) | |||
1427 | emu->pcm = pcm; | 1427 | emu->pcm = pcm; |
1428 | 1428 | ||
1429 | for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) | 1429 | for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) |
1430 | if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0) | 1430 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, |
1431 | return err; | 1431 | snd_dma_pci_data(emu->pci), |
1432 | 64*1024, 64*1024); | ||
1432 | 1433 | ||
1433 | for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substream->next) | 1434 | for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substream->next) |
1434 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); | 1435 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, |
1436 | snd_dma_pci_data(emu->pci), | ||
1437 | 64*1024, 64*1024); | ||
1435 | 1438 | ||
1436 | return 0; | 1439 | return 0; |
1437 | } | 1440 | } |
@@ -1455,8 +1458,9 @@ int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device) | |||
1455 | emu->pcm_multi = pcm; | 1458 | emu->pcm_multi = pcm; |
1456 | 1459 | ||
1457 | for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) | 1460 | for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) |
1458 | if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0) | 1461 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, |
1459 | return err; | 1462 | snd_dma_pci_data(emu->pci), |
1463 | 64*1024, 64*1024); | ||
1460 | 1464 | ||
1461 | return 0; | 1465 | return 0; |
1462 | } | 1466 | } |
@@ -1489,7 +1493,9 @@ int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device) | |||
1489 | strcpy(pcm->name, "Mic Capture"); | 1493 | strcpy(pcm->name, "Mic Capture"); |
1490 | emu->pcm_mic = pcm; | 1494 | emu->pcm_mic = pcm; |
1491 | 1495 | ||
1492 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); | 1496 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
1497 | snd_dma_pci_data(emu->pci), | ||
1498 | 64*1024, 64*1024); | ||
1493 | 1499 | ||
1494 | return 0; | 1500 | return 0; |
1495 | } | 1501 | } |
@@ -1862,7 +1868,9 @@ int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device) | |||
1862 | if (err < 0) | 1868 | if (err < 0) |
1863 | return err; | 1869 | return err; |
1864 | 1870 | ||
1865 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); | 1871 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
1872 | snd_dma_pci_data(emu->pci), | ||
1873 | 64*1024, 64*1024); | ||
1866 | 1874 | ||
1867 | return 0; | 1875 | return 0; |
1868 | } | 1876 | } |
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c index b57008031792..a3d9f06e8e6a 100644 --- a/sound/pci/emu10k1/emuproc.c +++ b/sound/pci/emu10k1/emuproc.c | |||
@@ -568,55 +568,40 @@ int snd_emu10k1_proc_init(struct snd_emu10k1 *emu) | |||
568 | struct snd_info_entry *entry; | 568 | struct snd_info_entry *entry; |
569 | #ifdef CONFIG_SND_DEBUG | 569 | #ifdef CONFIG_SND_DEBUG |
570 | if (emu->card_capabilities->emu_model) { | 570 | if (emu->card_capabilities->emu_model) { |
571 | if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry)) | 571 | snd_card_ro_proc_new(emu->card, "emu1010_regs", |
572 | snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read); | 572 | emu, snd_emu_proc_emu1010_reg_read); |
573 | } | ||
574 | if (! snd_card_proc_new(emu->card, "io_regs", &entry)) { | ||
575 | snd_info_set_text_ops(entry, emu, snd_emu_proc_io_reg_read); | ||
576 | entry->c.text.write = snd_emu_proc_io_reg_write; | ||
577 | entry->mode |= 0200; | ||
578 | } | ||
579 | if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) { | ||
580 | snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00a); | ||
581 | entry->c.text.write = snd_emu_proc_ptr_reg_write00; | ||
582 | entry->mode |= 0200; | ||
583 | } | ||
584 | if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) { | ||
585 | snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00b); | ||
586 | entry->c.text.write = snd_emu_proc_ptr_reg_write00; | ||
587 | entry->mode |= 0200; | ||
588 | } | ||
589 | if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) { | ||
590 | snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20a); | ||
591 | entry->c.text.write = snd_emu_proc_ptr_reg_write20; | ||
592 | entry->mode |= 0200; | ||
593 | } | ||
594 | if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) { | ||
595 | snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20b); | ||
596 | entry->c.text.write = snd_emu_proc_ptr_reg_write20; | ||
597 | entry->mode |= 0200; | ||
598 | } | ||
599 | if (! snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) { | ||
600 | snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20c); | ||
601 | entry->c.text.write = snd_emu_proc_ptr_reg_write20; | ||
602 | entry->mode |= 0200; | ||
603 | } | 573 | } |
574 | snd_card_rw_proc_new(emu->card, "io_regs", emu, | ||
575 | snd_emu_proc_io_reg_read, | ||
576 | snd_emu_proc_io_reg_write); | ||
577 | snd_card_rw_proc_new(emu->card, "ptr_regs00a", emu, | ||
578 | snd_emu_proc_ptr_reg_read00a, | ||
579 | snd_emu_proc_ptr_reg_write00); | ||
580 | snd_card_rw_proc_new(emu->card, "ptr_regs00b", emu, | ||
581 | snd_emu_proc_ptr_reg_read00b, | ||
582 | snd_emu_proc_ptr_reg_write00); | ||
583 | snd_card_rw_proc_new(emu->card, "ptr_regs20a", emu, | ||
584 | snd_emu_proc_ptr_reg_read20a, | ||
585 | snd_emu_proc_ptr_reg_write20); | ||
586 | snd_card_rw_proc_new(emu->card, "ptr_regs20b", emu, | ||
587 | snd_emu_proc_ptr_reg_read20b, | ||
588 | snd_emu_proc_ptr_reg_write20); | ||
589 | snd_card_rw_proc_new(emu->card, "ptr_regs20c", emu, | ||
590 | snd_emu_proc_ptr_reg_read20c, | ||
591 | snd_emu_proc_ptr_reg_write20); | ||
604 | #endif | 592 | #endif |
605 | 593 | ||
606 | if (! snd_card_proc_new(emu->card, "emu10k1", &entry)) | 594 | snd_card_ro_proc_new(emu->card, "emu10k1", emu, snd_emu10k1_proc_read); |
607 | snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_read); | ||
608 | 595 | ||
609 | if (emu->card_capabilities->emu10k2_chip) { | 596 | if (emu->card_capabilities->emu10k2_chip) |
610 | if (! snd_card_proc_new(emu->card, "spdif-in", &entry)) | 597 | snd_card_ro_proc_new(emu->card, "spdif-in", emu, |
611 | snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_spdif_read); | 598 | snd_emu10k1_proc_spdif_read); |
612 | } | 599 | if (emu->card_capabilities->ca0151_chip) |
613 | if (emu->card_capabilities->ca0151_chip) { | 600 | snd_card_ro_proc_new(emu->card, "capture-rates", emu, |
614 | if (! snd_card_proc_new(emu->card, "capture-rates", &entry)) | 601 | snd_emu10k1_proc_rates_read); |
615 | snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_rates_read); | ||
616 | } | ||
617 | 602 | ||
618 | if (! snd_card_proc_new(emu->card, "voices", &entry)) | 603 | snd_card_ro_proc_new(emu->card, "voices", emu, |
619 | snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_voices_read); | 604 | snd_emu10k1_proc_voices_read); |
620 | 605 | ||
621 | if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) { | 606 | if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) { |
622 | entry->content = SNDRV_INFO_CONTENT_DATA; | 607 | entry->content = SNDRV_INFO_CONTENT_DATA; |
@@ -646,11 +631,7 @@ int snd_emu10k1_proc_init(struct snd_emu10k1 *emu) | |||
646 | entry->size = emu->audigy ? A_TOTAL_SIZE_CODE : TOTAL_SIZE_CODE; | 631 | entry->size = emu->audigy ? A_TOTAL_SIZE_CODE : TOTAL_SIZE_CODE; |
647 | entry->c.ops = &snd_emu10k1_proc_ops_fx8010; | 632 | entry->c.ops = &snd_emu10k1_proc_ops_fx8010; |
648 | } | 633 | } |
649 | if (! snd_card_proc_new(emu->card, "fx8010_acode", &entry)) { | 634 | snd_card_ro_proc_new(emu->card, "fx8010_acode", emu, |
650 | entry->content = SNDRV_INFO_CONTENT_TEXT; | 635 | snd_emu10k1_proc_acode_read); |
651 | entry->private_data = emu; | ||
652 | entry->mode = S_IFREG | 0444 /*| S_IWUSR*/; | ||
653 | entry->c.text.read = snd_emu10k1_proc_acode_read; | ||
654 | } | ||
655 | return 0; | 636 | return 0; |
656 | } | 637 | } |
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c index 4948b95f6665..672017cac4c7 100644 --- a/sound/pci/emu10k1/p16v.c +++ b/sound/pci/emu10k1/p16v.c | |||
@@ -656,11 +656,10 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device) | |||
656 | for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; | 656 | for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; |
657 | substream; | 657 | substream; |
658 | substream = substream->next) { | 658 | substream = substream->next) { |
659 | if ((err = snd_pcm_lib_preallocate_pages(substream, | 659 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, |
660 | SNDRV_DMA_TYPE_DEV, | 660 | snd_dma_pci_data(emu->pci), |
661 | snd_dma_pci_data(emu->pci), | 661 | (65536 - 64) * 8, |
662 | ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0) | 662 | (65536 - 64) * 8); |
663 | return err; | ||
664 | /* | 663 | /* |
665 | dev_dbg(emu->card->dev, | 664 | dev_dbg(emu->card->dev, |
666 | "preallocate playback substream: err=%d\n", err); | 665 | "preallocate playback substream: err=%d\n", err); |
@@ -670,11 +669,9 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device) | |||
670 | for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; | 669 | for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; |
671 | substream; | 670 | substream; |
672 | substream = substream->next) { | 671 | substream = substream->next) { |
673 | if ((err = snd_pcm_lib_preallocate_pages(substream, | 672 | snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, |
674 | SNDRV_DMA_TYPE_DEV, | 673 | snd_dma_pci_data(emu->pci), |
675 | snd_dma_pci_data(emu->pci), | 674 | 65536 - 64, 65536 - 64); |
676 | 65536 - 64, 65536 - 64)) < 0) | ||
677 | return err; | ||
678 | /* | 675 | /* |
679 | dev_dbg(emu->card->dev, | 676 | dev_dbg(emu->card->dev, |
680 | "preallocate capture substream: err=%d\n", err); | 677 | "preallocate capture substream: err=%d\n", err); |
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 727eb3da1fda..1cfff35e370e 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -1902,10 +1902,8 @@ static void snd_ensoniq_proc_read(struct snd_info_entry *entry, | |||
1902 | 1902 | ||
1903 | static void snd_ensoniq_proc_init(struct ensoniq *ensoniq) | 1903 | static void snd_ensoniq_proc_init(struct ensoniq *ensoniq) |
1904 | { | 1904 | { |
1905 | struct snd_info_entry *entry; | 1905 | snd_card_ro_proc_new(ensoniq->card, "audiopci", ensoniq, |
1906 | 1906 | snd_ensoniq_proc_read); | |
1907 | if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry)) | ||
1908 | snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read); | ||
1909 | } | 1907 | } |
1910 | 1908 | ||
1911 | /* | 1909 | /* |
@@ -2037,9 +2035,6 @@ static int snd_ensoniq_suspend(struct device *dev) | |||
2037 | 2035 | ||
2038 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2036 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2039 | 2037 | ||
2040 | snd_pcm_suspend_all(ensoniq->pcm1); | ||
2041 | snd_pcm_suspend_all(ensoniq->pcm2); | ||
2042 | |||
2043 | #ifdef CHIP1371 | 2038 | #ifdef CHIP1371 |
2044 | snd_ac97_suspend(ensoniq->u.es1371.ac97); | 2039 | snd_ac97_suspend(ensoniq->u.es1371.ac97); |
2045 | #else | 2040 | #else |
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 9d248eb2e26c..84d07bce581c 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1475,7 +1475,6 @@ static int es1938_suspend(struct device *dev) | |||
1475 | unsigned char *s, *d; | 1475 | unsigned char *s, *d; |
1476 | 1476 | ||
1477 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1477 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1478 | snd_pcm_suspend_all(chip->pcm); | ||
1479 | 1478 | ||
1480 | /* save mixer-related registers */ | 1479 | /* save mixer-related registers */ |
1481 | for (s = saved_regs, d = chip->saved_regs; *s; s++, d++) | 1480 | for (s = saved_regs, d = chip->saved_regs; *s; s++, d++) |
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 0b1845ca6005..9dcb698fc8c7 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
@@ -2392,7 +2392,6 @@ static int es1968_suspend(struct device *dev) | |||
2392 | chip->in_suspend = 1; | 2392 | chip->in_suspend = 1; |
2393 | cancel_work_sync(&chip->hwvol_work); | 2393 | cancel_work_sync(&chip->hwvol_work); |
2394 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2394 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2395 | snd_pcm_suspend_all(chip->pcm); | ||
2396 | snd_ac97_suspend(chip->ac97); | 2395 | snd_ac97_suspend(chip->ac97); |
2397 | snd_es1968_bob_stop(chip); | 2396 | snd_es1968_bob_stop(chip); |
2398 | return 0; | 2397 | return 0; |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index e3fb9c61017c..1317f3183eb1 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1408,7 +1408,6 @@ static int snd_fm801_suspend(struct device *dev) | |||
1408 | if (chip->tea575x_tuner & TUNER_ONLY) { | 1408 | if (chip->tea575x_tuner & TUNER_ONLY) { |
1409 | /* FIXME: tea575x suspend */ | 1409 | /* FIXME: tea575x suspend */ |
1410 | } else { | 1410 | } else { |
1411 | snd_pcm_suspend_all(chip->pcm); | ||
1412 | snd_ac97_suspend(chip->ac97); | 1411 | snd_ac97_suspend(chip->ac97); |
1413 | snd_ac97_suspend(chip->ac97_sec); | 1412 | snd_ac97_suspend(chip->ac97_sec); |
1414 | } | 1413 | } |
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index 066b5b59c4d7..b7d9160ed868 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c | |||
@@ -127,44 +127,6 @@ static void turn_off_beep(struct hda_beep *beep) | |||
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | static void snd_hda_do_detach(struct hda_beep *beep) | ||
131 | { | ||
132 | if (beep->registered) | ||
133 | input_unregister_device(beep->dev); | ||
134 | else | ||
135 | input_free_device(beep->dev); | ||
136 | beep->dev = NULL; | ||
137 | turn_off_beep(beep); | ||
138 | } | ||
139 | |||
140 | static int snd_hda_do_attach(struct hda_beep *beep) | ||
141 | { | ||
142 | struct input_dev *input_dev; | ||
143 | struct hda_codec *codec = beep->codec; | ||
144 | |||
145 | input_dev = input_allocate_device(); | ||
146 | if (!input_dev) | ||
147 | return -ENOMEM; | ||
148 | |||
149 | /* setup digital beep device */ | ||
150 | input_dev->name = "HDA Digital PCBeep"; | ||
151 | input_dev->phys = beep->phys; | ||
152 | input_dev->id.bustype = BUS_PCI; | ||
153 | input_dev->dev.parent = &codec->card->card_dev; | ||
154 | |||
155 | input_dev->id.vendor = codec->core.vendor_id >> 16; | ||
156 | input_dev->id.product = codec->core.vendor_id & 0xffff; | ||
157 | input_dev->id.version = 0x01; | ||
158 | |||
159 | input_dev->evbit[0] = BIT_MASK(EV_SND); | ||
160 | input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); | ||
161 | input_dev->event = snd_hda_beep_event; | ||
162 | input_set_drvdata(input_dev, beep); | ||
163 | |||
164 | beep->dev = input_dev; | ||
165 | return 0; | ||
166 | } | ||
167 | |||
168 | /** | 130 | /** |
169 | * snd_hda_enable_beep_device - Turn on/off beep sound | 131 | * snd_hda_enable_beep_device - Turn on/off beep sound |
170 | * @codec: the HDA codec | 132 | * @codec: the HDA codec |
@@ -186,6 +148,38 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) | |||
186 | } | 148 | } |
187 | EXPORT_SYMBOL_GPL(snd_hda_enable_beep_device); | 149 | EXPORT_SYMBOL_GPL(snd_hda_enable_beep_device); |
188 | 150 | ||
151 | static int beep_dev_register(struct snd_device *device) | ||
152 | { | ||
153 | struct hda_beep *beep = device->device_data; | ||
154 | int err; | ||
155 | |||
156 | err = input_register_device(beep->dev); | ||
157 | if (!err) | ||
158 | beep->registered = true; | ||
159 | return err; | ||
160 | } | ||
161 | |||
162 | static int beep_dev_disconnect(struct snd_device *device) | ||
163 | { | ||
164 | struct hda_beep *beep = device->device_data; | ||
165 | |||
166 | if (beep->registered) | ||
167 | input_unregister_device(beep->dev); | ||
168 | else | ||
169 | input_free_device(beep->dev); | ||
170 | turn_off_beep(beep); | ||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | static int beep_dev_free(struct snd_device *device) | ||
175 | { | ||
176 | struct hda_beep *beep = device->device_data; | ||
177 | |||
178 | beep->codec->beep = NULL; | ||
179 | kfree(beep); | ||
180 | return 0; | ||
181 | } | ||
182 | |||
189 | /** | 183 | /** |
190 | * snd_hda_attach_beep_device - Attach a beep input device | 184 | * snd_hda_attach_beep_device - Attach a beep input device |
191 | * @codec: the HDA codec | 185 | * @codec: the HDA codec |
@@ -194,14 +188,16 @@ EXPORT_SYMBOL_GPL(snd_hda_enable_beep_device); | |||
194 | * Attach a beep object to the given widget. If beep hint is turned off | 188 | * Attach a beep object to the given widget. If beep hint is turned off |
195 | * explicitly or beep_mode of the codec is turned off, this doesn't nothing. | 189 | * explicitly or beep_mode of the codec is turned off, this doesn't nothing. |
196 | * | 190 | * |
197 | * The attached beep device has to be registered via | ||
198 | * snd_hda_register_beep_device() and released via snd_hda_detach_beep_device() | ||
199 | * appropriately. | ||
200 | * | ||
201 | * Currently, only one beep device is allowed to each codec. | 191 | * Currently, only one beep device is allowed to each codec. |
202 | */ | 192 | */ |
203 | int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | 193 | int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) |
204 | { | 194 | { |
195 | static struct snd_device_ops ops = { | ||
196 | .dev_register = beep_dev_register, | ||
197 | .dev_disconnect = beep_dev_disconnect, | ||
198 | .dev_free = beep_dev_free, | ||
199 | }; | ||
200 | struct input_dev *input_dev; | ||
205 | struct hda_beep *beep; | 201 | struct hda_beep *beep; |
206 | int err; | 202 | int err; |
207 | 203 | ||
@@ -226,14 +222,41 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
226 | INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); | 222 | INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); |
227 | mutex_init(&beep->mutex); | 223 | mutex_init(&beep->mutex); |
228 | 224 | ||
229 | err = snd_hda_do_attach(beep); | 225 | input_dev = input_allocate_device(); |
230 | if (err < 0) { | 226 | if (!input_dev) { |
231 | kfree(beep); | 227 | err = -ENOMEM; |
232 | codec->beep = NULL; | 228 | goto err_free; |
233 | return err; | ||
234 | } | 229 | } |
235 | 230 | ||
231 | /* setup digital beep device */ | ||
232 | input_dev->name = "HDA Digital PCBeep"; | ||
233 | input_dev->phys = beep->phys; | ||
234 | input_dev->id.bustype = BUS_PCI; | ||
235 | input_dev->dev.parent = &codec->card->card_dev; | ||
236 | |||
237 | input_dev->id.vendor = codec->core.vendor_id >> 16; | ||
238 | input_dev->id.product = codec->core.vendor_id & 0xffff; | ||
239 | input_dev->id.version = 0x01; | ||
240 | |||
241 | input_dev->evbit[0] = BIT_MASK(EV_SND); | ||
242 | input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); | ||
243 | input_dev->event = snd_hda_beep_event; | ||
244 | input_set_drvdata(input_dev, beep); | ||
245 | |||
246 | beep->dev = input_dev; | ||
247 | |||
248 | err = snd_device_new(codec->card, SNDRV_DEV_JACK, beep, &ops); | ||
249 | if (err < 0) | ||
250 | goto err_input; | ||
251 | |||
236 | return 0; | 252 | return 0; |
253 | |||
254 | err_input: | ||
255 | input_free_device(beep->dev); | ||
256 | err_free: | ||
257 | kfree(beep); | ||
258 | codec->beep = NULL; | ||
259 | return err; | ||
237 | } | 260 | } |
238 | EXPORT_SYMBOL_GPL(snd_hda_attach_beep_device); | 261 | EXPORT_SYMBOL_GPL(snd_hda_attach_beep_device); |
239 | 262 | ||
@@ -243,41 +266,11 @@ EXPORT_SYMBOL_GPL(snd_hda_attach_beep_device); | |||
243 | */ | 266 | */ |
244 | void snd_hda_detach_beep_device(struct hda_codec *codec) | 267 | void snd_hda_detach_beep_device(struct hda_codec *codec) |
245 | { | 268 | { |
246 | struct hda_beep *beep = codec->beep; | 269 | if (!codec->bus->shutdown && codec->beep) |
247 | if (beep) { | 270 | snd_device_free(codec->card, codec->beep); |
248 | if (beep->dev) | ||
249 | snd_hda_do_detach(beep); | ||
250 | codec->beep = NULL; | ||
251 | kfree(beep); | ||
252 | } | ||
253 | } | 271 | } |
254 | EXPORT_SYMBOL_GPL(snd_hda_detach_beep_device); | 272 | EXPORT_SYMBOL_GPL(snd_hda_detach_beep_device); |
255 | 273 | ||
256 | /** | ||
257 | * snd_hda_register_beep_device - Register the beep device | ||
258 | * @codec: the HDA codec | ||
259 | */ | ||
260 | int snd_hda_register_beep_device(struct hda_codec *codec) | ||
261 | { | ||
262 | struct hda_beep *beep = codec->beep; | ||
263 | int err; | ||
264 | |||
265 | if (!beep || !beep->dev) | ||
266 | return 0; | ||
267 | |||
268 | err = input_register_device(beep->dev); | ||
269 | if (err < 0) { | ||
270 | codec_err(codec, "hda_beep: unable to register input device\n"); | ||
271 | input_free_device(beep->dev); | ||
272 | codec->beep = NULL; | ||
273 | kfree(beep); | ||
274 | return err; | ||
275 | } | ||
276 | beep->registered = true; | ||
277 | return 0; | ||
278 | } | ||
279 | EXPORT_SYMBOL_GPL(snd_hda_register_beep_device); | ||
280 | |||
281 | static bool ctl_has_mute(struct snd_kcontrol *kcontrol) | 274 | static bool ctl_has_mute(struct snd_kcontrol *kcontrol) |
282 | { | 275 | { |
283 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 276 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h index f1457c6b3969..a25358a4807a 100644 --- a/sound/pci/hda/hda_beep.h +++ b/sound/pci/hda/hda_beep.h | |||
@@ -34,7 +34,6 @@ struct hda_beep { | |||
34 | int snd_hda_enable_beep_device(struct hda_codec *codec, int enable); | 34 | int snd_hda_enable_beep_device(struct hda_codec *codec, int enable); |
35 | int snd_hda_attach_beep_device(struct hda_codec *codec, int nid); | 35 | int snd_hda_attach_beep_device(struct hda_codec *codec, int nid); |
36 | void snd_hda_detach_beep_device(struct hda_codec *codec); | 36 | void snd_hda_detach_beep_device(struct hda_codec *codec); |
37 | int snd_hda_register_beep_device(struct hda_codec *codec); | ||
38 | #else | 37 | #else |
39 | static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | 38 | static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) |
40 | { | 39 | { |
@@ -43,9 +42,5 @@ static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
43 | static inline void snd_hda_detach_beep_device(struct hda_codec *codec) | 42 | static inline void snd_hda_detach_beep_device(struct hda_codec *codec) |
44 | { | 43 | { |
45 | } | 44 | } |
46 | static inline int snd_hda_register_beep_device(struct hda_codec *codec) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | #endif | 45 | #endif |
51 | #endif | 46 | #endif |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 9f8d59e7e89f..5f2005098a60 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -813,7 +813,6 @@ void snd_hda_codec_register(struct hda_codec *codec) | |||
813 | if (codec->registered) | 813 | if (codec->registered) |
814 | return; | 814 | return; |
815 | if (device_is_registered(hda_codec_dev(codec))) { | 815 | if (device_is_registered(hda_codec_dev(codec))) { |
816 | snd_hda_register_beep_device(codec); | ||
817 | codec_display_power(codec, true); | 816 | codec_display_power(codec, true); |
818 | pm_runtime_enable(hda_codec_dev(codec)); | 817 | pm_runtime_enable(hda_codec_dev(codec)); |
819 | /* it was powered up in snd_hda_codec_new(), now all done */ | 818 | /* it was powered up in snd_hda_codec_new(), now all done */ |
@@ -828,14 +827,6 @@ static int snd_hda_codec_dev_register(struct snd_device *device) | |||
828 | return 0; | 827 | return 0; |
829 | } | 828 | } |
830 | 829 | ||
831 | static int snd_hda_codec_dev_disconnect(struct snd_device *device) | ||
832 | { | ||
833 | struct hda_codec *codec = device->device_data; | ||
834 | |||
835 | snd_hda_detach_beep_device(codec); | ||
836 | return 0; | ||
837 | } | ||
838 | |||
839 | static int snd_hda_codec_dev_free(struct snd_device *device) | 830 | static int snd_hda_codec_dev_free(struct snd_device *device) |
840 | { | 831 | { |
841 | struct hda_codec *codec = device->device_data; | 832 | struct hda_codec *codec = device->device_data; |
@@ -921,7 +912,6 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, | |||
921 | int err; | 912 | int err; |
922 | static struct snd_device_ops dev_ops = { | 913 | static struct snd_device_ops dev_ops = { |
923 | .dev_register = snd_hda_codec_dev_register, | 914 | .dev_register = snd_hda_codec_dev_register, |
924 | .dev_disconnect = snd_hda_codec_dev_disconnect, | ||
925 | .dev_free = snd_hda_codec_dev_free, | 915 | .dev_free = snd_hda_codec_dev_free, |
926 | }; | 916 | }; |
927 | 917 | ||
@@ -2917,18 +2907,16 @@ static void hda_call_codec_resume(struct hda_codec *codec) | |||
2917 | hda_jackpoll_work(&codec->jackpoll_work.work); | 2907 | hda_jackpoll_work(&codec->jackpoll_work.work); |
2918 | else | 2908 | else |
2919 | snd_hda_jack_report_sync(codec); | 2909 | snd_hda_jack_report_sync(codec); |
2910 | codec->core.dev.power.power_state = PMSG_ON; | ||
2920 | snd_hdac_leave_pm(&codec->core); | 2911 | snd_hdac_leave_pm(&codec->core); |
2921 | } | 2912 | } |
2922 | 2913 | ||
2923 | static int hda_codec_runtime_suspend(struct device *dev) | 2914 | static int hda_codec_runtime_suspend(struct device *dev) |
2924 | { | 2915 | { |
2925 | struct hda_codec *codec = dev_to_hda_codec(dev); | 2916 | struct hda_codec *codec = dev_to_hda_codec(dev); |
2926 | struct hda_pcm *pcm; | ||
2927 | unsigned int state; | 2917 | unsigned int state; |
2928 | 2918 | ||
2929 | cancel_delayed_work_sync(&codec->jackpoll_work); | 2919 | cancel_delayed_work_sync(&codec->jackpoll_work); |
2930 | list_for_each_entry(pcm, &codec->pcm_list_head, list) | ||
2931 | snd_pcm_suspend_all(pcm->pcm); | ||
2932 | state = hda_call_codec_suspend(codec); | 2920 | state = hda_call_codec_suspend(codec); |
2933 | if (codec->link_down_at_suspend || | 2921 | if (codec->link_down_at_suspend || |
2934 | (codec_has_clkstop(codec) && codec_has_epss(codec) && | 2922 | (codec_has_clkstop(codec) && codec_has_epss(codec) && |
@@ -2950,10 +2938,48 @@ static int hda_codec_runtime_resume(struct device *dev) | |||
2950 | } | 2938 | } |
2951 | #endif /* CONFIG_PM */ | 2939 | #endif /* CONFIG_PM */ |
2952 | 2940 | ||
2941 | #ifdef CONFIG_PM_SLEEP | ||
2942 | static int hda_codec_pm_suspend(struct device *dev) | ||
2943 | { | ||
2944 | dev->power.power_state = PMSG_SUSPEND; | ||
2945 | return pm_runtime_force_suspend(dev); | ||
2946 | } | ||
2947 | |||
2948 | static int hda_codec_pm_resume(struct device *dev) | ||
2949 | { | ||
2950 | dev->power.power_state = PMSG_RESUME; | ||
2951 | return pm_runtime_force_resume(dev); | ||
2952 | } | ||
2953 | |||
2954 | static int hda_codec_pm_freeze(struct device *dev) | ||
2955 | { | ||
2956 | dev->power.power_state = PMSG_FREEZE; | ||
2957 | return pm_runtime_force_suspend(dev); | ||
2958 | } | ||
2959 | |||
2960 | static int hda_codec_pm_thaw(struct device *dev) | ||
2961 | { | ||
2962 | dev->power.power_state = PMSG_THAW; | ||
2963 | return pm_runtime_force_resume(dev); | ||
2964 | } | ||
2965 | |||
2966 | static int hda_codec_pm_restore(struct device *dev) | ||
2967 | { | ||
2968 | dev->power.power_state = PMSG_RESTORE; | ||
2969 | return pm_runtime_force_resume(dev); | ||
2970 | } | ||
2971 | #endif /* CONFIG_PM_SLEEP */ | ||
2972 | |||
2953 | /* referred in hda_bind.c */ | 2973 | /* referred in hda_bind.c */ |
2954 | const struct dev_pm_ops hda_codec_driver_pm = { | 2974 | const struct dev_pm_ops hda_codec_driver_pm = { |
2955 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | 2975 | #ifdef CONFIG_PM_SLEEP |
2956 | pm_runtime_force_resume) | 2976 | .suspend = hda_codec_pm_suspend, |
2977 | .resume = hda_codec_pm_resume, | ||
2978 | .freeze = hda_codec_pm_freeze, | ||
2979 | .thaw = hda_codec_pm_thaw, | ||
2980 | .poweroff = hda_codec_pm_suspend, | ||
2981 | .restore = hda_codec_pm_restore, | ||
2982 | #endif /* CONFIG_PM_SLEEP */ | ||
2957 | SET_RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume, | 2983 | SET_RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume, |
2958 | NULL) | 2984 | NULL) |
2959 | }; | 2985 | }; |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index a65740419650..853842987fa1 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -919,15 +919,8 @@ static void print_codec_info(struct snd_info_entry *entry, | |||
919 | int snd_hda_codec_proc_new(struct hda_codec *codec) | 919 | int snd_hda_codec_proc_new(struct hda_codec *codec) |
920 | { | 920 | { |
921 | char name[32]; | 921 | char name[32]; |
922 | struct snd_info_entry *entry; | ||
923 | int err; | ||
924 | 922 | ||
925 | snprintf(name, sizeof(name), "codec#%d", codec->core.addr); | 923 | snprintf(name, sizeof(name), "codec#%d", codec->core.addr); |
926 | err = snd_card_proc_new(codec->card, name, &entry); | 924 | return snd_card_ro_proc_new(codec->card, name, codec, print_codec_info); |
927 | if (err < 0) | ||
928 | return err; | ||
929 | |||
930 | snd_info_set_text_ops(entry, codec, print_codec_info); | ||
931 | return 0; | ||
932 | } | 925 | } |
933 | 926 | ||
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 97a176d817a0..3d68f9ef7694 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/time.h> | 33 | #include <linux/time.h> |
34 | #include <linux/string.h> | 34 | #include <linux/string.h> |
35 | #include <linux/pm_runtime.h> | ||
35 | 36 | ||
36 | #include <sound/core.h> | 37 | #include <sound/core.h> |
37 | #include <sound/initval.h> | 38 | #include <sound/initval.h> |
@@ -218,7 +219,6 @@ disable_hda: | |||
218 | return rc; | 219 | return rc; |
219 | } | 220 | } |
220 | 221 | ||
221 | #ifdef CONFIG_PM_SLEEP | ||
222 | static void hda_tegra_disable_clocks(struct hda_tegra *data) | 222 | static void hda_tegra_disable_clocks(struct hda_tegra *data) |
223 | { | 223 | { |
224 | clk_disable_unprepare(data->hda2hdmi_clk); | 224 | clk_disable_unprepare(data->hda2hdmi_clk); |
@@ -229,43 +229,72 @@ static void hda_tegra_disable_clocks(struct hda_tegra *data) | |||
229 | /* | 229 | /* |
230 | * power management | 230 | * power management |
231 | */ | 231 | */ |
232 | static int hda_tegra_suspend(struct device *dev) | 232 | static int __maybe_unused hda_tegra_suspend(struct device *dev) |
233 | { | 233 | { |
234 | struct snd_card *card = dev_get_drvdata(dev); | 234 | struct snd_card *card = dev_get_drvdata(dev); |
235 | struct azx *chip = card->private_data; | 235 | int rc; |
236 | struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); | ||
237 | struct hdac_bus *bus = azx_bus(chip); | ||
238 | 236 | ||
237 | rc = pm_runtime_force_suspend(dev); | ||
238 | if (rc < 0) | ||
239 | return rc; | ||
239 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 240 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
240 | 241 | ||
241 | azx_stop_chip(chip); | 242 | return 0; |
242 | synchronize_irq(bus->irq); | 243 | } |
243 | azx_enter_link_reset(chip); | 244 | |
244 | hda_tegra_disable_clocks(hda); | 245 | static int __maybe_unused hda_tegra_resume(struct device *dev) |
246 | { | ||
247 | struct snd_card *card = dev_get_drvdata(dev); | ||
248 | int rc; | ||
249 | |||
250 | rc = pm_runtime_force_resume(dev); | ||
251 | if (rc < 0) | ||
252 | return rc; | ||
253 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | ||
245 | 254 | ||
246 | return 0; | 255 | return 0; |
247 | } | 256 | } |
248 | 257 | ||
249 | static int hda_tegra_resume(struct device *dev) | 258 | static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev) |
250 | { | 259 | { |
251 | struct snd_card *card = dev_get_drvdata(dev); | 260 | struct snd_card *card = dev_get_drvdata(dev); |
252 | struct azx *chip = card->private_data; | 261 | struct azx *chip = card->private_data; |
253 | struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); | 262 | struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); |
263 | struct hdac_bus *bus = azx_bus(chip); | ||
254 | 264 | ||
255 | hda_tegra_enable_clocks(hda); | 265 | if (chip && chip->running) { |
266 | azx_stop_chip(chip); | ||
267 | synchronize_irq(bus->irq); | ||
268 | azx_enter_link_reset(chip); | ||
269 | } | ||
270 | hda_tegra_disable_clocks(hda); | ||
256 | 271 | ||
257 | hda_tegra_init(hda); | 272 | return 0; |
273 | } | ||
258 | 274 | ||
259 | azx_init_chip(chip, 1); | 275 | static int __maybe_unused hda_tegra_runtime_resume(struct device *dev) |
276 | { | ||
277 | struct snd_card *card = dev_get_drvdata(dev); | ||
278 | struct azx *chip = card->private_data; | ||
279 | struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip); | ||
280 | int rc; | ||
260 | 281 | ||
261 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 282 | rc = hda_tegra_enable_clocks(hda); |
283 | if (rc != 0) | ||
284 | return rc; | ||
285 | if (chip && chip->running) { | ||
286 | hda_tegra_init(hda); | ||
287 | azx_init_chip(chip, 1); | ||
288 | } | ||
262 | 289 | ||
263 | return 0; | 290 | return 0; |
264 | } | 291 | } |
265 | #endif /* CONFIG_PM_SLEEP */ | ||
266 | 292 | ||
267 | static const struct dev_pm_ops hda_tegra_pm = { | 293 | static const struct dev_pm_ops hda_tegra_pm = { |
268 | SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume) | 294 | SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume) |
295 | SET_RUNTIME_PM_OPS(hda_tegra_runtime_suspend, | ||
296 | hda_tegra_runtime_resume, | ||
297 | NULL) | ||
269 | }; | 298 | }; |
270 | 299 | ||
271 | static int hda_tegra_dev_disconnect(struct snd_device *device) | 300 | static int hda_tegra_dev_disconnect(struct snd_device *device) |
@@ -303,7 +332,23 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev) | |||
303 | struct hdac_bus *bus = azx_bus(chip); | 332 | struct hdac_bus *bus = azx_bus(chip); |
304 | struct device *dev = hda->dev; | 333 | struct device *dev = hda->dev; |
305 | struct resource *res; | 334 | struct resource *res; |
306 | int err; | 335 | |
336 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
337 | hda->regs = devm_ioremap_resource(dev, res); | ||
338 | if (IS_ERR(hda->regs)) | ||
339 | return PTR_ERR(hda->regs); | ||
340 | |||
341 | bus->remap_addr = hda->regs + HDA_BAR0; | ||
342 | bus->addr = res->start + HDA_BAR0; | ||
343 | |||
344 | hda_tegra_init(hda); | ||
345 | |||
346 | return 0; | ||
347 | } | ||
348 | |||
349 | static int hda_tegra_init_clk(struct hda_tegra *hda) | ||
350 | { | ||
351 | struct device *dev = hda->dev; | ||
307 | 352 | ||
308 | hda->hda_clk = devm_clk_get(dev, "hda"); | 353 | hda->hda_clk = devm_clk_get(dev, "hda"); |
309 | if (IS_ERR(hda->hda_clk)) { | 354 | if (IS_ERR(hda->hda_clk)) { |
@@ -321,22 +366,6 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev) | |||
321 | return PTR_ERR(hda->hda2hdmi_clk); | 366 | return PTR_ERR(hda->hda2hdmi_clk); |
322 | } | 367 | } |
323 | 368 | ||
324 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
325 | hda->regs = devm_ioremap_resource(dev, res); | ||
326 | if (IS_ERR(hda->regs)) | ||
327 | return PTR_ERR(hda->regs); | ||
328 | |||
329 | bus->remap_addr = hda->regs + HDA_BAR0; | ||
330 | bus->addr = res->start + HDA_BAR0; | ||
331 | |||
332 | err = hda_tegra_enable_clocks(hda); | ||
333 | if (err) { | ||
334 | dev_err(dev, "failed to get enable clocks\n"); | ||
335 | return err; | ||
336 | } | ||
337 | |||
338 | hda_tegra_init(hda); | ||
339 | |||
340 | return 0; | 369 | return 0; |
341 | } | 370 | } |
342 | 371 | ||
@@ -347,8 +376,8 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) | |||
347 | int err; | 376 | int err; |
348 | unsigned short gcap; | 377 | unsigned short gcap; |
349 | int irq_id = platform_get_irq(pdev, 0); | 378 | int irq_id = platform_get_irq(pdev, 0); |
350 | const char *sname; | 379 | const char *sname, *drv_name = "tegra-hda"; |
351 | struct device_node *root; | 380 | struct device_node *np = pdev->dev.of_node; |
352 | 381 | ||
353 | err = hda_tegra_init_chip(chip, pdev); | 382 | err = hda_tegra_init_chip(chip, pdev); |
354 | if (err) | 383 | if (err) |
@@ -407,17 +436,11 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) | |||
407 | } | 436 | } |
408 | 437 | ||
409 | /* driver name */ | 438 | /* driver name */ |
410 | strcpy(card->driver, "tegra-hda"); | 439 | strncpy(card->driver, drv_name, sizeof(card->driver)); |
411 | |||
412 | root = of_find_node_by_path("/"); | ||
413 | sname = of_get_property(root, "compatible", NULL); | ||
414 | of_node_put(root); | ||
415 | if (!sname) { | ||
416 | dev_err(card->dev, | ||
417 | "failed to get compatible property from root node\n"); | ||
418 | return -ENODEV; | ||
419 | } | ||
420 | /* shortname for card */ | 440 | /* shortname for card */ |
441 | sname = of_get_property(np, "nvidia,model", NULL); | ||
442 | if (!sname) | ||
443 | sname = drv_name; | ||
421 | if (strlen(sname) > sizeof(card->shortname)) | 444 | if (strlen(sname) > sizeof(card->shortname)) |
422 | dev_info(card->dev, "truncating shortname for card\n"); | 445 | dev_info(card->dev, "truncating shortname for card\n"); |
423 | strncpy(card->shortname, sname, sizeof(card->shortname)); | 446 | strncpy(card->shortname, sname, sizeof(card->shortname)); |
@@ -487,7 +510,8 @@ MODULE_DEVICE_TABLE(of, hda_tegra_match); | |||
487 | 510 | ||
488 | static int hda_tegra_probe(struct platform_device *pdev) | 511 | static int hda_tegra_probe(struct platform_device *pdev) |
489 | { | 512 | { |
490 | const unsigned int driver_flags = AZX_DCAPS_CORBRP_SELF_CLEAR; | 513 | const unsigned int driver_flags = AZX_DCAPS_CORBRP_SELF_CLEAR | |
514 | AZX_DCAPS_PM_RUNTIME; | ||
491 | struct snd_card *card; | 515 | struct snd_card *card; |
492 | struct azx *chip; | 516 | struct azx *chip; |
493 | struct hda_tegra *hda; | 517 | struct hda_tegra *hda; |
@@ -506,12 +530,21 @@ static int hda_tegra_probe(struct platform_device *pdev) | |||
506 | return err; | 530 | return err; |
507 | } | 531 | } |
508 | 532 | ||
533 | err = hda_tegra_init_clk(hda); | ||
534 | if (err < 0) | ||
535 | goto out_free; | ||
536 | |||
509 | err = hda_tegra_create(card, driver_flags, hda); | 537 | err = hda_tegra_create(card, driver_flags, hda); |
510 | if (err < 0) | 538 | if (err < 0) |
511 | goto out_free; | 539 | goto out_free; |
512 | card->private_data = chip; | 540 | card->private_data = chip; |
513 | 541 | ||
514 | dev_set_drvdata(&pdev->dev, card); | 542 | dev_set_drvdata(&pdev->dev, card); |
543 | |||
544 | pm_runtime_enable(hda->dev); | ||
545 | if (!azx_has_pm_runtime(chip)) | ||
546 | pm_runtime_forbid(hda->dev); | ||
547 | |||
515 | schedule_work(&hda->probe_work); | 548 | schedule_work(&hda->probe_work); |
516 | 549 | ||
517 | return 0; | 550 | return 0; |
@@ -528,6 +561,7 @@ static void hda_tegra_probe_work(struct work_struct *work) | |||
528 | struct platform_device *pdev = to_platform_device(hda->dev); | 561 | struct platform_device *pdev = to_platform_device(hda->dev); |
529 | int err; | 562 | int err; |
530 | 563 | ||
564 | pm_runtime_get_sync(hda->dev); | ||
531 | err = hda_tegra_first_init(chip, pdev); | 565 | err = hda_tegra_first_init(chip, pdev); |
532 | if (err < 0) | 566 | if (err < 0) |
533 | goto out_free; | 567 | goto out_free; |
@@ -549,12 +583,18 @@ static void hda_tegra_probe_work(struct work_struct *work) | |||
549 | snd_hda_set_power_save(&chip->bus, power_save * 1000); | 583 | snd_hda_set_power_save(&chip->bus, power_save * 1000); |
550 | 584 | ||
551 | out_free: | 585 | out_free: |
586 | pm_runtime_put(hda->dev); | ||
552 | return; /* no error return from async probe */ | 587 | return; /* no error return from async probe */ |
553 | } | 588 | } |
554 | 589 | ||
555 | static int hda_tegra_remove(struct platform_device *pdev) | 590 | static int hda_tegra_remove(struct platform_device *pdev) |
556 | { | 591 | { |
557 | return snd_card_free(dev_get_drvdata(&pdev->dev)); | 592 | int ret; |
593 | |||
594 | ret = snd_card_free(dev_get_drvdata(&pdev->dev)); | ||
595 | pm_runtime_disable(&pdev->dev); | ||
596 | |||
597 | return ret; | ||
558 | } | 598 | } |
559 | 599 | ||
560 | static void hda_tegra_shutdown(struct platform_device *pdev) | 600 | static void hda_tegra_shutdown(struct platform_device *pdev) |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index a4ee7656d9ee..fb65ad31e86c 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -936,6 +936,9 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { | |||
936 | SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 936 | SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
937 | SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 937 | SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
938 | SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 938 | SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
939 | SND_PCI_QUIRK(0x103c, 0x8456, "HP Z2 G4 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), | ||
940 | SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE), | ||
941 | SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE), | ||
939 | SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), | 942 | SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), |
940 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), | 943 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), |
941 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), | 944 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 46f88dc7b7e8..8b3ac690efa3 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -57,10 +57,11 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); | |||
57 | #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ | 57 | #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ |
58 | ((codec)->core.vendor_id == 0x80862800)) | 58 | ((codec)->core.vendor_id == 0x80862800)) |
59 | #define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) | 59 | #define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) |
60 | #define is_icelake(codec) ((codec)->core.vendor_id == 0x8086280f) | ||
60 | #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ | 61 | #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ |
61 | || is_skylake(codec) || is_broxton(codec) \ | 62 | || is_skylake(codec) || is_broxton(codec) \ |
62 | || is_kabylake(codec)) || is_geminilake(codec) \ | 63 | || is_kabylake(codec) || is_geminilake(codec) \ |
63 | || is_cannonlake(codec) | 64 | || is_cannonlake(codec) || is_icelake(codec)) |
64 | #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) | 65 | #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) |
65 | #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) | 66 | #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) |
66 | #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) | 67 | #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) |
@@ -181,6 +182,8 @@ struct hdmi_spec { | |||
181 | 182 | ||
182 | struct hdac_chmap chmap; | 183 | struct hdac_chmap chmap; |
183 | hda_nid_t vendor_nid; | 184 | hda_nid_t vendor_nid; |
185 | const int *port_map; | ||
186 | int port_num; | ||
184 | }; | 187 | }; |
185 | 188 | ||
186 | #ifdef CONFIG_SND_HDA_COMPONENT | 189 | #ifdef CONFIG_SND_HDA_COMPONENT |
@@ -1865,7 +1868,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1865 | hda_nid_t pin_nid; | 1868 | hda_nid_t pin_nid; |
1866 | struct snd_pcm_runtime *runtime = substream->runtime; | 1869 | struct snd_pcm_runtime *runtime = substream->runtime; |
1867 | bool non_pcm; | 1870 | bool non_pcm; |
1868 | int pinctl; | 1871 | int pinctl, stripe; |
1869 | int err = 0; | 1872 | int err = 0; |
1870 | 1873 | ||
1871 | mutex_lock(&spec->pcm_lock); | 1874 | mutex_lock(&spec->pcm_lock); |
@@ -1909,6 +1912,14 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1909 | per_pin->channels = substream->runtime->channels; | 1912 | per_pin->channels = substream->runtime->channels; |
1910 | per_pin->setup = true; | 1913 | per_pin->setup = true; |
1911 | 1914 | ||
1915 | if (get_wcaps(codec, cvt_nid) & AC_WCAP_STRIPE) { | ||
1916 | stripe = snd_hdac_get_stream_stripe_ctl(&codec->bus->core, | ||
1917 | substream); | ||
1918 | snd_hda_codec_write(codec, cvt_nid, 0, | ||
1919 | AC_VERB_SET_STRIPE_CONTROL, | ||
1920 | stripe); | ||
1921 | } | ||
1922 | |||
1912 | hdmi_setup_audio_infoframe(codec, per_pin, non_pcm); | 1923 | hdmi_setup_audio_infoframe(codec, per_pin, non_pcm); |
1913 | mutex_unlock(&per_pin->lock); | 1924 | mutex_unlock(&per_pin->lock); |
1914 | if (spec->dyn_pin_out) { | 1925 | if (spec->dyn_pin_out) { |
@@ -2410,12 +2421,11 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec, | |||
2410 | snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids); | 2421 | snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids); |
2411 | } | 2422 | } |
2412 | 2423 | ||
2413 | #define INTEL_VENDOR_NID 0x08 | 2424 | #define INTEL_GET_VENDOR_VERB 0xf81 |
2414 | #define INTEL_GLK_VENDOR_NID 0x0B | 2425 | #define INTEL_GET_VENDOR_VERB 0xf81 |
2415 | #define INTEL_GET_VENDOR_VERB 0xf81 | 2426 | #define INTEL_SET_VENDOR_VERB 0x781 |
2416 | #define INTEL_SET_VENDOR_VERB 0x781 | 2427 | #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ |
2417 | #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ | 2428 | #define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */ |
2418 | #define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */ | ||
2419 | 2429 | ||
2420 | static void intel_haswell_enable_all_pins(struct hda_codec *codec, | 2430 | static void intel_haswell_enable_all_pins(struct hda_codec *codec, |
2421 | bool update_tree) | 2431 | bool update_tree) |
@@ -2495,11 +2505,29 @@ static int intel_base_nid(struct hda_codec *codec) | |||
2495 | 2505 | ||
2496 | static int intel_pin2port(void *audio_ptr, int pin_nid) | 2506 | static int intel_pin2port(void *audio_ptr, int pin_nid) |
2497 | { | 2507 | { |
2498 | int base_nid = intel_base_nid(audio_ptr); | 2508 | struct hda_codec *codec = audio_ptr; |
2509 | struct hdmi_spec *spec = codec->spec; | ||
2510 | int base_nid, i; | ||
2499 | 2511 | ||
2500 | if (WARN_ON(pin_nid < base_nid || pin_nid >= base_nid + 3)) | 2512 | if (!spec->port_num) { |
2501 | return -1; | 2513 | base_nid = intel_base_nid(codec); |
2502 | return pin_nid - base_nid + 1; /* intel port is 1-based */ | 2514 | if (WARN_ON(pin_nid < base_nid || pin_nid >= base_nid + 3)) |
2515 | return -1; | ||
2516 | return pin_nid - base_nid + 1; /* intel port is 1-based */ | ||
2517 | } | ||
2518 | |||
2519 | /* | ||
2520 | * looking for the pin number in the mapping table and return | ||
2521 | * the index which indicate the port number | ||
2522 | */ | ||
2523 | for (i = 0; i < spec->port_num; i++) { | ||
2524 | if (pin_nid == spec->port_map[i]) | ||
2525 | return i + 1; | ||
2526 | } | ||
2527 | |||
2528 | /* return -1 if pin number exceeds our expectation */ | ||
2529 | codec_info(codec, "Can't find the HDMI/DP port for pin %d\n", pin_nid); | ||
2530 | return -1; | ||
2503 | } | 2531 | } |
2504 | 2532 | ||
2505 | static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) | 2533 | static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) |
@@ -2600,7 +2628,8 @@ static int parse_intel_hdmi(struct hda_codec *codec) | |||
2600 | } | 2628 | } |
2601 | 2629 | ||
2602 | /* Intel Haswell and onwards; audio component with eld notifier */ | 2630 | /* Intel Haswell and onwards; audio component with eld notifier */ |
2603 | static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) | 2631 | static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, |
2632 | const int *port_map, int port_num) | ||
2604 | { | 2633 | { |
2605 | struct hdmi_spec *spec; | 2634 | struct hdmi_spec *spec; |
2606 | int err; | 2635 | int err; |
@@ -2612,6 +2641,8 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) | |||
2612 | codec->dp_mst = true; | 2641 | codec->dp_mst = true; |
2613 | spec->dyn_pcm_assign = true; | 2642 | spec->dyn_pcm_assign = true; |
2614 | spec->vendor_nid = vendor_nid; | 2643 | spec->vendor_nid = vendor_nid; |
2644 | spec->port_map = port_map; | ||
2645 | spec->port_num = port_num; | ||
2615 | 2646 | ||
2616 | intel_haswell_enable_all_pins(codec, true); | 2647 | intel_haswell_enable_all_pins(codec, true); |
2617 | intel_haswell_fixup_enable_dp12(codec); | 2648 | intel_haswell_fixup_enable_dp12(codec); |
@@ -2630,12 +2661,23 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) | |||
2630 | 2661 | ||
2631 | static int patch_i915_hsw_hdmi(struct hda_codec *codec) | 2662 | static int patch_i915_hsw_hdmi(struct hda_codec *codec) |
2632 | { | 2663 | { |
2633 | return intel_hsw_common_init(codec, INTEL_VENDOR_NID); | 2664 | return intel_hsw_common_init(codec, 0x08, NULL, 0); |
2634 | } | 2665 | } |
2635 | 2666 | ||
2636 | static int patch_i915_glk_hdmi(struct hda_codec *codec) | 2667 | static int patch_i915_glk_hdmi(struct hda_codec *codec) |
2637 | { | 2668 | { |
2638 | return intel_hsw_common_init(codec, INTEL_GLK_VENDOR_NID); | 2669 | return intel_hsw_common_init(codec, 0x0b, NULL, 0); |
2670 | } | ||
2671 | |||
2672 | static int patch_i915_icl_hdmi(struct hda_codec *codec) | ||
2673 | { | ||
2674 | /* | ||
2675 | * pin to port mapping table where the value indicate the pin number and | ||
2676 | * the index indicate the port number with 1 base. | ||
2677 | */ | ||
2678 | static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb}; | ||
2679 | |||
2680 | return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); | ||
2639 | } | 2681 | } |
2640 | 2682 | ||
2641 | /* Intel Baytrail and Braswell; with eld notifier */ | 2683 | /* Intel Baytrail and Braswell; with eld notifier */ |
@@ -3878,6 +3920,7 @@ HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP", patch_via_hdmi), | |||
3878 | HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi), | 3920 | HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi), |
3879 | HDA_CODEC_ENTRY(0x11069f85, "VX11 HDMI/DP", patch_generic_hdmi), | 3921 | HDA_CODEC_ENTRY(0x11069f85, "VX11 HDMI/DP", patch_generic_hdmi), |
3880 | HDA_CODEC_ENTRY(0x80860054, "IbexPeak HDMI", patch_i915_cpt_hdmi), | 3922 | HDA_CODEC_ENTRY(0x80860054, "IbexPeak HDMI", patch_i915_cpt_hdmi), |
3923 | HDA_CODEC_ENTRY(0x80862800, "Geminilake HDMI", patch_i915_glk_hdmi), | ||
3881 | HDA_CODEC_ENTRY(0x80862801, "Bearlake HDMI", patch_generic_hdmi), | 3924 | HDA_CODEC_ENTRY(0x80862801, "Bearlake HDMI", patch_generic_hdmi), |
3882 | HDA_CODEC_ENTRY(0x80862802, "Cantiga HDMI", patch_generic_hdmi), | 3925 | HDA_CODEC_ENTRY(0x80862802, "Cantiga HDMI", patch_generic_hdmi), |
3883 | HDA_CODEC_ENTRY(0x80862803, "Eaglelake HDMI", patch_generic_hdmi), | 3926 | HDA_CODEC_ENTRY(0x80862803, "Eaglelake HDMI", patch_generic_hdmi), |
@@ -3891,7 +3934,7 @@ HDA_CODEC_ENTRY(0x8086280a, "Broxton HDMI", patch_i915_hsw_hdmi), | |||
3891 | HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), | 3934 | HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), |
3892 | HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi), | 3935 | HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi), |
3893 | HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), | 3936 | HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), |
3894 | HDA_CODEC_ENTRY(0x80862800, "Geminilake HDMI", patch_i915_glk_hdmi), | 3937 | HDA_CODEC_ENTRY(0x8086280f, "Icelake HDMI", patch_i915_icl_hdmi), |
3895 | HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), | 3938 | HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), |
3896 | HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), | 3939 | HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), |
3897 | HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi), | 3940 | HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 1ffa36e987b4..384719d5c44e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -118,6 +118,7 @@ struct alc_spec { | |||
118 | unsigned int has_alc5505_dsp:1; | 118 | unsigned int has_alc5505_dsp:1; |
119 | unsigned int no_depop_delay:1; | 119 | unsigned int no_depop_delay:1; |
120 | unsigned int done_hp_init:1; | 120 | unsigned int done_hp_init:1; |
121 | unsigned int no_shutup_pins:1; | ||
121 | 122 | ||
122 | /* for PLL fix */ | 123 | /* for PLL fix */ |
123 | hda_nid_t pll_nid; | 124 | hda_nid_t pll_nid; |
@@ -476,6 +477,14 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) | |||
476 | set_eapd(codec, *p, on); | 477 | set_eapd(codec, *p, on); |
477 | } | 478 | } |
478 | 479 | ||
480 | static void alc_shutup_pins(struct hda_codec *codec) | ||
481 | { | ||
482 | struct alc_spec *spec = codec->spec; | ||
483 | |||
484 | if (!spec->no_shutup_pins) | ||
485 | snd_hda_shutup_pins(codec); | ||
486 | } | ||
487 | |||
479 | /* generic shutup callback; | 488 | /* generic shutup callback; |
480 | * just turning off EAPD and a little pause for avoiding pop-noise | 489 | * just turning off EAPD and a little pause for avoiding pop-noise |
481 | */ | 490 | */ |
@@ -486,7 +495,7 @@ static void alc_eapd_shutup(struct hda_codec *codec) | |||
486 | alc_auto_setup_eapd(codec, false); | 495 | alc_auto_setup_eapd(codec, false); |
487 | if (!spec->no_depop_delay) | 496 | if (!spec->no_depop_delay) |
488 | msleep(200); | 497 | msleep(200); |
489 | snd_hda_shutup_pins(codec); | 498 | alc_shutup_pins(codec); |
490 | } | 499 | } |
491 | 500 | ||
492 | /* generic EAPD initialization */ | 501 | /* generic EAPD initialization */ |
@@ -814,7 +823,7 @@ static inline void alc_shutup(struct hda_codec *codec) | |||
814 | if (spec && spec->shutup) | 823 | if (spec && spec->shutup) |
815 | spec->shutup(codec); | 824 | spec->shutup(codec); |
816 | else | 825 | else |
817 | snd_hda_shutup_pins(codec); | 826 | alc_shutup_pins(codec); |
818 | } | 827 | } |
819 | 828 | ||
820 | static void alc_reboot_notify(struct hda_codec *codec) | 829 | static void alc_reboot_notify(struct hda_codec *codec) |
@@ -2950,7 +2959,7 @@ static void alc269_shutup(struct hda_codec *codec) | |||
2950 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | 2959 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
2951 | msleep(150); | 2960 | msleep(150); |
2952 | } | 2961 | } |
2953 | snd_hda_shutup_pins(codec); | 2962 | alc_shutup_pins(codec); |
2954 | } | 2963 | } |
2955 | 2964 | ||
2956 | static struct coef_fw alc282_coefs[] = { | 2965 | static struct coef_fw alc282_coefs[] = { |
@@ -3053,14 +3062,15 @@ static void alc282_shutup(struct hda_codec *codec) | |||
3053 | if (hp_pin_sense) | 3062 | if (hp_pin_sense) |
3054 | msleep(85); | 3063 | msleep(85); |
3055 | 3064 | ||
3056 | snd_hda_codec_write(codec, hp_pin, 0, | 3065 | if (!spec->no_shutup_pins) |
3057 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | 3066 | snd_hda_codec_write(codec, hp_pin, 0, |
3067 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
3058 | 3068 | ||
3059 | if (hp_pin_sense) | 3069 | if (hp_pin_sense) |
3060 | msleep(100); | 3070 | msleep(100); |
3061 | 3071 | ||
3062 | alc_auto_setup_eapd(codec, false); | 3072 | alc_auto_setup_eapd(codec, false); |
3063 | snd_hda_shutup_pins(codec); | 3073 | alc_shutup_pins(codec); |
3064 | alc_write_coef_idx(codec, 0x78, coef78); | 3074 | alc_write_coef_idx(codec, 0x78, coef78); |
3065 | } | 3075 | } |
3066 | 3076 | ||
@@ -3166,15 +3176,16 @@ static void alc283_shutup(struct hda_codec *codec) | |||
3166 | if (hp_pin_sense) | 3176 | if (hp_pin_sense) |
3167 | msleep(100); | 3177 | msleep(100); |
3168 | 3178 | ||
3169 | snd_hda_codec_write(codec, hp_pin, 0, | 3179 | if (!spec->no_shutup_pins) |
3170 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | 3180 | snd_hda_codec_write(codec, hp_pin, 0, |
3181 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
3171 | 3182 | ||
3172 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); | 3183 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
3173 | 3184 | ||
3174 | if (hp_pin_sense) | 3185 | if (hp_pin_sense) |
3175 | msleep(100); | 3186 | msleep(100); |
3176 | alc_auto_setup_eapd(codec, false); | 3187 | alc_auto_setup_eapd(codec, false); |
3177 | snd_hda_shutup_pins(codec); | 3188 | alc_shutup_pins(codec); |
3178 | alc_write_coef_idx(codec, 0x43, 0x9614); | 3189 | alc_write_coef_idx(codec, 0x43, 0x9614); |
3179 | } | 3190 | } |
3180 | 3191 | ||
@@ -3240,14 +3251,15 @@ static void alc256_shutup(struct hda_codec *codec) | |||
3240 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ | 3251 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
3241 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); | 3252 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
3242 | 3253 | ||
3243 | snd_hda_codec_write(codec, hp_pin, 0, | 3254 | if (!spec->no_shutup_pins) |
3244 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | 3255 | snd_hda_codec_write(codec, hp_pin, 0, |
3256 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
3245 | 3257 | ||
3246 | if (hp_pin_sense) | 3258 | if (hp_pin_sense) |
3247 | msleep(100); | 3259 | msleep(100); |
3248 | 3260 | ||
3249 | alc_auto_setup_eapd(codec, false); | 3261 | alc_auto_setup_eapd(codec, false); |
3250 | snd_hda_shutup_pins(codec); | 3262 | alc_shutup_pins(codec); |
3251 | } | 3263 | } |
3252 | 3264 | ||
3253 | static void alc225_init(struct hda_codec *codec) | 3265 | static void alc225_init(struct hda_codec *codec) |
@@ -3334,7 +3346,7 @@ static void alc225_shutup(struct hda_codec *codec) | |||
3334 | msleep(100); | 3346 | msleep(100); |
3335 | 3347 | ||
3336 | alc_auto_setup_eapd(codec, false); | 3348 | alc_auto_setup_eapd(codec, false); |
3337 | snd_hda_shutup_pins(codec); | 3349 | alc_shutup_pins(codec); |
3338 | } | 3350 | } |
3339 | 3351 | ||
3340 | static void alc_default_init(struct hda_codec *codec) | 3352 | static void alc_default_init(struct hda_codec *codec) |
@@ -3388,14 +3400,15 @@ static void alc_default_shutup(struct hda_codec *codec) | |||
3388 | if (hp_pin_sense) | 3400 | if (hp_pin_sense) |
3389 | msleep(85); | 3401 | msleep(85); |
3390 | 3402 | ||
3391 | snd_hda_codec_write(codec, hp_pin, 0, | 3403 | if (!spec->no_shutup_pins) |
3392 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | 3404 | snd_hda_codec_write(codec, hp_pin, 0, |
3405 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
3393 | 3406 | ||
3394 | if (hp_pin_sense) | 3407 | if (hp_pin_sense) |
3395 | msleep(100); | 3408 | msleep(100); |
3396 | 3409 | ||
3397 | alc_auto_setup_eapd(codec, false); | 3410 | alc_auto_setup_eapd(codec, false); |
3398 | snd_hda_shutup_pins(codec); | 3411 | alc_shutup_pins(codec); |
3399 | } | 3412 | } |
3400 | 3413 | ||
3401 | static void alc294_hp_init(struct hda_codec *codec) | 3414 | static void alc294_hp_init(struct hda_codec *codec) |
@@ -3412,8 +3425,9 @@ static void alc294_hp_init(struct hda_codec *codec) | |||
3412 | 3425 | ||
3413 | msleep(100); | 3426 | msleep(100); |
3414 | 3427 | ||
3415 | snd_hda_codec_write(codec, hp_pin, 0, | 3428 | if (!spec->no_shutup_pins) |
3416 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | 3429 | snd_hda_codec_write(codec, hp_pin, 0, |
3430 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
3417 | 3431 | ||
3418 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ | 3432 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
3419 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ | 3433 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
@@ -3433,7 +3447,9 @@ static void alc294_init(struct hda_codec *codec) | |||
3433 | { | 3447 | { |
3434 | struct alc_spec *spec = codec->spec; | 3448 | struct alc_spec *spec = codec->spec; |
3435 | 3449 | ||
3436 | if (!spec->done_hp_init) { | 3450 | /* required only at boot or S4 resume time */ |
3451 | if (!spec->done_hp_init || | ||
3452 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { | ||
3437 | alc294_hp_init(codec); | 3453 | alc294_hp_init(codec); |
3438 | spec->done_hp_init = true; | 3454 | spec->done_hp_init = true; |
3439 | } | 3455 | } |
@@ -5007,16 +5023,12 @@ static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, | |||
5007 | } | 5023 | } |
5008 | } | 5024 | } |
5009 | 5025 | ||
5010 | static void alc_no_shutup(struct hda_codec *codec) | ||
5011 | { | ||
5012 | } | ||
5013 | |||
5014 | static void alc_fixup_no_shutup(struct hda_codec *codec, | 5026 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
5015 | const struct hda_fixup *fix, int action) | 5027 | const struct hda_fixup *fix, int action) |
5016 | { | 5028 | { |
5017 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 5029 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
5018 | struct alc_spec *spec = codec->spec; | 5030 | struct alc_spec *spec = codec->spec; |
5019 | spec->shutup = alc_no_shutup; | 5031 | spec->no_shutup_pins = 1; |
5020 | } | 5032 | } |
5021 | } | 5033 | } |
5022 | 5034 | ||
@@ -5479,7 +5491,7 @@ static void alc_headset_btn_callback(struct hda_codec *codec, | |||
5479 | jack->jack->button_state = report; | 5491 | jack->jack->button_state = report; |
5480 | } | 5492 | } |
5481 | 5493 | ||
5482 | static void alc_fixup_headset_jack(struct hda_codec *codec, | 5494 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
5483 | const struct hda_fixup *fix, int action) | 5495 | const struct hda_fixup *fix, int action) |
5484 | { | 5496 | { |
5485 | 5497 | ||
@@ -5489,6 +5501,16 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, | |||
5489 | alc_headset_btn_callback); | 5501 | alc_headset_btn_callback); |
5490 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, | 5502 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, |
5491 | SND_JACK_HEADSET, alc_headset_btn_keymap); | 5503 | SND_JACK_HEADSET, alc_headset_btn_keymap); |
5504 | switch (codec->core.vendor_id) { | ||
5505 | case 0x10ec0295: | ||
5506 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ | ||
5507 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); | ||
5508 | break; | ||
5509 | case 0x10ec0236: | ||
5510 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ | ||
5511 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); | ||
5512 | break; | ||
5513 | } | ||
5492 | break; | 5514 | break; |
5493 | case HDA_FIXUP_ACT_INIT: | 5515 | case HDA_FIXUP_ACT_INIT: |
5494 | switch (codec->core.vendor_id) { | 5516 | switch (codec->core.vendor_id) { |
@@ -5658,9 +5680,13 @@ enum { | |||
5658 | ALC294_FIXUP_ASUS_MIC, | 5680 | ALC294_FIXUP_ASUS_MIC, |
5659 | ALC294_FIXUP_ASUS_HEADSET_MIC, | 5681 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
5660 | ALC294_FIXUP_ASUS_SPK, | 5682 | ALC294_FIXUP_ASUS_SPK, |
5661 | ALC225_FIXUP_HEADSET_JACK, | ||
5662 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, | 5683 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
5663 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, | 5684 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
5685 | ALC255_FIXUP_ACER_HEADSET_MIC, | ||
5686 | ALC295_FIXUP_CHROME_BOOK, | ||
5687 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, | ||
5688 | ALC225_FIXUP_WYSE_AUTO_MUTE, | ||
5689 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, | ||
5664 | }; | 5690 | }; |
5665 | 5691 | ||
5666 | static const struct hda_fixup alc269_fixups[] = { | 5692 | static const struct hda_fixup alc269_fixups[] = { |
@@ -6603,9 +6629,9 @@ static const struct hda_fixup alc269_fixups[] = { | |||
6603 | .chained = true, | 6629 | .chained = true, |
6604 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | 6630 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
6605 | }, | 6631 | }, |
6606 | [ALC225_FIXUP_HEADSET_JACK] = { | 6632 | [ALC295_FIXUP_CHROME_BOOK] = { |
6607 | .type = HDA_FIXUP_FUNC, | 6633 | .type = HDA_FIXUP_FUNC, |
6608 | .v.func = alc_fixup_headset_jack, | 6634 | .v.func = alc295_fixup_chromebook, |
6609 | }, | 6635 | }, |
6610 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { | 6636 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
6611 | .type = HDA_FIXUP_PINS, | 6637 | .type = HDA_FIXUP_PINS, |
@@ -6627,6 +6653,38 @@ static const struct hda_fixup alc269_fixups[] = { | |||
6627 | .chained = true, | 6653 | .chained = true, |
6628 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE | 6654 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
6629 | }, | 6655 | }, |
6656 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { | ||
6657 | .type = HDA_FIXUP_PINS, | ||
6658 | .v.pins = (const struct hda_pintbl[]) { | ||
6659 | { 0x19, 0x03a11130 }, | ||
6660 | { 0x1a, 0x90a60140 }, /* use as internal mic */ | ||
6661 | { } | ||
6662 | }, | ||
6663 | .chained = true, | ||
6664 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
6665 | }, | ||
6666 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { | ||
6667 | .type = HDA_FIXUP_PINS, | ||
6668 | .v.pins = (const struct hda_pintbl[]) { | ||
6669 | { 0x16, 0x01011020 }, /* Rear Line out */ | ||
6670 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ | ||
6671 | { } | ||
6672 | }, | ||
6673 | .chained = true, | ||
6674 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE | ||
6675 | }, | ||
6676 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { | ||
6677 | .type = HDA_FIXUP_FUNC, | ||
6678 | .v.func = alc_fixup_auto_mute_via_amp, | ||
6679 | .chained = true, | ||
6680 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF | ||
6681 | }, | ||
6682 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { | ||
6683 | .type = HDA_FIXUP_FUNC, | ||
6684 | .v.func = alc_fixup_disable_mic_vref, | ||
6685 | .chained = true, | ||
6686 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
6687 | }, | ||
6630 | }; | 6688 | }; |
6631 | 6689 | ||
6632 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 6690 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -6646,6 +6704,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6646 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), | 6704 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6647 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), | 6705 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6648 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), | 6706 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6707 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), | ||
6649 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), | 6708 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
6650 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), | 6709 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
6651 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), | 6710 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
@@ -6677,6 +6736,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6677 | SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), | 6736 | SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
6678 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), | 6737 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
6679 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), | 6738 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
6739 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), | ||
6680 | SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), | 6740 | SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
6681 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), | 6741 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), |
6682 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), | 6742 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
@@ -6689,6 +6749,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6689 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | 6749 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
6690 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | 6750 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
6691 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), | 6751 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
6752 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), | ||
6753 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), | ||
6692 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), | 6754 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
6693 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 6755 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
6694 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 6756 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
@@ -6751,11 +6813,13 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6751 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 6813 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6752 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 6814 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6753 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), | 6815 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
6816 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | ||
6817 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | ||
6754 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), | 6818 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
6755 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), | 6819 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
6756 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), | 6820 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
6757 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | 6821 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6758 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | 6822 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6759 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), | 6823 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
6760 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), | 6824 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
6761 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), | 6825 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
@@ -6771,7 +6835,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6771 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), | 6835 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
6772 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), | 6836 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
6773 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), | 6837 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
6774 | SND_PCI_QUIRK(0x1043, 0x14a1, "ASUS UX533FD", ALC294_FIXUP_ASUS_SPK), | ||
6775 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), | 6838 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), |
6776 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), | 6839 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
6777 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), | 6840 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
@@ -7036,7 +7099,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
7036 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, | 7099 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
7037 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, | 7100 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
7038 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, | 7101 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
7039 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-sense-combo"}, | 7102 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"}, |
7040 | {} | 7103 | {} |
7041 | }; | 7104 | }; |
7042 | #define ALC225_STANDARD_PINS \ | 7105 | #define ALC225_STANDARD_PINS \ |
@@ -7391,6 +7454,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
7391 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, | 7454 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
7392 | {0x12, 0x90a60130}, | 7455 | {0x12, 0x90a60130}, |
7393 | {0x17, 0x90170110}, | 7456 | {0x17, 0x90170110}, |
7457 | {0x21, 0x03211020}), | ||
7458 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, | ||
7459 | {0x12, 0x90a60130}, | ||
7460 | {0x17, 0x90170110}, | ||
7394 | {0x21, 0x04211020}), | 7461 | {0x21, 0x04211020}), |
7395 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | 7462 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
7396 | ALC295_STANDARD_PINS, | 7463 | ALC295_STANDARD_PINS, |
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index b8af747ecb43..7646c93e8268 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c | |||
@@ -826,7 +826,12 @@ static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg | |||
826 | 826 | ||
827 | snd_i2c_lock(ice->i2c); | 827 | snd_i2c_lock(ice->i2c); |
828 | byte = reg; | 828 | byte = reg; |
829 | snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1); | 829 | if (snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1)) { |
830 | snd_i2c_unlock(ice->i2c); | ||
831 | dev_err(ice->card->dev, "cannot send pca\n"); | ||
832 | return -EIO; | ||
833 | } | ||
834 | |||
830 | byte = 0; | 835 | byte = 0; |
831 | if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { | 836 | if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { |
832 | snd_i2c_unlock(ice->i2c); | 837 | snd_i2c_unlock(ice->i2c); |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index f1fe497c2f9d..fa7d90ee6e2d 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -1603,10 +1603,7 @@ static void snd_ice1712_proc_read(struct snd_info_entry *entry, | |||
1603 | 1603 | ||
1604 | static void snd_ice1712_proc_init(struct snd_ice1712 *ice) | 1604 | static void snd_ice1712_proc_init(struct snd_ice1712 *ice) |
1605 | { | 1605 | { |
1606 | struct snd_info_entry *entry; | 1606 | snd_card_ro_proc_new(ice->card, "ice1712", ice, snd_ice1712_proc_read); |
1607 | |||
1608 | if (!snd_card_proc_new(ice->card, "ice1712", &entry)) | ||
1609 | snd_info_set_text_ops(entry, ice, snd_ice1712_proc_read); | ||
1610 | } | 1607 | } |
1611 | 1608 | ||
1612 | /* | 1609 | /* |
@@ -2792,9 +2789,6 @@ static int snd_ice1712_suspend(struct device *dev) | |||
2792 | 2789 | ||
2793 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2790 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2794 | 2791 | ||
2795 | snd_pcm_suspend_all(ice->pcm); | ||
2796 | snd_pcm_suspend_all(ice->pcm_pro); | ||
2797 | snd_pcm_suspend_all(ice->pcm_ds); | ||
2798 | snd_ac97_suspend(ice->ac97); | 2792 | snd_ac97_suspend(ice->ac97); |
2799 | 2793 | ||
2800 | spin_lock_irq(&ice->reg_lock); | 2794 | spin_lock_irq(&ice->reg_lock); |
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 057c2f394ea7..a7d640ee4a17 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -1571,10 +1571,7 @@ static void snd_vt1724_proc_read(struct snd_info_entry *entry, | |||
1571 | 1571 | ||
1572 | static void snd_vt1724_proc_init(struct snd_ice1712 *ice) | 1572 | static void snd_vt1724_proc_init(struct snd_ice1712 *ice) |
1573 | { | 1573 | { |
1574 | struct snd_info_entry *entry; | 1574 | snd_card_ro_proc_new(ice->card, "ice1724", ice, snd_vt1724_proc_read); |
1575 | |||
1576 | if (!snd_card_proc_new(ice->card, "ice1724", &entry)) | ||
1577 | snd_info_set_text_ops(entry, ice, snd_vt1724_proc_read); | ||
1578 | } | 1575 | } |
1579 | 1576 | ||
1580 | /* | 1577 | /* |
@@ -2804,9 +2801,6 @@ static int snd_vt1724_suspend(struct device *dev) | |||
2804 | 2801 | ||
2805 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2802 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2806 | 2803 | ||
2807 | snd_pcm_suspend_all(ice->pcm); | ||
2808 | snd_pcm_suspend_all(ice->pcm_pro); | ||
2809 | snd_pcm_suspend_all(ice->pcm_ds); | ||
2810 | snd_ac97_suspend(ice->ac97); | 2804 | snd_ac97_suspend(ice->ac97); |
2811 | 2805 | ||
2812 | spin_lock_irq(&ice->reg_lock); | 2806 | spin_lock_irq(&ice->reg_lock); |
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 93b8cfc6636f..f499f1e8d0c9 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c | |||
@@ -659,12 +659,8 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff | |||
659 | 659 | ||
660 | static void wm_proc_init(struct snd_ice1712 *ice) | 660 | static void wm_proc_init(struct snd_ice1712 *ice) |
661 | { | 661 | { |
662 | struct snd_info_entry *entry; | 662 | snd_card_rw_proc_new(ice->card, "wm_codec", ice, wm_proc_regs_read, |
663 | if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) { | 663 | wm_proc_regs_write); |
664 | snd_info_set_text_ops(entry, ice, wm_proc_regs_read); | ||
665 | entry->mode |= 0200; | ||
666 | entry->c.text.write = wm_proc_regs_write; | ||
667 | } | ||
668 | } | 664 | } |
669 | 665 | ||
670 | static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) | 666 | static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
@@ -684,9 +680,7 @@ static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff | |||
684 | 680 | ||
685 | static void cs_proc_init(struct snd_ice1712 *ice) | 681 | static void cs_proc_init(struct snd_ice1712 *ice) |
686 | { | 682 | { |
687 | struct snd_info_entry *entry; | 683 | snd_card_ro_proc_new(ice->card, "cs_codec", ice, cs_proc_regs_read); |
688 | if (! snd_card_proc_new(ice->card, "cs_codec", &entry)) | ||
689 | snd_info_set_text_ops(entry, ice, cs_proc_regs_read); | ||
690 | } | 684 | } |
691 | 685 | ||
692 | 686 | ||
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 3919aed39ca0..d243309029d3 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c | |||
@@ -651,9 +651,8 @@ static void stac9460_proc_regs_read(struct snd_info_entry *entry, | |||
651 | 651 | ||
652 | static void stac9460_proc_init(struct snd_ice1712 *ice) | 652 | static void stac9460_proc_init(struct snd_ice1712 *ice) |
653 | { | 653 | { |
654 | struct snd_info_entry *entry; | 654 | snd_card_ro_proc_new(ice->card, "stac9460_codec", ice, |
655 | if (!snd_card_proc_new(ice->card, "stac9460_codec", &entry)) | 655 | stac9460_proc_regs_read); |
656 | snd_info_set_text_ops(entry, ice, stac9460_proc_regs_read); | ||
657 | } | 656 | } |
658 | 657 | ||
659 | 658 | ||
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index c97b5528e4b8..72f252c936e5 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c | |||
@@ -904,12 +904,8 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, | |||
904 | 904 | ||
905 | static void wm_proc_init(struct snd_ice1712 *ice) | 905 | static void wm_proc_init(struct snd_ice1712 *ice) |
906 | { | 906 | { |
907 | struct snd_info_entry *entry; | 907 | snd_card_rw_proc_new(ice->card, "wm_codec", ice, wm_proc_regs_read, |
908 | if (!snd_card_proc_new(ice->card, "wm_codec", &entry)) { | 908 | wm_proc_regs_write); |
909 | snd_info_set_text_ops(entry, ice, wm_proc_regs_read); | ||
910 | entry->mode |= 0200; | ||
911 | entry->c.text.write = wm_proc_regs_write; | ||
912 | } | ||
913 | } | 909 | } |
914 | 910 | ||
915 | static int prodigy_hifi_add_controls(struct snd_ice1712 *ice) | 911 | static int prodigy_hifi_add_controls(struct snd_ice1712 *ice) |
diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 5bc836241c97..8ad964ee0b65 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c | |||
@@ -502,9 +502,7 @@ static void proc_regs_read(struct snd_info_entry *entry, | |||
502 | 502 | ||
503 | static void proc_init(struct snd_ice1712 *ice) | 503 | static void proc_init(struct snd_ice1712 *ice) |
504 | { | 504 | { |
505 | struct snd_info_entry *entry; | 505 | snd_card_ro_proc_new(ice->card, "quartet", ice, proc_regs_read); |
506 | if (!snd_card_proc_new(ice->card, "quartet", &entry)) | ||
507 | snd_info_set_text_ops(entry, ice, proc_regs_read); | ||
508 | } | 506 | } |
509 | 507 | ||
510 | static int qtet_mute_get(struct snd_kcontrol *kcontrol, | 508 | static int qtet_mute_get(struct snd_kcontrol *kcontrol, |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index ffddcdfe0c66..2784bf48cf5a 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -2614,8 +2614,6 @@ static int intel8x0_suspend(struct device *dev) | |||
2614 | int i; | 2614 | int i; |
2615 | 2615 | ||
2616 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2616 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2617 | for (i = 0; i < chip->pcm_devs; i++) | ||
2618 | snd_pcm_suspend_all(chip->pcm[i]); | ||
2619 | for (i = 0; i < chip->ncodecs; i++) | 2617 | for (i = 0; i < chip->ncodecs; i++) |
2620 | snd_ac97_suspend(chip->ac97[i]); | 2618 | snd_ac97_suspend(chip->ac97[i]); |
2621 | if (chip->device_type == DEVICE_INTEL_ICH4) | 2619 | if (chip->device_type == DEVICE_INTEL_ICH4) |
@@ -2865,10 +2863,8 @@ static void snd_intel8x0_proc_read(struct snd_info_entry * entry, | |||
2865 | 2863 | ||
2866 | static void snd_intel8x0_proc_init(struct intel8x0 *chip) | 2864 | static void snd_intel8x0_proc_init(struct intel8x0 *chip) |
2867 | { | 2865 | { |
2868 | struct snd_info_entry *entry; | 2866 | snd_card_ro_proc_new(chip->card, "intel8x0", chip, |
2869 | 2867 | snd_intel8x0_proc_read); | |
2870 | if (! snd_card_proc_new(chip->card, "intel8x0", &entry)) | ||
2871 | snd_info_set_text_ops(entry, chip, snd_intel8x0_proc_read); | ||
2872 | } | 2868 | } |
2873 | 2869 | ||
2874 | static int snd_intel8x0_dev_free(struct snd_device *device) | 2870 | static int snd_intel8x0_dev_free(struct snd_device *device) |
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index c84629190cba..43c654e15452 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -1025,11 +1025,8 @@ static int intel8x0m_suspend(struct device *dev) | |||
1025 | { | 1025 | { |
1026 | struct snd_card *card = dev_get_drvdata(dev); | 1026 | struct snd_card *card = dev_get_drvdata(dev); |
1027 | struct intel8x0m *chip = card->private_data; | 1027 | struct intel8x0m *chip = card->private_data; |
1028 | int i; | ||
1029 | 1028 | ||
1030 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1029 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1031 | for (i = 0; i < chip->pcm_devs; i++) | ||
1032 | snd_pcm_suspend_all(chip->pcm[i]); | ||
1033 | snd_ac97_suspend(chip->ac97); | 1030 | snd_ac97_suspend(chip->ac97); |
1034 | if (chip->irq >= 0) { | 1031 | if (chip->irq >= 0) { |
1035 | free_irq(chip->irq, chip); | 1032 | free_irq(chip->irq, chip); |
@@ -1087,10 +1084,8 @@ static void snd_intel8x0m_proc_read(struct snd_info_entry * entry, | |||
1087 | 1084 | ||
1088 | static void snd_intel8x0m_proc_init(struct intel8x0m *chip) | 1085 | static void snd_intel8x0m_proc_init(struct intel8x0m *chip) |
1089 | { | 1086 | { |
1090 | struct snd_info_entry *entry; | 1087 | snd_card_ro_proc_new(chip->card, "intel8x0m", chip, |
1091 | 1088 | snd_intel8x0m_proc_read); | |
1092 | if (! snd_card_proc_new(chip->card, "intel8x0m", &entry)) | ||
1093 | snd_info_set_text_ops(entry, chip, snd_intel8x0m_proc_read); | ||
1094 | } | 1089 | } |
1095 | 1090 | ||
1096 | static int snd_intel8x0m_dev_free(struct snd_device *device) | 1091 | static int snd_intel8x0m_dev_free(struct snd_device *device) |
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 4e189a93f475..fe4aba8a08ea 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c | |||
@@ -2090,10 +2090,8 @@ static void snd_korg1212_proc_read(struct snd_info_entry *entry, | |||
2090 | 2090 | ||
2091 | static void snd_korg1212_proc_init(struct snd_korg1212 *korg1212) | 2091 | static void snd_korg1212_proc_init(struct snd_korg1212 *korg1212) |
2092 | { | 2092 | { |
2093 | struct snd_info_entry *entry; | 2093 | snd_card_ro_proc_new(korg1212->card, "korg1212", korg1212, |
2094 | 2094 | snd_korg1212_proc_read); | |
2095 | if (! snd_card_proc_new(korg1212->card, "korg1212", &entry)) | ||
2096 | snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read); | ||
2097 | } | 2095 | } |
2098 | 2096 | ||
2099 | static int | 2097 | static int |
diff --git a/sound/pci/lola/lola_proc.c b/sound/pci/lola/lola_proc.c index 904e3c4f4dfe..1603f9c81897 100644 --- a/sound/pci/lola/lola_proc.c +++ b/sound/pci/lola/lola_proc.c | |||
@@ -208,15 +208,9 @@ static void lola_proc_regs_read(struct snd_info_entry *entry, | |||
208 | 208 | ||
209 | void lola_proc_debug_new(struct lola *chip) | 209 | void lola_proc_debug_new(struct lola *chip) |
210 | { | 210 | { |
211 | struct snd_info_entry *entry; | 211 | snd_card_ro_proc_new(chip->card, "codec", chip, lola_proc_codec_read); |
212 | 212 | snd_card_rw_proc_new(chip->card, "codec_rw", chip, | |
213 | if (!snd_card_proc_new(chip->card, "codec", &entry)) | 213 | lola_proc_codec_rw_read, |
214 | snd_info_set_text_ops(entry, chip, lola_proc_codec_read); | 214 | lola_proc_codec_rw_write); |
215 | if (!snd_card_proc_new(chip->card, "codec_rw", &entry)) { | 215 | snd_card_ro_proc_new(chip->card, "regs", chip, lola_proc_regs_read); |
216 | snd_info_set_text_ops(entry, chip, lola_proc_codec_rw_read); | ||
217 | entry->mode |= 0200; | ||
218 | entry->c.text.write = lola_proc_codec_rw_write; | ||
219 | } | ||
220 | if (!snd_card_proc_new(chip->card, "regs", &entry)) | ||
221 | snd_info_set_text_ops(entry, chip, lola_proc_regs_read); | ||
222 | } | 216 | } |
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 54f6252faca6..ae23a2dfbdea 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c | |||
@@ -854,11 +854,9 @@ static int lx_pcm_create(struct lx6464es *chip) | |||
854 | pcm->nonatomic = true; | 854 | pcm->nonatomic = true; |
855 | strcpy(pcm->name, card_name); | 855 | strcpy(pcm->name, card_name); |
856 | 856 | ||
857 | err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 857 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
858 | snd_dma_pci_data(chip->pci), | 858 | snd_dma_pci_data(chip->pci), |
859 | size, size); | 859 | size, size); |
860 | if (err < 0) | ||
861 | return err; | ||
862 | 860 | ||
863 | chip->pcm = pcm; | 861 | chip->pcm = pcm; |
864 | chip->capture_stream.is_capture = 1; | 862 | chip->capture_stream.is_capture = 1; |
@@ -948,13 +946,7 @@ static void lx_proc_levels_read(struct snd_info_entry *entry, | |||
948 | 946 | ||
949 | static int lx_proc_create(struct snd_card *card, struct lx6464es *chip) | 947 | static int lx_proc_create(struct snd_card *card, struct lx6464es *chip) |
950 | { | 948 | { |
951 | struct snd_info_entry *entry; | 949 | return snd_card_ro_proc_new(card, "levels", chip, lx_proc_levels_read); |
952 | int err = snd_card_proc_new(card, "levels", &entry); | ||
953 | if (err < 0) | ||
954 | return err; | ||
955 | |||
956 | snd_info_set_text_ops(entry, chip, lx_proc_levels_read); | ||
957 | return 0; | ||
958 | } | 950 | } |
959 | 951 | ||
960 | 952 | ||
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 62962178a9d7..1a9468c14aaf 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c | |||
@@ -2422,7 +2422,6 @@ static int m3_suspend(struct device *dev) | |||
2422 | chip->in_suspend = 1; | 2422 | chip->in_suspend = 1; |
2423 | cancel_work_sync(&chip->hwvol_work); | 2423 | cancel_work_sync(&chip->hwvol_work); |
2424 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2424 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2425 | snd_pcm_suspend_all(chip->pcm); | ||
2426 | snd_ac97_suspend(chip->ac97); | 2425 | snd_ac97_suspend(chip->ac97); |
2427 | 2426 | ||
2428 | msleep(10); /* give the assp a chance to idle.. */ | 2427 | msleep(10); /* give the assp a chance to idle.. */ |
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 9cd297a42f24..92f616df3863 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -1220,10 +1220,8 @@ static void snd_mixart_proc_init(struct snd_mixart *chip) | |||
1220 | struct snd_info_entry *entry; | 1220 | struct snd_info_entry *entry; |
1221 | 1221 | ||
1222 | /* text interface to read perf and temp meters */ | 1222 | /* text interface to read perf and temp meters */ |
1223 | if (! snd_card_proc_new(chip->card, "board_info", &entry)) { | 1223 | snd_card_ro_proc_new(chip->card, "board_info", chip, |
1224 | entry->private_data = chip; | 1224 | snd_mixart_proc_read); |
1225 | entry->c.text.read = snd_mixart_proc_read; | ||
1226 | } | ||
1227 | 1225 | ||
1228 | if (! snd_card_proc_new(chip->card, "mixart_BA0", &entry)) { | 1226 | if (! snd_card_proc_new(chip->card, "mixart_BA0", &entry)) { |
1229 | entry->content = SNDRV_INFO_CONTENT_DATA; | 1227 | entry->content = SNDRV_INFO_CONTENT_DATA; |
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index b97f4ea6b56c..85e46ff44ac3 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c | |||
@@ -1413,7 +1413,6 @@ static int nm256_suspend(struct device *dev) | |||
1413 | struct nm256 *chip = card->private_data; | 1413 | struct nm256 *chip = card->private_data; |
1414 | 1414 | ||
1415 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1415 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1416 | snd_pcm_suspend_all(chip->pcm); | ||
1417 | snd_ac97_suspend(chip->ac97); | 1416 | snd_ac97_suspend(chip->ac97); |
1418 | chip->coeffs_current = 0; | 1417 | chip->coeffs_current = 0; |
1419 | return 0; | 1418 | return 0; |
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index b4ef5804212d..3ae9dd4b39e8 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -244,10 +244,7 @@ static void oxygen_proc_read(struct snd_info_entry *entry, | |||
244 | 244 | ||
245 | static void oxygen_proc_init(struct oxygen *chip) | 245 | static void oxygen_proc_init(struct oxygen *chip) |
246 | { | 246 | { |
247 | struct snd_info_entry *entry; | 247 | snd_card_ro_proc_new(chip->card, "oxygen", chip, oxygen_proc_read); |
248 | |||
249 | if (!snd_card_proc_new(chip->card, "oxygen", &entry)) | ||
250 | snd_info_set_text_ops(entry, chip, oxygen_proc_read); | ||
251 | } | 248 | } |
252 | 249 | ||
253 | static const struct pci_device_id * | 250 | static const struct pci_device_id * |
@@ -373,7 +370,7 @@ static void oxygen_init(struct oxygen *chip) | |||
373 | for (i = 0; i < 8; ++i) | 370 | for (i = 0; i < 8; ++i) |
374 | chip->dac_volume[i] = chip->model.dac_volume_min; | 371 | chip->dac_volume[i] = chip->model.dac_volume_min; |
375 | chip->dac_mute = 1; | 372 | chip->dac_mute = 1; |
376 | chip->spdif_playback_enable = 1; | 373 | chip->spdif_playback_enable = 0; |
377 | chip->spdif_bits = OXYGEN_SPDIF_C | OXYGEN_SPDIF_ORIGINAL | | 374 | chip->spdif_bits = OXYGEN_SPDIF_C | OXYGEN_SPDIF_ORIGINAL | |
378 | (IEC958_AES1_CON_PCM_CODER << OXYGEN_SPDIF_CATEGORY_SHIFT); | 375 | (IEC958_AES1_CON_PCM_CODER << OXYGEN_SPDIF_CATEGORY_SHIFT); |
379 | chip->spdif_pcm_bits = chip->spdif_bits; | 376 | chip->spdif_pcm_bits = chip->spdif_bits; |
@@ -744,13 +741,10 @@ static int oxygen_pci_suspend(struct device *dev) | |||
744 | { | 741 | { |
745 | struct snd_card *card = dev_get_drvdata(dev); | 742 | struct snd_card *card = dev_get_drvdata(dev); |
746 | struct oxygen *chip = card->private_data; | 743 | struct oxygen *chip = card->private_data; |
747 | unsigned int i, saved_interrupt_mask; | 744 | unsigned int saved_interrupt_mask; |
748 | 745 | ||
749 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 746 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
750 | 747 | ||
751 | for (i = 0; i < PCM_COUNT; ++i) | ||
752 | snd_pcm_suspend(chip->streams[i]); | ||
753 | |||
754 | if (chip->model.suspend) | 748 | if (chip->model.suspend) |
755 | chip->model.suspend(chip); | 749 | chip->model.suspend(chip); |
756 | 750 | ||
diff --git a/sound/pci/oxygen/pcm1796.h b/sound/pci/oxygen/pcm1796.h index 34d07dd2d22e..d5dcb09e44cd 100644 --- a/sound/pci/oxygen/pcm1796.h +++ b/sound/pci/oxygen/pcm1796.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #define PCM1796_MUTE 0x01 | 10 | #define PCM1796_MUTE 0x01 |
11 | #define PCM1796_DME 0x02 | 11 | #define PCM1796_DME 0x02 |
12 | #define PCM1796_DMF_MASK 0x0c | 12 | #define PCM1796_DMF_MASK 0x0c |
13 | #define PCM1796_DMF_DISABLED 0x00 | ||
14 | #define PCM1796_DMF_48 0x04 | 13 | #define PCM1796_DMF_48 0x04 |
15 | #define PCM1796_DMF_441 0x08 | 14 | #define PCM1796_DMF_441 0x08 |
16 | #define PCM1796_DMF_32 0x0c | 15 | #define PCM1796_DMF_32 0x0c |
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c index 24109d37ca09..a1c6b98b191e 100644 --- a/sound/pci/oxygen/xonar_pcm179x.c +++ b/sound/pci/oxygen/xonar_pcm179x.c | |||
@@ -331,7 +331,7 @@ static void pcm1796_init(struct oxygen *chip) | |||
331 | struct xonar_pcm179x *data = chip->model_data; | 331 | struct xonar_pcm179x *data = chip->model_data; |
332 | 332 | ||
333 | data->pcm1796_regs[0][18 - PCM1796_REG_BASE] = | 333 | data->pcm1796_regs[0][18 - PCM1796_REG_BASE] = |
334 | PCM1796_DMF_DISABLED | PCM1796_FMT_24_I2S | PCM1796_ATLD; | 334 | PCM1796_FMT_24_I2S | PCM1796_ATLD; |
335 | if (!data->broken_i2c) | 335 | if (!data->broken_i2c) |
336 | data->pcm1796_regs[0][18 - PCM1796_REG_BASE] |= PCM1796_MUTE; | 336 | data->pcm1796_regs[0][18 - PCM1796_REG_BASE] |= PCM1796_MUTE; |
337 | data->pcm1796_regs[0][19 - PCM1796_REG_BASE] = | 337 | data->pcm1796_regs[0][19 - PCM1796_REG_BASE] = |
@@ -621,6 +621,23 @@ static void update_pcm1796_oversampling(struct oxygen *chip) | |||
621 | pcm1796_write_cached(chip, i, 20, reg); | 621 | pcm1796_write_cached(chip, i, 20, reg); |
622 | } | 622 | } |
623 | 623 | ||
624 | static void update_pcm1796_deemph(struct oxygen *chip) | ||
625 | { | ||
626 | struct xonar_pcm179x *data = chip->model_data; | ||
627 | unsigned int i; | ||
628 | u8 reg; | ||
629 | |||
630 | reg = data->pcm1796_regs[0][18 - PCM1796_REG_BASE] & ~PCM1796_DMF_MASK; | ||
631 | if (data->current_rate == 48000) | ||
632 | reg |= PCM1796_DMF_48; | ||
633 | else if (data->current_rate == 44100) | ||
634 | reg |= PCM1796_DMF_441; | ||
635 | else if (data->current_rate == 32000) | ||
636 | reg |= PCM1796_DMF_32; | ||
637 | for (i = 0; i < data->dacs; ++i) | ||
638 | pcm1796_write_cached(chip, i, 18, reg); | ||
639 | } | ||
640 | |||
624 | static void set_pcm1796_params(struct oxygen *chip, | 641 | static void set_pcm1796_params(struct oxygen *chip, |
625 | struct snd_pcm_hw_params *params) | 642 | struct snd_pcm_hw_params *params) |
626 | { | 643 | { |
@@ -629,6 +646,7 @@ static void set_pcm1796_params(struct oxygen *chip, | |||
629 | msleep(1); | 646 | msleep(1); |
630 | data->current_rate = params_rate(params); | 647 | data->current_rate = params_rate(params); |
631 | update_pcm1796_oversampling(chip); | 648 | update_pcm1796_oversampling(chip); |
649 | update_pcm1796_deemph(chip); | ||
632 | } | 650 | } |
633 | 651 | ||
634 | static void update_pcm1796_volume(struct oxygen *chip) | 652 | static void update_pcm1796_volume(struct oxygen *chip) |
@@ -653,9 +671,11 @@ static void update_pcm1796_mute(struct oxygen *chip) | |||
653 | unsigned int i; | 671 | unsigned int i; |
654 | u8 value; | 672 | u8 value; |
655 | 673 | ||
656 | value = PCM1796_DMF_DISABLED | PCM1796_FMT_24_I2S | PCM1796_ATLD; | 674 | value = data->pcm1796_regs[0][18 - PCM1796_REG_BASE]; |
657 | if (chip->dac_mute) | 675 | if (chip->dac_mute) |
658 | value |= PCM1796_MUTE; | 676 | value |= PCM1796_MUTE; |
677 | else | ||
678 | value &= ~PCM1796_MUTE; | ||
659 | for (i = 0; i < data->dacs; ++i) | 679 | for (i = 0; i < data->dacs; ++i) |
660 | pcm1796_write_cached(chip, i, 18, value); | 680 | pcm1796_write_cached(chip, i, 18, value); |
661 | } | 681 | } |
@@ -777,6 +797,49 @@ static const struct snd_kcontrol_new rolloff_control = { | |||
777 | .put = rolloff_put, | 797 | .put = rolloff_put, |
778 | }; | 798 | }; |
779 | 799 | ||
800 | static int deemph_get(struct snd_kcontrol *ctl, | ||
801 | struct snd_ctl_elem_value *value) | ||
802 | { | ||
803 | struct oxygen *chip = ctl->private_data; | ||
804 | struct xonar_pcm179x *data = chip->model_data; | ||
805 | |||
806 | value->value.integer.value[0] = | ||
807 | !!(data->pcm1796_regs[0][18 - PCM1796_REG_BASE] & PCM1796_DME); | ||
808 | return 0; | ||
809 | } | ||
810 | |||
811 | static int deemph_put(struct snd_kcontrol *ctl, | ||
812 | struct snd_ctl_elem_value *value) | ||
813 | { | ||
814 | struct oxygen *chip = ctl->private_data; | ||
815 | struct xonar_pcm179x *data = chip->model_data; | ||
816 | unsigned int i; | ||
817 | int changed; | ||
818 | u8 reg; | ||
819 | |||
820 | mutex_lock(&chip->mutex); | ||
821 | reg = data->pcm1796_regs[0][18 - PCM1796_REG_BASE]; | ||
822 | if (!value->value.integer.value[0]) | ||
823 | reg &= ~PCM1796_DME; | ||
824 | else | ||
825 | reg |= PCM1796_DME; | ||
826 | changed = reg != data->pcm1796_regs[0][18 - PCM1796_REG_BASE]; | ||
827 | if (changed) { | ||
828 | for (i = 0; i < data->dacs; ++i) | ||
829 | pcm1796_write(chip, i, 18, reg); | ||
830 | } | ||
831 | mutex_unlock(&chip->mutex); | ||
832 | return changed; | ||
833 | } | ||
834 | |||
835 | static const struct snd_kcontrol_new deemph_control = { | ||
836 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
837 | .name = "De-emphasis Playback Switch", | ||
838 | .info = snd_ctl_boolean_mono_info, | ||
839 | .get = deemph_get, | ||
840 | .put = deemph_put, | ||
841 | }; | ||
842 | |||
780 | static const struct snd_kcontrol_new hdav_hdmi_control = { | 843 | static const struct snd_kcontrol_new hdav_hdmi_control = { |
781 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 844 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
782 | .name = "HDMI Playback Switch", | 845 | .name = "HDMI Playback Switch", |
@@ -1011,6 +1074,10 @@ static int add_pcm1796_controls(struct oxygen *chip) | |||
1011 | snd_ctl_new1(&rolloff_control, chip)); | 1074 | snd_ctl_new1(&rolloff_control, chip)); |
1012 | if (err < 0) | 1075 | if (err < 0) |
1013 | return err; | 1076 | return err; |
1077 | err = snd_ctl_add(chip->card, | ||
1078 | snd_ctl_new1(&deemph_control, chip)); | ||
1079 | if (err < 0) | ||
1080 | return err; | ||
1014 | } | 1081 | } |
1015 | return 0; | 1082 | return 0; |
1016 | } | 1083 | } |
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index e57da4036231..4ab7efc6e9f7 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c | |||
@@ -1454,21 +1454,14 @@ static void pcxhr_proc_ltc(struct snd_info_entry *entry, | |||
1454 | 1454 | ||
1455 | static void pcxhr_proc_init(struct snd_pcxhr *chip) | 1455 | static void pcxhr_proc_init(struct snd_pcxhr *chip) |
1456 | { | 1456 | { |
1457 | struct snd_info_entry *entry; | 1457 | snd_card_ro_proc_new(chip->card, "info", chip, pcxhr_proc_info); |
1458 | 1458 | snd_card_ro_proc_new(chip->card, "sync", chip, pcxhr_proc_sync); | |
1459 | if (! snd_card_proc_new(chip->card, "info", &entry)) | ||
1460 | snd_info_set_text_ops(entry, chip, pcxhr_proc_info); | ||
1461 | if (! snd_card_proc_new(chip->card, "sync", &entry)) | ||
1462 | snd_info_set_text_ops(entry, chip, pcxhr_proc_sync); | ||
1463 | /* gpio available on stereo sound cards only */ | 1459 | /* gpio available on stereo sound cards only */ |
1464 | if (chip->mgr->is_hr_stereo && | 1460 | if (chip->mgr->is_hr_stereo) |
1465 | !snd_card_proc_new(chip->card, "gpio", &entry)) { | 1461 | snd_card_rw_proc_new(chip->card, "gpio", chip, |
1466 | snd_info_set_text_ops(entry, chip, pcxhr_proc_gpio_read); | 1462 | pcxhr_proc_gpio_read, |
1467 | entry->c.text.write = pcxhr_proc_gpo_write; | 1463 | pcxhr_proc_gpo_write); |
1468 | entry->mode |= 0200; | 1464 | snd_card_ro_proc_new(chip->card, "ltc", chip, pcxhr_proc_ltc); |
1469 | } | ||
1470 | if (!snd_card_proc_new(chip->card, "ltc", &entry)) | ||
1471 | snd_info_set_text_ops(entry, chip, pcxhr_proc_ltc); | ||
1472 | } | 1465 | } |
1473 | /* end of proc interface */ | 1466 | /* end of proc interface */ |
1474 | 1467 | ||
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 23017e3bc76c..8d1a56a9bcfd 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1158,7 +1158,6 @@ static int riptide_suspend(struct device *dev) | |||
1158 | 1158 | ||
1159 | chip->in_suspend = 1; | 1159 | chip->in_suspend = 1; |
1160 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1160 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1161 | snd_pcm_suspend_all(chip->pcm); | ||
1162 | snd_ac97_suspend(chip->ac97); | 1161 | snd_ac97_suspend(chip->ac97); |
1163 | return 0; | 1162 | return 0; |
1164 | } | 1163 | } |
@@ -1974,10 +1973,8 @@ snd_riptide_proc_read(struct snd_info_entry *entry, | |||
1974 | 1973 | ||
1975 | static void snd_riptide_proc_init(struct snd_riptide *chip) | 1974 | static void snd_riptide_proc_init(struct snd_riptide *chip) |
1976 | { | 1975 | { |
1977 | struct snd_info_entry *entry; | 1976 | snd_card_ro_proc_new(chip->card, "riptide", chip, |
1978 | 1977 | snd_riptide_proc_read); | |
1979 | if (!snd_card_proc_new(chip->card, "riptide", &entry)) | ||
1980 | snd_info_set_text_ops(entry, chip, snd_riptide_proc_read); | ||
1981 | } | 1978 | } |
1982 | 1979 | ||
1983 | static int snd_riptide_mixer(struct snd_riptide *chip) | 1980 | static int snd_riptide_mixer(struct snd_riptide *chip) |
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c index 3ac8c71d567c..c6bcc0715716 100644 --- a/sound/pci/rme32.c +++ b/sound/pci/rme32.c | |||
@@ -1568,10 +1568,7 @@ snd_rme32_proc_read(struct snd_info_entry * entry, struct snd_info_buffer *buffe | |||
1568 | 1568 | ||
1569 | static void snd_rme32_proc_init(struct rme32 *rme32) | 1569 | static void snd_rme32_proc_init(struct rme32 *rme32) |
1570 | { | 1570 | { |
1571 | struct snd_info_entry *entry; | 1571 | snd_card_ro_proc_new(rme32->card, "rme32", rme32, snd_rme32_proc_read); |
1572 | |||
1573 | if (! snd_card_proc_new(rme32->card, "rme32", &entry)) | ||
1574 | snd_info_set_text_ops(entry, rme32, snd_rme32_proc_read); | ||
1575 | } | 1572 | } |
1576 | 1573 | ||
1577 | /* | 1574 | /* |
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index dcfa4d7a73e2..42c6b5e09072 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c | |||
@@ -1868,10 +1868,7 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer | |||
1868 | 1868 | ||
1869 | static void snd_rme96_proc_init(struct rme96 *rme96) | 1869 | static void snd_rme96_proc_init(struct rme96 *rme96) |
1870 | { | 1870 | { |
1871 | struct snd_info_entry *entry; | 1871 | snd_card_ro_proc_new(rme96->card, "rme96", rme96, snd_rme96_proc_read); |
1872 | |||
1873 | if (! snd_card_proc_new(rme96->card, "rme96", &entry)) | ||
1874 | snd_info_set_text_ops(entry, rme96, snd_rme96_proc_read); | ||
1875 | } | 1872 | } |
1876 | 1873 | ||
1877 | /* | 1874 | /* |
@@ -2388,8 +2385,6 @@ static int rme96_suspend(struct device *dev) | |||
2388 | struct rme96 *rme96 = card->private_data; | 2385 | struct rme96 *rme96 = card->private_data; |
2389 | 2386 | ||
2390 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2387 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2391 | snd_pcm_suspend(rme96->playback_substream); | ||
2392 | snd_pcm_suspend(rme96->capture_substream); | ||
2393 | 2388 | ||
2394 | /* save capture & playback pointers */ | 2389 | /* save capture & playback pointers */ |
2395 | rme96->playback_pointer = readl(rme96->iobase + RME96_IO_GET_PLAY_POS) | 2390 | rme96->playback_pointer = readl(rme96->iobase + RME96_IO_GET_PLAY_POS) |
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index ba99ff0e93e0..29bef48a3af3 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -3708,10 +3708,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) | |||
3708 | 3708 | ||
3709 | static void snd_hdsp_proc_init(struct hdsp *hdsp) | 3709 | static void snd_hdsp_proc_init(struct hdsp *hdsp) |
3710 | { | 3710 | { |
3711 | struct snd_info_entry *entry; | 3711 | snd_card_ro_proc_new(hdsp->card, "hdsp", hdsp, snd_hdsp_proc_read); |
3712 | |||
3713 | if (! snd_card_proc_new(hdsp->card, "hdsp", &entry)) | ||
3714 | snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read); | ||
3715 | } | 3712 | } |
3716 | 3713 | ||
3717 | static void snd_hdsp_free_buffers(struct hdsp *hdsp) | 3714 | static void snd_hdsp_free_buffers(struct hdsp *hdsp) |
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 679ad0415e3b..1209cf0b05e0 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -5287,44 +5287,35 @@ static void snd_hdspm_proc_ports_out(struct snd_info_entry *entry, | |||
5287 | 5287 | ||
5288 | static void snd_hdspm_proc_init(struct hdspm *hdspm) | 5288 | static void snd_hdspm_proc_init(struct hdspm *hdspm) |
5289 | { | 5289 | { |
5290 | struct snd_info_entry *entry; | 5290 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *) = NULL; |
5291 | 5291 | ||
5292 | if (!snd_card_proc_new(hdspm->card, "hdspm", &entry)) { | 5292 | switch (hdspm->io_type) { |
5293 | switch (hdspm->io_type) { | 5293 | case AES32: |
5294 | case AES32: | 5294 | read = snd_hdspm_proc_read_aes32; |
5295 | snd_info_set_text_ops(entry, hdspm, | 5295 | break; |
5296 | snd_hdspm_proc_read_aes32); | 5296 | case MADI: |
5297 | break; | 5297 | read = snd_hdspm_proc_read_madi; |
5298 | case MADI: | 5298 | break; |
5299 | snd_info_set_text_ops(entry, hdspm, | 5299 | case MADIface: |
5300 | snd_hdspm_proc_read_madi); | 5300 | /* read = snd_hdspm_proc_read_madiface; */ |
5301 | break; | 5301 | break; |
5302 | case MADIface: | 5302 | case RayDAT: |
5303 | /* snd_info_set_text_ops(entry, hdspm, | 5303 | read = snd_hdspm_proc_read_raydat; |
5304 | snd_hdspm_proc_read_madiface); */ | 5304 | break; |
5305 | break; | 5305 | case AIO: |
5306 | case RayDAT: | 5306 | break; |
5307 | snd_info_set_text_ops(entry, hdspm, | ||
5308 | snd_hdspm_proc_read_raydat); | ||
5309 | break; | ||
5310 | case AIO: | ||
5311 | break; | ||
5312 | } | ||
5313 | } | ||
5314 | |||
5315 | if (!snd_card_proc_new(hdspm->card, "ports.in", &entry)) { | ||
5316 | snd_info_set_text_ops(entry, hdspm, snd_hdspm_proc_ports_in); | ||
5317 | } | 5307 | } |
5318 | 5308 | ||
5319 | if (!snd_card_proc_new(hdspm->card, "ports.out", &entry)) { | 5309 | snd_card_ro_proc_new(hdspm->card, "hdspm", hdspm, read); |
5320 | snd_info_set_text_ops(entry, hdspm, snd_hdspm_proc_ports_out); | 5310 | snd_card_ro_proc_new(hdspm->card, "ports.in", hdspm, |
5321 | } | 5311 | snd_hdspm_proc_ports_in); |
5312 | snd_card_ro_proc_new(hdspm->card, "ports.out", hdspm, | ||
5313 | snd_hdspm_proc_ports_out); | ||
5322 | 5314 | ||
5323 | #ifdef CONFIG_SND_DEBUG | 5315 | #ifdef CONFIG_SND_DEBUG |
5324 | /* debug file to read all hdspm registers */ | 5316 | /* debug file to read all hdspm registers */ |
5325 | if (!snd_card_proc_new(hdspm->card, "debug", &entry)) | 5317 | snd_card_ro_proc_new(hdspm->card, "debug", hdspm, |
5326 | snd_info_set_text_ops(entry, hdspm, | 5318 | snd_hdspm_proc_read_debug); |
5327 | snd_hdspm_proc_read_debug); | ||
5328 | #endif | 5319 | #endif |
5329 | } | 5320 | } |
5330 | 5321 | ||
@@ -6411,7 +6402,6 @@ static int snd_hdspm_create_hwdep(struct snd_card *card, | |||
6411 | ------------------------------------------------------------*/ | 6402 | ------------------------------------------------------------*/ |
6412 | static int snd_hdspm_preallocate_memory(struct hdspm *hdspm) | 6403 | static int snd_hdspm_preallocate_memory(struct hdspm *hdspm) |
6413 | { | 6404 | { |
6414 | int err; | ||
6415 | struct snd_pcm *pcm; | 6405 | struct snd_pcm *pcm; |
6416 | size_t wanted; | 6406 | size_t wanted; |
6417 | 6407 | ||
@@ -6419,21 +6409,10 @@ static int snd_hdspm_preallocate_memory(struct hdspm *hdspm) | |||
6419 | 6409 | ||
6420 | wanted = HDSPM_DMA_AREA_BYTES; | 6410 | wanted = HDSPM_DMA_AREA_BYTES; |
6421 | 6411 | ||
6422 | err = | 6412 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
6423 | snd_pcm_lib_preallocate_pages_for_all(pcm, | 6413 | snd_dma_pci_data(hdspm->pci), |
6424 | SNDRV_DMA_TYPE_DEV_SG, | 6414 | wanted, wanted); |
6425 | snd_dma_pci_data(hdspm->pci), | 6415 | dev_dbg(hdspm->card->dev, " Preallocated %zd Bytes\n", wanted); |
6426 | wanted, | ||
6427 | wanted); | ||
6428 | if (err < 0) { | ||
6429 | dev_dbg(hdspm->card->dev, | ||
6430 | "Could not preallocate %zd Bytes\n", wanted); | ||
6431 | |||
6432 | return err; | ||
6433 | } else | ||
6434 | dev_dbg(hdspm->card->dev, | ||
6435 | " Preallocated %zd Bytes\n", wanted); | ||
6436 | |||
6437 | return 0; | 6416 | return 0; |
6438 | } | 6417 | } |
6439 | 6418 | ||
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index edd765e22377..5228b982da5a 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c | |||
@@ -1737,10 +1737,8 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff | |||
1737 | 1737 | ||
1738 | static void snd_rme9652_proc_init(struct snd_rme9652 *rme9652) | 1738 | static void snd_rme9652_proc_init(struct snd_rme9652 *rme9652) |
1739 | { | 1739 | { |
1740 | struct snd_info_entry *entry; | 1740 | snd_card_ro_proc_new(rme9652->card, "rme9652", rme9652, |
1741 | 1741 | snd_rme9652_proc_read); | |
1742 | if (! snd_card_proc_new(rme9652->card, "rme9652", &entry)) | ||
1743 | snd_info_set_text_ops(entry, rme9652, snd_rme9652_proc_read); | ||
1744 | } | 1742 | } |
1745 | 1743 | ||
1746 | static void snd_rme9652_free_buffers(struct snd_rme9652 *rme9652) | 1744 | static void snd_rme9652_free_buffers(struct snd_rme9652 *rme9652) |
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index 964acf302479..6b27980d77a8 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c | |||
@@ -1214,7 +1214,6 @@ static int sis_suspend(struct device *dev) | |||
1214 | int i; | 1214 | int i; |
1215 | 1215 | ||
1216 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1216 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1217 | snd_pcm_suspend_all(sis->pcm); | ||
1218 | if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT) | 1217 | if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT) |
1219 | snd_ac97_suspend(sis->ac97[0]); | 1218 | snd_ac97_suspend(sis->ac97[0]); |
1220 | if (sis->codecs_present & SIS_SECONDARY_CODEC_PRESENT) | 1219 | if (sis->codecs_present & SIS_SECONDARY_CODEC_PRESENT) |
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index 7218f38b59db..71d5ad3cffd6 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c | |||
@@ -1171,10 +1171,8 @@ static void snd_sonicvibes_proc_read(struct snd_info_entry *entry, | |||
1171 | 1171 | ||
1172 | static void snd_sonicvibes_proc_init(struct sonicvibes *sonic) | 1172 | static void snd_sonicvibes_proc_init(struct sonicvibes *sonic) |
1173 | { | 1173 | { |
1174 | struct snd_info_entry *entry; | 1174 | snd_card_ro_proc_new(sonic->card, "sonicvibes", sonic, |
1175 | 1175 | snd_sonicvibes_proc_read); | |
1176 | if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry)) | ||
1177 | snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read); | ||
1178 | } | 1176 | } |
1179 | 1177 | ||
1180 | /* | 1178 | /* |
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 5523e193d556..0ff32d3f5d3b 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -3320,13 +3320,11 @@ static void snd_trident_proc_read(struct snd_info_entry *entry, | |||
3320 | 3320 | ||
3321 | static void snd_trident_proc_init(struct snd_trident *trident) | 3321 | static void snd_trident_proc_init(struct snd_trident *trident) |
3322 | { | 3322 | { |
3323 | struct snd_info_entry *entry; | ||
3324 | const char *s = "trident"; | 3323 | const char *s = "trident"; |
3325 | 3324 | ||
3326 | if (trident->device == TRIDENT_DEVICE_ID_SI7018) | 3325 | if (trident->device == TRIDENT_DEVICE_ID_SI7018) |
3327 | s = "sis7018"; | 3326 | s = "sis7018"; |
3328 | if (! snd_card_proc_new(trident->card, s, &entry)) | 3327 | snd_card_ro_proc_new(trident->card, s, trident, snd_trident_proc_read); |
3329 | snd_info_set_text_ops(entry, trident, snd_trident_proc_read); | ||
3330 | } | 3328 | } |
3331 | 3329 | ||
3332 | static int snd_trident_dev_free(struct snd_device *device) | 3330 | static int snd_trident_dev_free(struct snd_device *device) |
@@ -3915,10 +3913,6 @@ static int snd_trident_suspend(struct device *dev) | |||
3915 | 3913 | ||
3916 | trident->in_suspend = 1; | 3914 | trident->in_suspend = 1; |
3917 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 3915 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
3918 | snd_pcm_suspend_all(trident->pcm); | ||
3919 | snd_pcm_suspend_all(trident->foldback); | ||
3920 | snd_pcm_suspend_all(trident->spdif); | ||
3921 | |||
3922 | snd_ac97_suspend(trident->ac97); | 3916 | snd_ac97_suspend(trident->ac97); |
3923 | snd_ac97_suspend(trident->ac97_sec); | 3917 | snd_ac97_suspend(trident->ac97_sec); |
3924 | return 0; | 3918 | return 0; |
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index c488c5afa195..dee1c487d6ba 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -2144,10 +2144,8 @@ static void snd_via82xx_proc_read(struct snd_info_entry *entry, | |||
2144 | 2144 | ||
2145 | static void snd_via82xx_proc_init(struct via82xx *chip) | 2145 | static void snd_via82xx_proc_init(struct via82xx *chip) |
2146 | { | 2146 | { |
2147 | struct snd_info_entry *entry; | 2147 | snd_card_ro_proc_new(chip->card, "via82xx", chip, |
2148 | 2148 | snd_via82xx_proc_read); | |
2149 | if (! snd_card_proc_new(chip->card, "via82xx", &entry)) | ||
2150 | snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read); | ||
2151 | } | 2149 | } |
2152 | 2150 | ||
2153 | /* | 2151 | /* |
@@ -2278,8 +2276,6 @@ static int snd_via82xx_suspend(struct device *dev) | |||
2278 | int i; | 2276 | int i; |
2279 | 2277 | ||
2280 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2278 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2281 | for (i = 0; i < 2; i++) | ||
2282 | snd_pcm_suspend_all(chip->pcms[i]); | ||
2283 | for (i = 0; i < chip->num_devs; i++) | 2279 | for (i = 0; i < chip->num_devs; i++) |
2284 | snd_via82xx_channel_reset(chip, &chip->devs[i]); | 2280 | snd_via82xx_channel_reset(chip, &chip->devs[i]); |
2285 | synchronize_irq(chip->irq); | 2281 | synchronize_irq(chip->irq); |
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index b13c8688cc8d..7e0bebce7b77 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -865,11 +865,9 @@ static int snd_via686_pcm_new(struct via82xx_modem *chip) | |||
865 | init_viadev(chip, 0, VIA_REG_MO_STATUS, 0); | 865 | init_viadev(chip, 0, VIA_REG_MO_STATUS, 0); |
866 | init_viadev(chip, 1, VIA_REG_MI_STATUS, 1); | 866 | init_viadev(chip, 1, VIA_REG_MI_STATUS, 1); |
867 | 867 | ||
868 | if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, | 868 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
869 | snd_dma_pci_data(chip->pci), | 869 | snd_dma_pci_data(chip->pci), |
870 | 64*1024, 128*1024)) < 0) | 870 | 64*1024, 128*1024); |
871 | return err; | ||
872 | |||
873 | return 0; | 871 | return 0; |
874 | } | 872 | } |
875 | 873 | ||
@@ -937,10 +935,8 @@ static void snd_via82xx_proc_read(struct snd_info_entry *entry, struct snd_info_ | |||
937 | 935 | ||
938 | static void snd_via82xx_proc_init(struct via82xx_modem *chip) | 936 | static void snd_via82xx_proc_init(struct via82xx_modem *chip) |
939 | { | 937 | { |
940 | struct snd_info_entry *entry; | 938 | snd_card_ro_proc_new(chip->card, "via82xx", chip, |
941 | 939 | snd_via82xx_proc_read); | |
942 | if (! snd_card_proc_new(chip->card, "via82xx", &entry)) | ||
943 | snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read); | ||
944 | } | 940 | } |
945 | 941 | ||
946 | /* | 942 | /* |
@@ -1038,8 +1034,6 @@ static int snd_via82xx_suspend(struct device *dev) | |||
1038 | int i; | 1034 | int i; |
1039 | 1035 | ||
1040 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1036 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
1041 | for (i = 0; i < 2; i++) | ||
1042 | snd_pcm_suspend_all(chip->pcms[i]); | ||
1043 | for (i = 0; i < chip->num_devs; i++) | 1037 | for (i = 0; i < chip->num_devs; i++) |
1044 | snd_via82xx_channel_reset(chip, &chip->devs[i]); | 1038 | snd_via82xx_channel_reset(chip, &chip->devs[i]); |
1045 | synchronize_irq(chip->irq); | 1039 | synchronize_irq(chip->irq); |
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index a4926fb03991..4d48877f211f 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -1985,11 +1985,7 @@ static void snd_ymfpci_proc_read(struct snd_info_entry *entry, | |||
1985 | 1985 | ||
1986 | static int snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip) | 1986 | static int snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip) |
1987 | { | 1987 | { |
1988 | struct snd_info_entry *entry; | 1988 | return snd_card_ro_proc_new(card, "ymfpci", chip, snd_ymfpci_proc_read); |
1989 | |||
1990 | if (! snd_card_proc_new(card, "ymfpci", &entry)) | ||
1991 | snd_info_set_text_ops(entry, chip, snd_ymfpci_proc_read); | ||
1992 | return 0; | ||
1993 | } | 1989 | } |
1994 | 1990 | ||
1995 | /* | 1991 | /* |
@@ -2304,10 +2300,6 @@ static int snd_ymfpci_suspend(struct device *dev) | |||
2304 | unsigned int i; | 2300 | unsigned int i; |
2305 | 2301 | ||
2306 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2302 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2307 | snd_pcm_suspend_all(chip->pcm); | ||
2308 | snd_pcm_suspend_all(chip->pcm2); | ||
2309 | snd_pcm_suspend_all(chip->pcm_spdif); | ||
2310 | snd_pcm_suspend_all(chip->pcm_4ch); | ||
2311 | snd_ac97_suspend(chip->ac97); | 2303 | snd_ac97_suspend(chip->ac97); |
2312 | for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) | 2304 | for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) |
2313 | chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]); | 2305 | chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]); |