aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/emu10k1/emu10k1.c6
-rw-r--r--sound/pci/emu10k1/emu10k1_callback.c4
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c73
-rw-r--r--sound/pci/emu10k1/emu10k1_patch.c6
-rw-r--r--sound/pci/emu10k1/emufx.c12
-rw-r--r--sound/pci/emu10k1/emumixer.c6
-rw-r--r--sound/pci/emu10k1/emumpu401.c7
-rw-r--r--sound/pci/emu10k1/emupcm.c22
-rw-r--r--sound/pci/emu10k1/io.c10
-rw-r--r--sound/pci/emu10k1/irq.c21
-rw-r--r--sound/pci/emu10k1/memory.c12
-rw-r--r--sound/pci/emu10k1/p16v.c45
-rw-r--r--sound/pci/emu10k1/voice.c6
13 files changed, 137 insertions, 93 deletions
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 5c0413b40dc3..ad9d9f8b48ed 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -170,7 +170,8 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
170 if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, 170 if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH,
171 sizeof(struct snd_emu10k1_synth_arg), &wave) < 0 || 171 sizeof(struct snd_emu10k1_synth_arg), &wave) < 0 ||
172 wave == NULL) { 172 wave == NULL) {
173 snd_printk(KERN_WARNING "can't initialize Emu10k1 wavetable synth\n"); 173 dev_warn(emu->card->dev,
174 "can't initialize Emu10k1 wavetable synth\n");
174 } else { 175 } else {
175 struct snd_emu10k1_synth_arg *arg; 176 struct snd_emu10k1_synth_arg *arg;
176 arg = SNDRV_SEQ_DEVICE_ARGPTR(wave); 177 arg = SNDRV_SEQ_DEVICE_ARGPTR(wave);
@@ -247,8 +248,7 @@ static int snd_emu10k1_resume(struct device *dev)
247 pci_set_power_state(pci, PCI_D0); 248 pci_set_power_state(pci, PCI_D0);
248 pci_restore_state(pci); 249 pci_restore_state(pci);
249 if (pci_enable_device(pci) < 0) { 250 if (pci_enable_device(pci) < 0) {
250 printk(KERN_ERR "emu10k1: pci_enable_device failed, " 251 dev_err(dev, "pci_enable_device failed, disabling device\n");
251 "disabling device\n");
252 snd_card_disconnect(card); 252 snd_card_disconnect(card);
253 return -EIO; 253 return -EIO;
254 } 254 }
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index cae36597aa71..3f3ef38d9b6e 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -105,7 +105,7 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
105 vp = &emu->voices[best[i].voice]; 105 vp = &emu->voices[best[i].voice];
106 if ((ch = vp->ch) < 0) { 106 if ((ch = vp->ch) < 0) {
107 /* 107 /*
108 printk(KERN_WARNING 108 dev_warn(emu->card->dev,
109 "synth_get_voice: ch < 0 (%d) ??", i); 109 "synth_get_voice: ch < 0 (%d) ??", i);
110 */ 110 */
111 continue; 111 continue;
@@ -339,7 +339,7 @@ start_voice(struct snd_emux_voice *vp)
339 return -EINVAL; 339 return -EINVAL;
340 emem->map_locked++; 340 emem->map_locked++;
341 if (snd_emu10k1_memblk_map(hw, emem) < 0) { 341 if (snd_emu10k1_memblk_map(hw, emem) < 0) {
342 /* printk(KERN_ERR "emu: cannot map!\n"); */ 342 /* dev_err(hw->card->devK, "emu: cannot map!\n"); */
343 return -ENOMEM; 343 return -ENOMEM;
344 } 344 }
345 mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1; 345 mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 75504da63613..229269788023 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -217,7 +217,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
217 } 217 }
218 if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */ 218 if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */
219 /* Hacks for Alice3 to work independent of haP16V driver */ 219 /* Hacks for Alice3 to work independent of haP16V driver */
220 snd_printk(KERN_INFO "Audigy2 value: Special config.\n"); 220 dev_info(emu->card->dev, "Audigy2 value: Special config.\n");
221 /* Setup SRCMulti_I2S SamplingRate */ 221 /* Setup SRCMulti_I2S SamplingRate */
222 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0); 222 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
223 tmp &= 0xfffff1ff; 223 tmp &= 0xfffff1ff;
@@ -723,7 +723,8 @@ static int emu1010_firmware_thread(void *data)
723 if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) { 723 if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) {
724 /* Audio Dock attached */ 724 /* Audio Dock attached */
725 /* Return to Audio Dock programming mode */ 725 /* Return to Audio Dock programming mode */
726 snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); 726 dev_info(emu->card->dev,
727 "emu1010: Loading Audio Dock Firmware\n");
727 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK); 728 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK);
728 729
729 if (!emu->dock_fw) { 730 if (!emu->dock_fw) {
@@ -756,19 +757,25 @@ static int emu1010_firmware_thread(void *data)
756 757
757 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0); 758 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0);
758 snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg); 759 snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg);
759 snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS = 0x%x\n", reg); 760 dev_info(emu->card->dev,
761 "emu1010: EMU_HANA+DOCK_IRQ_STATUS = 0x%x\n",
762 reg);
760 /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ 763 /* ID, should read & 0x7f = 0x55 when FPGA programmed. */
761 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg); 764 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
762 snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID = 0x%x\n", reg); 765 dev_info(emu->card->dev,
766 "emu1010: EMU_HANA+DOCK_ID = 0x%x\n", reg);
763 if ((reg & 0x1f) != 0x15) { 767 if ((reg & 0x1f) != 0x15) {
764 /* FPGA failed to be programmed */ 768 /* FPGA failed to be programmed */
765 snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg = 0x%x\n", reg); 769 dev_info(emu->card->dev,
770 "emu1010: Loading Audio Dock Firmware file failed, reg = 0x%x\n",
771 reg);
766 continue; 772 continue;
767 } 773 }
768 snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n"); 774 dev_info(emu->card->dev,
775 "emu1010: Audio Dock Firmware loaded\n");
769 snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp); 776 snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp);
770 snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2); 777 snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2);
771 snd_printk(KERN_INFO "Audio Dock ver: %u.%u\n", 778 dev_info(emu->card->dev, "Audio Dock ver: %u.%u\n",
772 tmp, tmp2); 779 tmp, tmp2);
773 /* Sync clocking between 1010 and Dock */ 780 /* Sync clocking between 1010 and Dock */
774 /* Allow DLL to settle */ 781 /* Allow DLL to settle */
@@ -777,7 +784,7 @@ static int emu1010_firmware_thread(void *data)
777 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE); 784 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
778 } 785 }
779 } 786 }
780 snd_printk(KERN_INFO "emu1010: firmware thread stopping\n"); 787 dev_info(emu->card->dev, "emu1010: firmware thread stopping\n");
781 return 0; 788 return 0;
782} 789}
783 790
@@ -818,7 +825,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
818 u32 tmp, tmp2, reg; 825 u32 tmp, tmp2, reg;
819 int err; 826 int err;
820 827
821 snd_printk(KERN_INFO "emu1010: Special config.\n"); 828 dev_info(emu->card->dev, "emu1010: Special config.\n");
822 /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave, 829 /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
823 * Lock Sound Memory Cache, Lock Tank Memory Cache, 830 * Lock Sound Memory Cache, Lock Tank Memory Cache,
824 * Mute all codecs. 831 * Mute all codecs.
@@ -843,7 +850,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
843 850
844 /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */ 851 /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
845 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg); 852 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
846 snd_printdd("reg1 = 0x%x\n", reg); 853 dev_dbg(emu->card->dev, "reg1 = 0x%x\n", reg);
847 if ((reg & 0x3f) == 0x15) { 854 if ((reg & 0x3f) == 0x15) {
848 /* FPGA netlist already present so clear it */ 855 /* FPGA netlist already present so clear it */
849 /* Return to programming mode */ 856 /* Return to programming mode */
@@ -851,13 +858,14 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
851 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02); 858 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02);
852 } 859 }
853 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg); 860 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
854 snd_printdd("reg2 = 0x%x\n", reg); 861 dev_dbg(emu->card->dev, "reg2 = 0x%x\n", reg);
855 if ((reg & 0x3f) == 0x15) { 862 if ((reg & 0x3f) == 0x15) {
856 /* FPGA failed to return to programming mode */ 863 /* FPGA failed to return to programming mode */
857 snd_printk(KERN_INFO "emu1010: FPGA failed to return to programming mode\n"); 864 dev_info(emu->card->dev,
865 "emu1010: FPGA failed to return to programming mode\n");
858 return -ENODEV; 866 return -ENODEV;
859 } 867 }
860 snd_printk(KERN_INFO "emu1010: EMU_HANA_ID = 0x%x\n", reg); 868 dev_info(emu->card->dev, "emu1010: EMU_HANA_ID = 0x%x\n", reg);
861 869
862 if (!emu->firmware) { 870 if (!emu->firmware) {
863 const char *filename; 871 const char *filename;
@@ -880,16 +888,19 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
880 888
881 err = request_firmware(&emu->firmware, filename, &emu->pci->dev); 889 err = request_firmware(&emu->firmware, filename, &emu->pci->dev);
882 if (err != 0) { 890 if (err != 0) {
883 snd_printk(KERN_ERR "emu1010: firmware: %s not found. Err = %d\n", filename, err); 891 dev_info(emu->card->dev,
892 "emu1010: firmware: %s not found. Err = %d\n",
893 filename, err);
884 return err; 894 return err;
885 } 895 }
886 snd_printk(KERN_INFO "emu1010: firmware file = %s, size = 0x%zx\n", 896 dev_info(emu->card->dev,
897 "emu1010: firmware file = %s, size = 0x%zx\n",
887 filename, emu->firmware->size); 898 filename, emu->firmware->size);
888 } 899 }
889 900
890 err = snd_emu1010_load_firmware(emu, emu->firmware); 901 err = snd_emu1010_load_firmware(emu, emu->firmware);
891 if (err != 0) { 902 if (err != 0) {
892 snd_printk(KERN_INFO "emu1010: Loading Firmware failed\n"); 903 dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n");
893 return err; 904 return err;
894 } 905 }
895 906
@@ -897,21 +908,23 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
897 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg); 908 snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
898 if ((reg & 0x3f) != 0x15) { 909 if ((reg & 0x3f) != 0x15) {
899 /* FPGA failed to be programmed */ 910 /* FPGA failed to be programmed */
900 snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg = 0x%x\n", reg); 911 dev_info(emu->card->dev,
912 "emu1010: Loading Hana Firmware file failed, reg = 0x%x\n",
913 reg);
901 return -ENODEV; 914 return -ENODEV;
902 } 915 }
903 916
904 snd_printk(KERN_INFO "emu1010: Hana Firmware loaded\n"); 917 dev_info(emu->card->dev, "emu1010: Hana Firmware loaded\n");
905 snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp); 918 snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp);
906 snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2); 919 snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2);
907 snd_printk(KERN_INFO "emu1010: Hana version: %u.%u\n", tmp, tmp2); 920 dev_info(emu->card->dev, "emu1010: Hana version: %u.%u\n", tmp, tmp2);
908 /* Enable 48Volt power to Audio Dock */ 921 /* Enable 48Volt power to Audio Dock */
909 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON); 922 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON);
910 923
911 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg); 924 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg);
912 snd_printk(KERN_INFO "emu1010: Card options = 0x%x\n", reg); 925 dev_info(emu->card->dev, "emu1010: Card options = 0x%x\n", reg);
913 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg); 926 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg);
914 snd_printk(KERN_INFO "emu1010: Card options = 0x%x\n", reg); 927 dev_info(emu->card->dev, "emu1010: Card options = 0x%x\n", reg);
915 snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp); 928 snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp);
916 /* Optical -> ADAT I/O */ 929 /* Optical -> ADAT I/O */
917 /* 0 : SPDIF 930 /* 0 : SPDIF
@@ -950,7 +963,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
950 snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00); 963 snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00);
951 964
952 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg); 965 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg);
953 snd_printk(KERN_INFO "emu1010: Card options3 = 0x%x\n", reg); 966 dev_info(emu->card->dev, "emu1010: Card options3 = 0x%x\n", reg);
954 /* Default WCLK set to 48kHz. */ 967 /* Default WCLK set to 48kHz. */
955 snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00); 968 snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00);
956 /* Word Clock source, Internal 48kHz x1 */ 969 /* Word Clock source, Internal 48kHz x1 */
@@ -1808,7 +1821,9 @@ int snd_emu10k1_create(struct snd_card *card,
1808 emu->revision = pci->revision; 1821 emu->revision = pci->revision;
1809 pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial); 1822 pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial);
1810 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model); 1823 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model);
1811 snd_printdd("vendor = 0x%x, device = 0x%x, subsystem_vendor_id = 0x%x, subsystem_id = 0x%x\n", pci->vendor, pci->device, emu->serial, emu->model); 1824 dev_dbg(card->dev,
1825 "vendor = 0x%x, device = 0x%x, subsystem_vendor_id = 0x%x, subsystem_id = 0x%x\n",
1826 pci->vendor, pci->device, emu->serial, emu->model);
1812 1827
1813 for (c = emu_chip_details; c->vendor; c++) { 1828 for (c = emu_chip_details; c->vendor; c++) {
1814 if (c->vendor == pci->vendor && c->device == pci->device) { 1829 if (c->vendor == pci->vendor && c->device == pci->device) {
@@ -1827,21 +1842,21 @@ int snd_emu10k1_create(struct snd_card *card,
1827 } 1842 }
1828 } 1843 }
1829 if (c->vendor == 0) { 1844 if (c->vendor == 0) {
1830 snd_printk(KERN_ERR "emu10k1: Card not recognised\n"); 1845 dev_err(card->dev, "emu10k1: Card not recognised\n");
1831 kfree(emu); 1846 kfree(emu);
1832 pci_disable_device(pci); 1847 pci_disable_device(pci);
1833 return -ENOENT; 1848 return -ENOENT;
1834 } 1849 }
1835 emu->card_capabilities = c; 1850 emu->card_capabilities = c;
1836 if (c->subsystem && !subsystem) 1851 if (c->subsystem && !subsystem)
1837 snd_printdd("Sound card name = %s\n", c->name); 1852 dev_dbg(card->dev, "Sound card name = %s\n", c->name);
1838 else if (subsystem) 1853 else if (subsystem)
1839 snd_printdd("Sound card name = %s, " 1854 dev_dbg(card->dev, "Sound card name = %s, "
1840 "vendor = 0x%x, device = 0x%x, subsystem = 0x%x. " 1855 "vendor = 0x%x, device = 0x%x, subsystem = 0x%x. "
1841 "Forced to subsystem = 0x%x\n", c->name, 1856 "Forced to subsystem = 0x%x\n", c->name,
1842 pci->vendor, pci->device, emu->serial, c->subsystem); 1857 pci->vendor, pci->device, emu->serial, c->subsystem);
1843 else 1858 else
1844 snd_printdd("Sound card name = %s, " 1859 dev_dbg(card->dev, "Sound card name = %s, "
1845 "vendor = 0x%x, device = 0x%x, subsystem = 0x%x.\n", 1860 "vendor = 0x%x, device = 0x%x, subsystem = 0x%x.\n",
1846 c->name, pci->vendor, pci->device, 1861 c->name, pci->vendor, pci->device,
1847 emu->serial); 1862 emu->serial);
@@ -1869,7 +1884,9 @@ int snd_emu10k1_create(struct snd_card *card,
1869 emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK; 1884 emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK;
1870 if (pci_set_dma_mask(pci, emu->dma_mask) < 0 || 1885 if (pci_set_dma_mask(pci, emu->dma_mask) < 0 ||
1871 pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) { 1886 pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) {
1872 snd_printk(KERN_ERR "architecture does not support PCI busmaster DMA with mask 0x%lx\n", emu->dma_mask); 1887 dev_err(card->dev,
1888 "architecture does not support PCI busmaster DMA with mask 0x%lx\n",
1889 emu->dma_mask);
1873 kfree(emu); 1890 kfree(emu);
1874 pci_disable_device(pci); 1891 pci_disable_device(pci);
1875 return -ENXIO; 1892 return -ENXIO;
diff --git a/sound/pci/emu10k1/emu10k1_patch.c b/sound/pci/emu10k1/emu10k1_patch.c
index 662a45876a8b..0e069aeab86d 100644
--- a/sound/pci/emu10k1/emu10k1_patch.c
+++ b/sound/pci/emu10k1/emu10k1_patch.c
@@ -50,7 +50,8 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
50 return -EINVAL; 50 return -EINVAL;
51 51
52 if (sp->v.size == 0) { 52 if (sp->v.size == 0) {
53 snd_printd("emu: rom font for sample %d\n", sp->v.sample); 53 dev_dbg(emu->card->dev,
54 "emu: rom font for sample %d\n", sp->v.sample);
54 return 0; 55 return 0;
55 } 56 }
56 57
@@ -92,7 +93,8 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
92 blocksize *= 2; 93 blocksize *= 2;
93 sp->block = snd_emu10k1_synth_alloc(emu, blocksize); 94 sp->block = snd_emu10k1_synth_alloc(emu, blocksize);
94 if (sp->block == NULL) { 95 if (sp->block == NULL) {
95 snd_printd("emu10k1: synth malloc failed (size=%d)\n", blocksize); 96 dev_dbg(emu->card->dev,
97 "synth malloc failed (size=%d)\n", blocksize);
96 /* not ENOMEM (for compatibility with OSS) */ 98 /* not ENOMEM (for compatibility with OSS) */
97 return -ENOSPC; 99 return -ENOSPC;
98 } 100 }
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 1f9c7c4bbcd8..745f0627c634 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -1547,7 +1547,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1547 /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */ 1547 /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */
1548 if (emu->card_capabilities->emu_model) { 1548 if (emu->card_capabilities->emu_model) {
1549 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ 1549 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */
1550 snd_printk(KERN_INFO "EMU outputs on\n"); 1550 dev_info(emu->card->dev, "EMU outputs on\n");
1551 for (z = 0; z < 8; z++) { 1551 for (z = 0; z < 8; z++) {
1552 if (emu->card_capabilities->ca0108_chip) { 1552 if (emu->card_capabilities->ca0108_chip) {
1553 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000); 1553 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
@@ -1571,7 +1571,9 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1571 A_SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS + z, tmp + 1); 1571 A_SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS + z, tmp + 1);
1572 if ((z==1) && (emu->card_capabilities->spdif_bug)) { 1572 if ((z==1) && (emu->card_capabilities->spdif_bug)) {
1573 /* Due to a SPDIF output bug on some Audigy cards, this code delays the Right channel by 1 sample */ 1573 /* Due to a SPDIF output bug on some Audigy cards, this code delays the Right channel by 1 sample */
1574 snd_printk(KERN_INFO "Installing spdif_bug patch: %s\n", emu->card_capabilities->name); 1574 dev_info(emu->card->dev,
1575 "Installing spdif_bug patch: %s\n",
1576 emu->card_capabilities->name);
1575 A_OP(icode, &ptr, iACC3, A_EXTOUT(A_EXTOUT_FRONT_L + z), A_GPR(gpr - 3), A_C_00000000, A_C_00000000); 1577 A_OP(icode, &ptr, iACC3, A_EXTOUT(A_EXTOUT_FRONT_L + z), A_GPR(gpr - 3), A_C_00000000, A_C_00000000);
1576 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 3), A_GPR(tmp + 0), A_GPR(tmp + 1), A_C_00000000); 1578 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 3), A_GPR(tmp + 0), A_GPR(tmp + 1), A_C_00000000);
1577 } else { 1579 } else {
@@ -1595,7 +1597,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1595 1597
1596 if (emu->card_capabilities->emu_model) { 1598 if (emu->card_capabilities->emu_model) {
1597 if (emu->card_capabilities->ca0108_chip) { 1599 if (emu->card_capabilities->ca0108_chip) {
1598 snd_printk(KERN_INFO "EMU2 inputs on\n"); 1600 dev_info(emu->card->dev, "EMU2 inputs on\n");
1599 for (z = 0; z < 0x10; z++) { 1601 for (z = 0; z < 0x10; z++) {
1600 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, 1602 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
1601 bit_shifter16, 1603 bit_shifter16,
@@ -1603,11 +1605,11 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1603 A_FXBUS2(z*2) ); 1605 A_FXBUS2(z*2) );
1604 } 1606 }
1605 } else { 1607 } else {
1606 snd_printk(KERN_INFO "EMU inputs on\n"); 1608 dev_info(emu->card->dev, "EMU inputs on\n");
1607 /* Capture 16 (originally 8) channels of S32_LE sound */ 1609 /* Capture 16 (originally 8) channels of S32_LE sound */
1608 1610
1609 /* 1611 /*
1610 printk(KERN_DEBUG "emufx.c: gpr=0x%x, tmp=0x%x\n", 1612 dev_dbg(emu->card->dev, "emufx.c: gpr=0x%x, tmp=0x%x\n",
1611 gpr, tmp); 1613 gpr, tmp);
1612 */ 1614 */
1613 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */ 1615 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index f6c3da0d377d..c5ae2a24d8a5 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -1853,8 +1853,10 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
1853 if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) { 1853 if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) {
1854 if (emu->card_capabilities->ac97_chip == 1) 1854 if (emu->card_capabilities->ac97_chip == 1)
1855 return err; 1855 return err;
1856 snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n"); 1856 dev_info(emu->card->dev,
1857 snd_printd(KERN_INFO" Proceeding without ac97 mixers...\n"); 1857 "AC97 is optional on this board\n");
1858 dev_info(emu->card->dev,
1859 "Proceeding without ac97 mixers...\n");
1858 snd_device_free(emu->card, pbus); 1860 snd_device_free(emu->card, pbus);
1859 goto no_ac97; /* FIXME: get rid of ugly gotos.. */ 1861 goto no_ac97; /* FIXME: get rid of ugly gotos.. */
1860 } 1862 }
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index 1ec91246dfee..fdf2b0ada489 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -64,7 +64,9 @@ static void mpu401_clear_rx(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *mp
64 mpu401_read_data(emu, mpu); 64 mpu401_read_data(emu, mpu);
65#ifdef CONFIG_SND_DEBUG 65#ifdef CONFIG_SND_DEBUG
66 if (timeout <= 0) 66 if (timeout <= 0)
67 snd_printk(KERN_ERR "cmd: clear rx timeout (status = 0x%x)\n", mpu401_read_stat(emu, mpu)); 67 dev_err(emu->card->dev,
68 "cmd: clear rx timeout (status = 0x%x)\n",
69 mpu401_read_stat(emu, mpu));
68#endif 70#endif
69} 71}
70 72
@@ -141,7 +143,8 @@ static int snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_mid
141 } 143 }
142 spin_unlock_irqrestore(&midi->input_lock, flags); 144 spin_unlock_irqrestore(&midi->input_lock, flags);
143 if (!ok) { 145 if (!ok) {
144 snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n", 146 dev_err(emu->card->dev,
147 "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n",
145 cmd, emu->port, 148 cmd, emu->port,
146 mpu401_read_stat(emu, midi), 149 mpu401_read_stat(emu, midi),
147 mpu401_read_data(emu, midi)); 150 mpu401_read_data(emu, midi));
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index 5ae1d045bdcb..f82481bd2542 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -44,7 +44,8 @@ static void snd_emu10k1_pcm_interrupt(struct snd_emu10k1 *emu,
44 if (epcm->substream == NULL) 44 if (epcm->substream == NULL)
45 return; 45 return;
46#if 0 46#if 0
47 printk(KERN_DEBUG "IRQ: position = 0x%x, period = 0x%x, size = 0x%x\n", 47 dev_dbg(emu->card->dev,
48 "IRQ: position = 0x%x, period = 0x%x, size = 0x%x\n",
48 epcm->substream->runtime->hw->pointer(emu, epcm->substream), 49 epcm->substream->runtime->hw->pointer(emu, epcm->substream),
49 snd_pcm_lib_period_bytes(epcm->substream), 50 snd_pcm_lib_period_bytes(epcm->substream),
50 snd_pcm_lib_buffer_bytes(epcm->substream)); 51 snd_pcm_lib_buffer_bytes(epcm->substream));
@@ -147,7 +148,7 @@ static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voic
147 &epcm->extra); 148 &epcm->extra);
148 if (err < 0) { 149 if (err < 0) {
149 /* 150 /*
150 printk(KERN_DEBUG "pcm_channel_alloc: " 151 dev_dbg(emu->card->dev, "pcm_channel_alloc: "
151 "failed extra: voices=%d, frame=%d\n", 152 "failed extra: voices=%d, frame=%d\n",
152 voices, frame); 153 voices, frame);
153 */ 154 */
@@ -761,7 +762,8 @@ static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
761 int result = 0; 762 int result = 0;
762 763
763 /* 764 /*
764 printk(KERN_DEBUG "trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", 765 dev_dbg(emu->card->dev,
766 "trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n",
765 (int)emu, cmd, substream->ops->pointer(substream)) 767 (int)emu, cmd, substream->ops->pointer(substream))
766 */ 768 */
767 spin_lock(&emu->reg_lock); 769 spin_lock(&emu->reg_lock);
@@ -815,7 +817,7 @@ static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
815 outl(epcm->capture_ipr, emu->port + IPR); 817 outl(epcm->capture_ipr, emu->port + IPR);
816 snd_emu10k1_intr_enable(emu, epcm->capture_inte); 818 snd_emu10k1_intr_enable(emu, epcm->capture_inte);
817 /* 819 /*
818 printk(KERN_DEBUG "adccr = 0x%x, adcbs = 0x%x\n", 820 dev_dbg(emu->card->dev, "adccr = 0x%x, adcbs = 0x%x\n",
819 epcm->adccr, epcm->adcbs); 821 epcm->adccr, epcm->adcbs);
820 */ 822 */
821 switch (epcm->type) { 823 switch (epcm->type) {
@@ -826,7 +828,10 @@ static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
826 if (emu->audigy) { 828 if (emu->audigy) {
827 snd_emu10k1_ptr_write(emu, A_FXWC1, 0, epcm->capture_cr_val); 829 snd_emu10k1_ptr_write(emu, A_FXWC1, 0, epcm->capture_cr_val);
828 snd_emu10k1_ptr_write(emu, A_FXWC2, 0, epcm->capture_cr_val2); 830 snd_emu10k1_ptr_write(emu, A_FXWC2, 0, epcm->capture_cr_val2);
829 snd_printdd("cr_val=0x%x, cr_val2=0x%x\n", epcm->capture_cr_val, epcm->capture_cr_val2); 831 dev_dbg(emu->card->dev,
832 "cr_val=0x%x, cr_val2=0x%x\n",
833 epcm->capture_cr_val,
834 epcm->capture_cr_val2);
830 } else 835 } else
831 snd_emu10k1_ptr_write(emu, FXWC, 0, epcm->capture_cr_val); 836 snd_emu10k1_ptr_write(emu, FXWC, 0, epcm->capture_cr_val);
832 break; 837 break;
@@ -889,7 +894,7 @@ static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *
889 } 894 }
890#endif 895#endif
891 /* 896 /*
892 printk(KERN_DEBUG 897 dev_dbg(emu->card->dev,
893 "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n", 898 "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n",
894 (long)ptr, (long)runtime->buffer_size, 899 (long)ptr, (long)runtime->buffer_size,
895 (long)runtime->period_size); 900 (long)runtime->period_size);
@@ -1594,7 +1599,8 @@ static void snd_emu10k1_fx8010_playback_tram_poke1(unsigned short *dst_left,
1594 unsigned int tram_shift) 1599 unsigned int tram_shift)
1595{ 1600{
1596 /* 1601 /*
1597 printk(KERN_DEBUG "tram_poke1: dst_left = 0x%p, dst_right = 0x%p, " 1602 dev_dbg(emu->card->dev,
1603 "tram_poke1: dst_left = 0x%p, dst_right = 0x%p, "
1598 "src = 0x%p, count = 0x%x\n", 1604 "src = 0x%p, count = 0x%x\n",
1599 dst_left, dst_right, src, count); 1605 dst_left, dst_right, src, count);
1600 */ 1606 */
@@ -1675,7 +1681,7 @@ static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substre
1675 unsigned int i; 1681 unsigned int i;
1676 1682
1677 /* 1683 /*
1678 printk(KERN_DEBUG "prepare: etram_pages = 0x%p, dma_area = 0x%x, " 1684 dev_dbg(emu->card->dev, "prepare: etram_pages = 0x%p, dma_area = 0x%x, "
1679 "buffer_size = 0x%x (0x%x)\n", 1685 "buffer_size = 0x%x (0x%x)\n",
1680 emu->fx8010.etram_pages, runtime->dma_area, 1686 emu->fx8010.etram_pages, runtime->dma_area,
1681 runtime->buffer_size, runtime->buffer_size << 2); 1687 runtime->buffer_size, runtime->buffer_size << 2);
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index e4fba49fee4a..81c75b4528d9 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -72,7 +72,7 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
72 unsigned int mask; 72 unsigned int mask;
73 73
74 if (!emu) { 74 if (!emu) {
75 snd_printk(KERN_ERR "ptr_write: emu is null!\n"); 75 dev_err(emu->card->dev, "ptr_write: emu is null!\n");
76 dump_stack(); 76 dump_stack();
77 return; 77 return;
78 } 78 }
@@ -199,7 +199,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
199 int err = 0; 199 int err = 0;
200 200
201 if ((reg > 0x7f) || (value > 0x1ff)) { 201 if ((reg > 0x7f) || (value > 0x1ff)) {
202 snd_printk(KERN_ERR "i2c_write: invalid values.\n"); 202 dev_err(emu->card->dev, "i2c_write: invalid values.\n");
203 return -EINVAL; 203 return -EINVAL;
204 } 204 }
205 205
@@ -227,7 +227,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
227 break; 227 break;
228 228
229 if (timeout > 1000) { 229 if (timeout > 1000) {
230 snd_printk(KERN_WARNING 230 dev_warn(emu->card->dev,
231 "emu10k1:I2C:timeout status=0x%x\n", 231 "emu10k1:I2C:timeout status=0x%x\n",
232 status); 232 status);
233 break; 233 break;
@@ -239,8 +239,8 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
239 } 239 }
240 240
241 if (retry == 10) { 241 if (retry == 10) {
242 snd_printk(KERN_ERR "Writing to ADC failed!\n"); 242 dev_err(emu->card->dev, "Writing to ADC failed!\n");
243 snd_printk(KERN_ERR "status=0x%x, reg=%d, value=%d\n", 243 dev_err(emu->card->dev, "status=0x%x, reg=%d, value=%d\n",
244 status, reg, value); 244 status, reg, value);
245 /* dump_stack(); */ 245 /* dump_stack(); */
246 err = -EINVAL; 246 err = -EINVAL;
diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
index 30bfed6f8339..3c5c5e3dc2d9 100644
--- a/sound/pci/emu10k1/irq.c
+++ b/sound/pci/emu10k1/irq.c
@@ -41,11 +41,12 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
41 orig_status = status; 41 orig_status = status;
42 handled = 1; 42 handled = 1;
43 if ((status & 0xffffffff) == 0xffffffff) { 43 if ((status & 0xffffffff) == 0xffffffff) {
44 snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n"); 44 dev_info(emu->card->dev,
45 "Suspected sound card removal\n");
45 break; 46 break;
46 } 47 }
47 if (status & IPR_PCIERROR) { 48 if (status & IPR_PCIERROR) {
48 snd_printk(KERN_ERR "interrupt: PCI error\n"); 49 dev_err(emu->card->dev, "interrupt: PCI error\n");
49 snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE); 50 snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE);
50 status &= ~IPR_PCIERROR; 51 status &= ~IPR_PCIERROR;
51 } 52 }
@@ -157,19 +158,22 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
157 struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]); 158 struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]);
158 struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice); 159 struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice);
159 160
160 //printk(KERN_INFO "status2=0x%x\n", status2); 161 /* dev_dbg(emu->card->dev, "status2=0x%x\n", status2); */
161 orig_status2 = status2; 162 orig_status2 = status2;
162 if(status2 & mask) { 163 if(status2 & mask) {
163 if(pvoice->use) { 164 if(pvoice->use) {
164 snd_pcm_period_elapsed(pvoice->epcm->substream); 165 snd_pcm_period_elapsed(pvoice->epcm->substream);
165 } else { 166 } else {
166 snd_printk(KERN_ERR "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n", status2, mask, pvoice, pvoice->use); 167 dev_err(emu->card->dev,
168 "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n",
169 status2, mask, pvoice,
170 pvoice->use);
167 } 171 }
168 } 172 }
169 if(status2 & 0x110000) { 173 if(status2 & 0x110000) {
170 //printk(KERN_INFO "capture int found\n"); 174 /* dev_info(emu->card->dev, "capture int found\n"); */
171 if(cvoice->use) { 175 if(cvoice->use) {
172 //printk(KERN_INFO "capture period_elapsed\n"); 176 /* dev_info(emu->card->dev, "capture period_elapsed\n"); */
173 snd_pcm_period_elapsed(cvoice->epcm->substream); 177 snd_pcm_period_elapsed(cvoice->epcm->substream);
174 } 178 }
175 } 179 }
@@ -180,7 +184,8 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
180 184
181 if (status) { 185 if (status) {
182 unsigned int bits; 186 unsigned int bits;
183 snd_printk(KERN_ERR "emu10k1: unhandled interrupt: 0x%08x\n", status); 187 dev_err(emu->card->dev,
188 "unhandled interrupt: 0x%08x\n", status);
184 //make sure any interrupts we don't handle are disabled: 189 //make sure any interrupts we don't handle are disabled:
185 bits = INTE_FXDSPENABLE | 190 bits = INTE_FXDSPENABLE |
186 INTE_PCIERRORENABLE | 191 INTE_PCIERRORENABLE |
@@ -202,7 +207,7 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
202 outl(orig_status, emu->port + IPR); /* ack all */ 207 outl(orig_status, emu->port + IPR); /* ack all */
203 } 208 }
204 if (timeout == 1000) 209 if (timeout == 1000)
205 snd_printk(KERN_INFO "emu10k1 irq routine failure\n"); 210 dev_info(emu->card->dev, "emu10k1 irq routine failure\n");
206 211
207 return IRQ_RETVAL(handled); 212 return IRQ_RETVAL(handled);
208} 213}
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index ae709c1ab3a8..c68e6dd2fa67 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -236,11 +236,13 @@ __found_pages:
236static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr) 236static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr)
237{ 237{
238 if (addr & ~emu->dma_mask) { 238 if (addr & ~emu->dma_mask) {
239 snd_printk(KERN_ERR "max memory size is 0x%lx (addr = 0x%lx)!!\n", emu->dma_mask, (unsigned long)addr); 239 dev_err(emu->card->dev,
240 "max memory size is 0x%lx (addr = 0x%lx)!!\n",
241 emu->dma_mask, (unsigned long)addr);
240 return 0; 242 return 0;
241 } 243 }
242 if (addr & (EMUPAGESIZE-1)) { 244 if (addr & (EMUPAGESIZE-1)) {
243 snd_printk(KERN_ERR "page is not aligned\n"); 245 dev_err(emu->card->dev, "page is not aligned\n");
244 return 0; 246 return 0;
245 } 247 }
246 return 1; 248 return 1;
@@ -331,7 +333,8 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
331 else 333 else
332 addr = snd_pcm_sgbuf_get_addr(substream, ofs); 334 addr = snd_pcm_sgbuf_get_addr(substream, ofs);
333 if (! is_valid_page(emu, addr)) { 335 if (! is_valid_page(emu, addr)) {
334 printk(KERN_ERR "emu: failure page = %d\n", idx); 336 dev_err(emu->card->dev,
337 "emu: failure page = %d\n", idx);
335 mutex_unlock(&hdr->block_mutex); 338 mutex_unlock(&hdr->block_mutex);
336 return NULL; 339 return NULL;
337 } 340 }
@@ -507,7 +510,8 @@ static inline void *offset_ptr(struct snd_emu10k1 *emu, int page, int offset)
507 return NULL; 510 return NULL;
508 ptr = emu->page_ptr_table[page]; 511 ptr = emu->page_ptr_table[page];
509 if (! ptr) { 512 if (! ptr) {
510 printk(KERN_ERR "emu10k1: access to NULL ptr: page = %d\n", page); 513 dev_err(emu->card->dev,
514 "access to NULL ptr: page = %d\n", page);
511 return NULL; 515 return NULL;
512 } 516 }
513 ptr += offset & (PAGE_SIZE - 1); 517 ptr += offset & (PAGE_SIZE - 1);
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index 7e2025cd6d9c..a4fe7f0c9458 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -168,7 +168,7 @@ static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime)
168 struct snd_emu10k1_pcm *epcm = runtime->private_data; 168 struct snd_emu10k1_pcm *epcm = runtime->private_data;
169 169
170 if (epcm) { 170 if (epcm) {
171 /* snd_printk(KERN_DEBUG "epcm free: %p\n", epcm); */ 171 /* dev_dbg(emu->card->dev, "epcm free: %p\n", epcm); */
172 kfree(epcm); 172 kfree(epcm);
173 } 173 }
174} 174}
@@ -183,14 +183,14 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
183 int err; 183 int err;
184 184
185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
186 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */ 186 /* dev_dbg(emu->card->dev, "epcm kcalloc: %p\n", epcm); */
187 187
188 if (epcm == NULL) 188 if (epcm == NULL)
189 return -ENOMEM; 189 return -ENOMEM;
190 epcm->emu = emu; 190 epcm->emu = emu;
191 epcm->substream = substream; 191 epcm->substream = substream;
192 /* 192 /*
193 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n", 193 dev_dbg(emu->card->dev, "epcm device=%d, channel_id=%d\n",
194 substream->pcm->device, channel_id); 194 substream->pcm->device, channel_id);
195 */ 195 */
196 runtime->private_data = epcm; 196 runtime->private_data = epcm;
@@ -203,10 +203,10 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
203 203
204 channel->use=1; 204 channel->use=1;
205#if 0 /* debug */ 205#if 0 /* debug */
206 snd_printk(KERN_DEBUG 206 dev_dbg(emu->card->dev,
207 "p16v: open channel_id=%d, channel=%p, use=0x%x\n", 207 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
208 channel_id, channel, channel->use); 208 channel_id, channel, channel->use);
209 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n", 209 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n",
210 channel_id, chip, channel); 210 channel_id, chip, channel);
211#endif /* debug */ 211#endif /* debug */
212 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ 212 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
@@ -231,14 +231,14 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
231 int err; 231 int err;
232 232
233 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 233 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
234 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */ 234 /* dev_dbg(emu->card->dev, "epcm kcalloc: %p\n", epcm); */
235 235
236 if (epcm == NULL) 236 if (epcm == NULL)
237 return -ENOMEM; 237 return -ENOMEM;
238 epcm->emu = emu; 238 epcm->emu = emu;
239 epcm->substream = substream; 239 epcm->substream = substream;
240 /* 240 /*
241 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n", 241 dev_dbg(emu->card->dev, "epcm device=%d, channel_id=%d\n",
242 substream->pcm->device, channel_id); 242 substream->pcm->device, channel_id);
243 */ 243 */
244 runtime->private_data = epcm; 244 runtime->private_data = epcm;
@@ -251,10 +251,10 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
251 251
252 channel->use=1; 252 channel->use=1;
253#if 0 /* debug */ 253#if 0 /* debug */
254 snd_printk(KERN_DEBUG 254 dev_dbg(emu->card->dev,
255 "p16v: open channel_id=%d, channel=%p, use=0x%x\n", 255 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
256 channel_id, channel, channel->use); 256 channel_id, channel, channel->use);
257 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n", 257 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n",
258 channel_id, chip, channel); 258 channel_id, chip, channel);
259#endif /* debug */ 259#endif /* debug */
260 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ 260 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
@@ -349,15 +349,18 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
349 u32 tmp; 349 u32 tmp;
350 350
351#if 0 /* debug */ 351#if 0 /* debug */
352 snd_printk(KERN_DEBUG "prepare:channel_number=%d, rate=%d, " 352 dev_dbg(emu->card->dev,
353 "prepare:channel_number=%d, rate=%d, "
353 "format=0x%x, channels=%d, buffer_size=%ld, " 354 "format=0x%x, channels=%d, buffer_size=%ld, "
354 "period_size=%ld, periods=%u, frames_to_bytes=%d\n", 355 "period_size=%ld, periods=%u, frames_to_bytes=%d\n",
355 channel, runtime->rate, runtime->format, runtime->channels, 356 channel, runtime->rate, runtime->format, runtime->channels,
356 runtime->buffer_size, runtime->period_size, 357 runtime->buffer_size, runtime->period_size,
357 runtime->periods, frames_to_bytes(runtime, 1)); 358 runtime->periods, frames_to_bytes(runtime, 1));
358 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n", 359 dev_dbg(emu->card->dev,
360 "dma_addr=%x, dma_area=%p, table_base=%p\n",
359 runtime->dma_addr, runtime->dma_area, table_base); 361 runtime->dma_addr, runtime->dma_area, table_base);
360 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n", 362 dev_dbg(emu->card->dev,
363 "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
361 emu->p16v_buffer.addr, emu->p16v_buffer.area, 364 emu->p16v_buffer.addr, emu->p16v_buffer.area,
362 emu->p16v_buffer.bytes); 365 emu->p16v_buffer.bytes);
363#endif /* debug */ 366#endif /* debug */
@@ -405,7 +408,7 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
405 u32 tmp; 408 u32 tmp;
406 409
407 /* 410 /*
408 printk(KERN_DEBUG "prepare capture:channel_number=%d, rate=%d, " 411 dev_dbg(emu->card->dev, "prepare capture:channel_number=%d, rate=%d, "
409 "format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, " 412 "format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, "
410 "frames_to_bytes=%d\n", 413 "frames_to_bytes=%d\n",
411 channel, runtime->rate, runtime->format, runtime->channels, 414 channel, runtime->rate, runtime->format, runtime->channels,
@@ -491,13 +494,13 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
491 runtime = s->runtime; 494 runtime = s->runtime;
492 epcm = runtime->private_data; 495 epcm = runtime->private_data;
493 channel = substream->pcm->device-emu->p16v_device_offset; 496 channel = substream->pcm->device-emu->p16v_device_offset;
494 /* snd_printk(KERN_DEBUG "p16v channel=%d\n", channel); */ 497 /* dev_dbg(emu->card->dev, "p16v channel=%d\n", channel); */
495 epcm->running = running; 498 epcm->running = running;
496 basic |= (0x1<<channel); 499 basic |= (0x1<<channel);
497 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel); 500 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel);
498 snd_pcm_trigger_done(s, substream); 501 snd_pcm_trigger_done(s, substream);
499 } 502 }
500 /* snd_printk(KERN_DEBUG "basic=0x%x, inte=0x%x\n", basic, inte); */ 503 /* dev_dbg(emu->card->dev, "basic=0x%x, inte=0x%x\n", basic, inte); */
501 504
502 switch (cmd) { 505 switch (cmd) {
503 case SNDRV_PCM_TRIGGER_START: 506 case SNDRV_PCM_TRIGGER_START:
@@ -588,10 +591,10 @@ snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream)
588 ptr=ptr2; 591 ptr=ptr2;
589 if (ptr >= runtime->buffer_size) { 592 if (ptr >= runtime->buffer_size) {
590 ptr -= runtime->buffer_size; 593 ptr -= runtime->buffer_size;
591 printk(KERN_WARNING "buffer capture limited!\n"); 594 dev_warn(emu->card->dev, "buffer capture limited!\n");
592 } 595 }
593 /* 596 /*
594 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, " 597 dev_dbg(emu->card->dev, "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
595 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", 598 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
596 ptr1, ptr2, ptr, (int)runtime->buffer_size, 599 ptr1, ptr2, ptr, (int)runtime->buffer_size,
597 (int)runtime->period_size, (int)runtime->frame_bits, 600 (int)runtime->period_size, (int)runtime->frame_bits,
@@ -630,7 +633,7 @@ int snd_p16v_free(struct snd_emu10k1 *chip)
630 if (chip->p16v_buffer.area) { 633 if (chip->p16v_buffer.area) {
631 snd_dma_free_pages(&chip->p16v_buffer); 634 snd_dma_free_pages(&chip->p16v_buffer);
632 /* 635 /*
633 snd_printk(KERN_DEBUG "period lables free: %p\n", 636 dev_dbg(chip->card->dev, "period lables free: %p\n",
634 &chip->p16v_buffer); 637 &chip->p16v_buffer);
635 */ 638 */
636 } 639 }
@@ -644,7 +647,7 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm **rpcm)
644 int err; 647 int err;
645 int capture=1; 648 int capture=1;
646 649
647 /* snd_printk(KERN_DEBUG "snd_p16v_pcm called. device=%d\n", device); */ 650 /* dev_dbg(emu->card->dev, "snd_p16v_pcm called. device=%d\n", device); */
648 emu->p16v_device_offset = device; 651 emu->p16v_device_offset = device;
649 if (rpcm) 652 if (rpcm)
650 *rpcm = NULL; 653 *rpcm = NULL;
@@ -672,7 +675,7 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm **rpcm)
672 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0) 675 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
673 return err; 676 return err;
674 /* 677 /*
675 snd_printk(KERN_DEBUG 678 dev_dbg(emu->card->dev,
676 "preallocate playback substream: err=%d\n", err); 679 "preallocate playback substream: err=%d\n", err);
677 */ 680 */
678 } 681 }
@@ -686,7 +689,7 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm **rpcm)
686 65536 - 64, 65536 - 64)) < 0) 689 65536 - 64, 65536 - 64)) < 0)
687 return err; 690 return err;
688 /* 691 /*
689 snd_printk(KERN_DEBUG 692 dev_dbg(emu->card->dev,
690 "preallocate capture substream: err=%d\n", err); 693 "preallocate capture substream: err=%d\n", err);
691 */ 694 */
692 } 695 }
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index 101e7cb79cb2..f16fd5cfb7cd 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -55,7 +55,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
55 first_voice = last_voice = 0; 55 first_voice = last_voice = 0;
56 for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) { 56 for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) {
57 /* 57 /*
58 printk(KERN_DEBUG "i %d j %d next free %d!\n", 58 dev_dbg(emu->card->dev, "i %d j %d next free %d!\n",
59 i, j, emu->next_free_voice); 59 i, j, emu->next_free_voice);
60 */ 60 */
61 i %= NUM_G; 61 i %= NUM_G;
@@ -75,7 +75,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
75 } 75 }
76 } 76 }
77 if (!skip) { 77 if (!skip) {
78 /* printk(KERN_DEBUG "allocated voice %d\n", i); */ 78 /* dev_dbg(emu->card->dev, "allocated voice %d\n", i); */
79 first_voice = i; 79 first_voice = i;
80 last_voice = (i + number) % NUM_G; 80 last_voice = (i + number) % NUM_G;
81 emu->next_free_voice = last_voice; 81 emu->next_free_voice = last_voice;
@@ -89,7 +89,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
89 for (i = 0; i < number; i++) { 89 for (i = 0; i < number; i++) {
90 voice = &emu->voices[(first_voice + i) % NUM_G]; 90 voice = &emu->voices[(first_voice + i) % NUM_G];
91 /* 91 /*
92 printk(kERN_DEBUG "voice alloc - %i, %i of %i\n", 92 dev_dbg(emu->card->dev, "voice alloc - %i, %i of %i\n",
93 voice->number, idx-first_voice+1, number); 93 voice->number, idx-first_voice+1, number);
94 */ 94 */
95 voice->use = 1; 95 voice->use = 1;