aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/cmipci.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 66c0558ce449..12c318e175f4 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -796,7 +796,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
796 if (runtime->channels > 1) 796 if (runtime->channels > 1)
797 rec->fmt |= 0x01; 797 rec->fmt |= 0x01;
798 if (rec->is_dac && set_dac_channels(cm, rec, runtime->channels) < 0) { 798 if (rec->is_dac && set_dac_channels(cm, rec, runtime->channels) < 0) {
799 snd_printd("cannot set dac channels\n"); 799 dev_dbg(cm->card->dev, "cannot set dac channels\n");
800 return -EINVAL; 800 return -EINVAL;
801 } 801 }
802 802
@@ -827,7 +827,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
827 else 827 else
828 cm->ctrl |= val; 828 cm->ctrl |= val;
829 snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl); 829 snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
830 //snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl); 830 /* dev_dbg(cm->card->dev, "functrl0 = %08x\n", cm->ctrl); */
831 831
832 /* set sample rate */ 832 /* set sample rate */
833 freq = 0; 833 freq = 0;
@@ -850,7 +850,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
850 val |= (freq << CM_ASFC_SHIFT) & CM_ASFC_MASK; 850 val |= (freq << CM_ASFC_SHIFT) & CM_ASFC_MASK;
851 } 851 }
852 snd_cmipci_write(cm, CM_REG_FUNCTRL1, val); 852 snd_cmipci_write(cm, CM_REG_FUNCTRL1, val);
853 //snd_printd("cmipci: functrl1 = %08x\n", val); 853 dev_dbg(cm->card->dev, "functrl1 = %08x\n", val);
854 854
855 /* set format */ 855 /* set format */
856 val = snd_cmipci_read(cm, CM_REG_CHFORMAT); 856 val = snd_cmipci_read(cm, CM_REG_CHFORMAT);
@@ -866,7 +866,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
866 val |= freq_ext << (rec->ch * 2); 866 val |= freq_ext << (rec->ch * 2);
867 } 867 }
868 snd_cmipci_write(cm, CM_REG_CHFORMAT, val); 868 snd_cmipci_write(cm, CM_REG_CHFORMAT, val);
869 //snd_printd("cmipci: chformat = %08x\n", val); 869 dev_dbg(cm->card->dev, "chformat = %08x\n", val);
870 870
871 if (!rec->is_dac && cm->chip_version) { 871 if (!rec->is_dac && cm->chip_version) {
872 if (runtime->rate > 44100) 872 if (runtime->rate > 44100)
@@ -904,7 +904,7 @@ static int snd_cmipci_pcm_trigger(struct cmipci *cm, struct cmipci_pcm *rec,
904 cm->ctrl |= chen; 904 cm->ctrl |= chen;
905 /* enable channel */ 905 /* enable channel */
906 snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl); 906 snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
907 //snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl); 907 dev_dbg(cm->card->dev, "functrl0 = %08x\n", cm->ctrl);
908 break; 908 break;
909 case SNDRV_PCM_TRIGGER_STOP: 909 case SNDRV_PCM_TRIGGER_STOP:
910 rec->running = 0; 910 rec->running = 0;
@@ -952,7 +952,7 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
952 if (rem < rec->dma_size) 952 if (rem < rec->dma_size)
953 goto ok; 953 goto ok;
954 } 954 }
955 printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem); 955 dev_err(cm->card->dev, "invalid PCM pointer: %#x\n", rem);
956 return SNDRV_PCM_POS_XRUN; 956 return SNDRV_PCM_POS_XRUN;
957ok: 957ok:
958 ptr = (rec->dma_size - (rem + 1)) >> rec->shift; 958 ptr = (rec->dma_size - (rem + 1)) >> rec->shift;
@@ -2889,13 +2889,13 @@ static int snd_cmipci_create_gameport(struct cmipci *cm, int dev)
2889 } 2889 }
2890 2890
2891 if (!r) { 2891 if (!r) {
2892 printk(KERN_WARNING "cmipci: cannot reserve joystick ports\n"); 2892 dev_warn(cm->card->dev, "cannot reserve joystick ports\n");
2893 return -EBUSY; 2893 return -EBUSY;
2894 } 2894 }
2895 2895
2896 cm->gameport = gp = gameport_allocate_port(); 2896 cm->gameport = gp = gameport_allocate_port();
2897 if (!gp) { 2897 if (!gp) {
2898 printk(KERN_ERR "cmipci: cannot allocate memory for gameport\n"); 2898 dev_err(cm->card->dev, "cannot allocate memory for gameport\n");
2899 release_and_free_resource(r); 2899 release_and_free_resource(r);
2900 return -ENOMEM; 2900 return -ENOMEM;
2901 } 2901 }
@@ -2995,13 +2995,14 @@ static int snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
2995 2995
2996 if (snd_opl3_create(cm->card, iosynth, iosynth + 2, 2996 if (snd_opl3_create(cm->card, iosynth, iosynth + 2,
2997 OPL3_HW_OPL3, 0, &opl3) < 0) { 2997 OPL3_HW_OPL3, 0, &opl3) < 0) {
2998 printk(KERN_ERR "cmipci: no OPL device at %#lx, " 2998 dev_err(cm->card->dev,
2999 "skipping...\n", iosynth); 2999 "no OPL device at %#lx, skipping...\n",
3000 iosynth);
3000 goto disable_fm; 3001 goto disable_fm;
3001 } 3002 }
3002 } 3003 }
3003 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 3004 if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
3004 printk(KERN_ERR "cmipci: cannot create OPL3 hwdep\n"); 3005 dev_err(cm->card->dev, "cannot create OPL3 hwdep\n");
3005 return err; 3006 return err;
3006 } 3007 }
3007 return 0; 3008 return 0;
@@ -3060,7 +3061,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
3060 3061
3061 if (request_irq(pci->irq, snd_cmipci_interrupt, 3062 if (request_irq(pci->irq, snd_cmipci_interrupt,
3062 IRQF_SHARED, KBUILD_MODNAME, cm)) { 3063 IRQF_SHARED, KBUILD_MODNAME, cm)) {
3063 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 3064 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
3064 snd_cmipci_free(cm); 3065 snd_cmipci_free(cm);
3065 return -EBUSY; 3066 return -EBUSY;
3066 } 3067 }
@@ -3192,8 +3193,9 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
3192 /* enable UART */ 3193 /* enable UART */
3193 snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_UART_EN); 3194 snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_UART_EN);
3194 if (inb(iomidi + 1) == 0xff) { 3195 if (inb(iomidi + 1) == 0xff) {
3195 snd_printk(KERN_ERR "cannot enable MPU-401 port" 3196 dev_err(cm->card->dev,
3196 " at %#lx\n", iomidi); 3197 "cannot enable MPU-401 port at %#lx\n",
3198 iomidi);
3197 snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, 3199 snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1,
3198 CM_UART_EN); 3200 CM_UART_EN);
3199 iomidi = 0; 3201 iomidi = 0;
@@ -3237,7 +3239,8 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
3237 MPU401_INFO_INTEGRATED : 0) | 3239 MPU401_INFO_INTEGRATED : 0) |
3238 MPU401_INFO_IRQ_HOOK, 3240 MPU401_INFO_IRQ_HOOK,
3239 -1, &cm->rmidi)) < 0) { 3241 -1, &cm->rmidi)) < 0) {
3240 printk(KERN_ERR "cmipci: no UART401 device at 0x%lx\n", iomidi); 3242 dev_err(cm->card->dev,
3243 "no UART401 device at 0x%lx\n", iomidi);
3241 } 3244 }
3242 } 3245 }
3243 3246
@@ -3380,8 +3383,7 @@ static int snd_cmipci_resume(struct device *dev)
3380 pci_set_power_state(pci, PCI_D0); 3383 pci_set_power_state(pci, PCI_D0);
3381 pci_restore_state(pci); 3384 pci_restore_state(pci);
3382 if (pci_enable_device(pci) < 0) { 3385 if (pci_enable_device(pci) < 0) {
3383 printk(KERN_ERR "cmipci: pci_enable_device failed, " 3386 dev_err(dev, "pci_enable_device failed, disabling device\n");
3384 "disabling device\n");
3385 snd_card_disconnect(card); 3387 snd_card_disconnect(card);
3386 return -EIO; 3388 return -EIO;
3387 } 3389 }