aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss')
-rw-r--r--sound/oss/au1550_ac97.c16
-rw-r--r--sound/oss/kahlua.c2
-rw-r--r--sound/oss/soundcard.c35
3 files changed, 33 insertions, 20 deletions
diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c
index 4191acccbcdb..c1070e33b32f 100644
--- a/sound/oss/au1550_ac97.c
+++ b/sound/oss/au1550_ac97.c
@@ -614,7 +614,8 @@ start_adc(struct au1550_state *s)
614 /* Put two buffers on the ring to get things started. 614 /* Put two buffers on the ring to get things started.
615 */ 615 */
616 for (i=0; i<2; i++) { 616 for (i=0; i<2; i++) {
617 au1xxx_dbdma_put_dest(db->dmanr, db->nextIn, db->dma_fragsize); 617 au1xxx_dbdma_put_dest(db->dmanr, virt_to_phys(db->nextIn),
618 db->dma_fragsize, DDMA_FLAGS_IE);
618 619
619 db->nextIn += db->dma_fragsize; 620 db->nextIn += db->dma_fragsize;
620 if (db->nextIn >= db->rawbuf + db->dmasize) 621 if (db->nextIn >= db->rawbuf + db->dmasize)
@@ -732,8 +733,9 @@ static void dac_dma_interrupt(int irq, void *dev_id)
732 db->dma_qcount--; 733 db->dma_qcount--;
733 734
734 if (db->count >= db->fragsize) { 735 if (db->count >= db->fragsize) {
735 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, 736 if (au1xxx_dbdma_put_source(db->dmanr,
736 db->fragsize) == 0) { 737 virt_to_phys(db->nextOut), db->fragsize,
738 DDMA_FLAGS_IE) == 0) {
737 err("qcount < 2 and no ring room!"); 739 err("qcount < 2 and no ring room!");
738 } 740 }
739 db->nextOut += db->fragsize; 741 db->nextOut += db->fragsize;
@@ -777,7 +779,8 @@ static void adc_dma_interrupt(int irq, void *dev_id)
777 779
778 /* Put a new empty buffer on the destination DMA. 780 /* Put a new empty buffer on the destination DMA.
779 */ 781 */
780 au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn, dp->dma_fragsize); 782 au1xxx_dbdma_put_dest(dp->dmanr, virt_to_phys(dp->nextIn),
783 dp->dma_fragsize, DDMA_FLAGS_IE);
781 784
782 dp->nextIn += dp->dma_fragsize; 785 dp->nextIn += dp->dma_fragsize;
783 if (dp->nextIn >= dp->rawbuf + dp->dmasize) 786 if (dp->nextIn >= dp->rawbuf + dp->dmasize)
@@ -1177,8 +1180,9 @@ au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
1177 * we know the dma has stopped. 1180 * we know the dma has stopped.
1178 */ 1181 */
1179 while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) { 1182 while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
1180 if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, 1183 if (au1xxx_dbdma_put_source(db->dmanr,
1181 db->fragsize) == 0) { 1184 virt_to_phys(db->nextOut), db->fragsize,
1185 DDMA_FLAGS_IE) == 0) {
1182 err("qcount < 2 and no ring room!"); 1186 err("qcount < 2 and no ring room!");
1183 } 1187 }
1184 db->nextOut += db->fragsize; 1188 db->nextOut += db->fragsize;
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index 89466b056be7..24d152ccf80d 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -198,7 +198,7 @@ MODULE_LICENSE("GPL");
198 * 5530 only. The 5510/5520 decode is different. 198 * 5530 only. The 5510/5520 decode is different.
199 */ 199 */
200 200
201static struct pci_device_id id_tbl[] = { 201static DEFINE_PCI_DEVICE_TABLE(id_tbl) = {
202 { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO), 0 }, 202 { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO), 0 },
203 { } 203 { }
204}; 204};
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index c62530943888..fde7c12fe5da 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -328,11 +328,11 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, void __user *arg)
328 return mixer_devs[mixdev]->ioctl(mixdev, cmd, arg); 328 return mixer_devs[mixdev]->ioctl(mixdev, cmd, arg);
329} 329}
330 330
331static int sound_ioctl(struct inode *inode, struct file *file, 331static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
332 unsigned int cmd, unsigned long arg)
333{ 332{
334 int len = 0, dtype; 333 int len = 0, dtype;
335 int dev = iminor(inode); 334 int dev = iminor(file->f_dentry->d_inode);
335 long ret = -EINVAL;
336 void __user *p = (void __user *)arg; 336 void __user *p = (void __user *)arg;
337 337
338 if (_SIOC_DIR(cmd) != _SIOC_NONE && _SIOC_DIR(cmd) != 0) { 338 if (_SIOC_DIR(cmd) != _SIOC_NONE && _SIOC_DIR(cmd) != 0) {
@@ -353,6 +353,7 @@ static int sound_ioctl(struct inode *inode, struct file *file,
353 if (cmd == OSS_GETVERSION) 353 if (cmd == OSS_GETVERSION)
354 return __put_user(SOUND_VERSION, (int __user *)p); 354 return __put_user(SOUND_VERSION, (int __user *)p);
355 355
356 lock_kernel();
356 if (_IOC_TYPE(cmd) == 'M' && num_mixers > 0 && /* Mixer ioctl */ 357 if (_IOC_TYPE(cmd) == 'M' && num_mixers > 0 && /* Mixer ioctl */
357 (dev & 0x0f) != SND_DEV_CTL) { 358 (dev & 0x0f) != SND_DEV_CTL) {
358 dtype = dev & 0x0f; 359 dtype = dev & 0x0f;
@@ -360,24 +361,31 @@ static int sound_ioctl(struct inode *inode, struct file *file,
360 case SND_DEV_DSP: 361 case SND_DEV_DSP:
361 case SND_DEV_DSP16: 362 case SND_DEV_DSP16:
362 case SND_DEV_AUDIO: 363 case SND_DEV_AUDIO:
363 return sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev, 364 ret = sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev,
364 cmd, p); 365 cmd, p);
365 366 break;
366 default: 367 default:
367 return sound_mixer_ioctl(dev >> 4, cmd, p); 368 ret = sound_mixer_ioctl(dev >> 4, cmd, p);
369 break;
368 } 370 }
371 unlock_kernel();
372 return ret;
369 } 373 }
374
370 switch (dev & 0x0f) { 375 switch (dev & 0x0f) {
371 case SND_DEV_CTL: 376 case SND_DEV_CTL:
372 if (cmd == SOUND_MIXER_GETLEVELS) 377 if (cmd == SOUND_MIXER_GETLEVELS)
373 return get_mixer_levels(p); 378 ret = get_mixer_levels(p);
374 if (cmd == SOUND_MIXER_SETLEVELS) 379 else if (cmd == SOUND_MIXER_SETLEVELS)
375 return set_mixer_levels(p); 380 ret = set_mixer_levels(p);
376 return sound_mixer_ioctl(dev >> 4, cmd, p); 381 else
382 ret = sound_mixer_ioctl(dev >> 4, cmd, p);
383 break;
377 384
378 case SND_DEV_SEQ: 385 case SND_DEV_SEQ:
379 case SND_DEV_SEQ2: 386 case SND_DEV_SEQ2:
380 return sequencer_ioctl(dev, file, cmd, p); 387 ret = sequencer_ioctl(dev, file, cmd, p);
388 break;
381 389
382 case SND_DEV_DSP: 390 case SND_DEV_DSP:
383 case SND_DEV_DSP16: 391 case SND_DEV_DSP16:
@@ -390,7 +398,8 @@ static int sound_ioctl(struct inode *inode, struct file *file,
390 break; 398 break;
391 399
392 } 400 }
393 return -EINVAL; 401 unlock_kernel();
402 return ret;
394} 403}
395 404
396static unsigned int sound_poll(struct file *file, poll_table * wait) 405static unsigned int sound_poll(struct file *file, poll_table * wait)
@@ -490,7 +499,7 @@ const struct file_operations oss_sound_fops = {
490 .read = sound_read, 499 .read = sound_read,
491 .write = sound_write, 500 .write = sound_write,
492 .poll = sound_poll, 501 .poll = sound_poll,
493 .ioctl = sound_ioctl, 502 .unlocked_ioctl = sound_ioctl,
494 .mmap = sound_mmap, 503 .mmap = sound_mmap,
495 .open = sound_open, 504 .open = sound_open,
496 .release = sound_release, 505 .release = sound_release,