aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-oss.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-oss.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index b1dcb4d1078..f1b0e0d93d7 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -64,7 +64,7 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks)
64 dev->oss.bufsize = blksize * blocks; 64 dev->oss.bufsize = blksize * blocks;
65 65
66 dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", 66 dprintk("buffer config: %d blocks / %d bytes, %d kB total\n",
67 blocks,blksize,blksize * blocks / 1024); 67 blocks,blksize,blksize * blocks / 1024);
68 return 0; 68 return 0;
69} 69}
70 70
@@ -371,20 +371,20 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
371 371
372 if (oss_debug > 1) 372 if (oss_debug > 1)
373 saa7134_print_ioctl(dev->name,cmd); 373 saa7134_print_ioctl(dev->name,cmd);
374 switch (cmd) { 374 switch (cmd) {
375 case OSS_GETVERSION: 375 case OSS_GETVERSION:
376 return put_user(SOUND_VERSION, p); 376 return put_user(SOUND_VERSION, p);
377 case SNDCTL_DSP_GETCAPS: 377 case SNDCTL_DSP_GETCAPS:
378 return 0; 378 return 0;
379 379
380 case SNDCTL_DSP_SPEED: 380 case SNDCTL_DSP_SPEED:
381 if (get_user(val, p)) 381 if (get_user(val, p))
382 return -EFAULT; 382 return -EFAULT;
383 /* fall through */ 383 /* fall through */
384 case SOUND_PCM_READ_RATE: 384 case SOUND_PCM_READ_RATE:
385 return put_user(dev->oss.rate, p); 385 return put_user(dev->oss.rate, p);
386 386
387 case SNDCTL_DSP_STEREO: 387 case SNDCTL_DSP_STEREO:
388 if (get_user(val, p)) 388 if (get_user(val, p))
389 return -EFAULT; 389 return -EFAULT;
390 down(&dev->oss.lock); 390 down(&dev->oss.lock);
@@ -396,7 +396,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
396 up(&dev->oss.lock); 396 up(&dev->oss.lock);
397 return put_user(dev->oss.channels-1, p); 397 return put_user(dev->oss.channels-1, p);
398 398
399 case SNDCTL_DSP_CHANNELS: 399 case SNDCTL_DSP_CHANNELS:
400 if (get_user(val, p)) 400 if (get_user(val, p))
401 return -EFAULT; 401 return -EFAULT;
402 if (val != 1 && val != 2) 402 if (val != 1 && val != 2)
@@ -409,15 +409,15 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
409 } 409 }
410 up(&dev->oss.lock); 410 up(&dev->oss.lock);
411 /* fall through */ 411 /* fall through */
412 case SOUND_PCM_READ_CHANNELS: 412 case SOUND_PCM_READ_CHANNELS:
413 return put_user(dev->oss.channels, p); 413 return put_user(dev->oss.channels, p);
414 414
415 case SNDCTL_DSP_GETFMTS: /* Returns a mask */ 415 case SNDCTL_DSP_GETFMTS: /* Returns a mask */
416 return put_user(AFMT_U8 | AFMT_S8 | 416 return put_user(AFMT_U8 | AFMT_S8 |
417 AFMT_U16_LE | AFMT_U16_BE | 417 AFMT_U16_LE | AFMT_U16_BE |
418 AFMT_S16_LE | AFMT_S16_BE, p); 418 AFMT_S16_LE | AFMT_S16_BE, p);
419 419
420 case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */ 420 case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */
421 if (get_user(val, p)) 421 if (get_user(val, p))
422 return -EFAULT; 422 return -EFAULT;
423 switch (val) { 423 switch (val) {
@@ -442,7 +442,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
442 return -EINVAL; 442 return -EINVAL;
443 } 443 }
444 444
445 case SOUND_PCM_READ_BITS: 445 case SOUND_PCM_READ_BITS:
446 switch (dev->oss.afmt) { 446 switch (dev->oss.afmt) {
447 case AFMT_U8: 447 case AFMT_U8:
448 case AFMT_S8: 448 case AFMT_S8:
@@ -456,20 +456,20 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
456 return -EINVAL; 456 return -EINVAL;
457 } 457 }
458 458
459 case SNDCTL_DSP_NONBLOCK: 459 case SNDCTL_DSP_NONBLOCK:
460 file->f_flags |= O_NONBLOCK; 460 file->f_flags |= O_NONBLOCK;
461 return 0; 461 return 0;
462 462
463 case SNDCTL_DSP_RESET: 463 case SNDCTL_DSP_RESET:
464 down(&dev->oss.lock); 464 down(&dev->oss.lock);
465 if (dev->oss.recording_on) 465 if (dev->oss.recording_on)
466 dsp_rec_stop(dev); 466 dsp_rec_stop(dev);
467 up(&dev->oss.lock); 467 up(&dev->oss.lock);
468 return 0; 468 return 0;
469 case SNDCTL_DSP_GETBLKSIZE: 469 case SNDCTL_DSP_GETBLKSIZE:
470 return put_user(dev->oss.blksize, p); 470 return put_user(dev->oss.blksize, p);
471 471
472 case SNDCTL_DSP_SETFRAGMENT: 472 case SNDCTL_DSP_SETFRAGMENT:
473 if (get_user(val, p)) 473 if (get_user(val, p))
474 return -EFAULT; 474 return -EFAULT;
475 if (dev->oss.recording_on) 475 if (dev->oss.recording_on)
@@ -480,7 +480,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
480 dsp_buffer_init(dev); 480 dsp_buffer_init(dev);
481 return 0; 481 return 0;
482 482
483 case SNDCTL_DSP_SYNC: 483 case SNDCTL_DSP_SYNC:
484 /* NOP */ 484 /* NOP */
485 return 0; 485 return 0;
486 486
@@ -563,7 +563,7 @@ mixer_recsrc_7133(struct saa7134_dev *dev)
563 switch (dev->oss.input) { 563 switch (dev->oss.input) {
564 case TV: 564 case TV:
565 xbarin = 0; // Demodulator 565 xbarin = 0; // Demodulator
566 anabar = 2; // DACs 566 anabar = 2; // DACs
567 break; 567 break;
568 case LINE1: 568 case LINE1:
569 anabar = 0; // aux1, aux1 569 anabar = 0; // aux1, aux1
@@ -667,28 +667,28 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
667 667
668 if (oss_debug > 1) 668 if (oss_debug > 1)
669 saa7134_print_ioctl(dev->name,cmd); 669 saa7134_print_ioctl(dev->name,cmd);
670 switch (cmd) { 670 switch (cmd) {
671 case OSS_GETVERSION: 671 case OSS_GETVERSION:
672 return put_user(SOUND_VERSION, p); 672 return put_user(SOUND_VERSION, p);
673 case SOUND_MIXER_INFO: 673 case SOUND_MIXER_INFO:
674 { 674 {
675 mixer_info info; 675 mixer_info info;
676 memset(&info,0,sizeof(info)); 676 memset(&info,0,sizeof(info));
677 strlcpy(info.id, "TV audio", sizeof(info.id)); 677 strlcpy(info.id, "TV audio", sizeof(info.id));
678 strlcpy(info.name, dev->name, sizeof(info.name)); 678 strlcpy(info.name, dev->name, sizeof(info.name));
679 info.modify_counter = dev->oss.count; 679 info.modify_counter = dev->oss.count;
680 if (copy_to_user(argp, &info, sizeof(info))) 680 if (copy_to_user(argp, &info, sizeof(info)))
681 return -EFAULT; 681 return -EFAULT;
682 return 0; 682 return 0;
683 } 683 }
684 case SOUND_OLD_MIXER_INFO: 684 case SOUND_OLD_MIXER_INFO:
685 { 685 {
686 _old_mixer_info info; 686 _old_mixer_info info;
687 memset(&info,0,sizeof(info)); 687 memset(&info,0,sizeof(info));
688 strlcpy(info.id, "TV audio", sizeof(info.id)); 688 strlcpy(info.id, "TV audio", sizeof(info.id));
689 strlcpy(info.name, dev->name, sizeof(info.name)); 689 strlcpy(info.name, dev->name, sizeof(info.name));
690 if (copy_to_user(argp, &info, sizeof(info))) 690 if (copy_to_user(argp, &info, sizeof(info)))
691 return -EFAULT; 691 return -EFAULT;
692 return 0; 692 return 0;
693 } 693 }
694 case MIXER_READ(SOUND_MIXER_CAPS): 694 case MIXER_READ(SOUND_MIXER_CAPS):
@@ -771,7 +771,7 @@ struct file_operations saa7134_mixer_fops = {
771int saa7134_oss_init1(struct saa7134_dev *dev) 771int saa7134_oss_init1(struct saa7134_dev *dev)
772{ 772{
773 /* general */ 773 /* general */
774 init_MUTEX(&dev->oss.lock); 774 init_MUTEX(&dev->oss.lock);
775 init_waitqueue_head(&dev->oss.wq); 775 init_waitqueue_head(&dev->oss.wq);
776 776
777 switch (dev->pci->device) { 777 switch (dev->pci->device) {