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.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index 8badd2a9cb2f..7448e386a804 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -373,6 +373,42 @@ static ssize_t dsp_write(struct file *file, const char __user *buffer,
373 return -EINVAL; 373 return -EINVAL;
374} 374}
375 375
376static const char *osspcm_ioctls[] = {
377 "RESET", "SYNC", "SPEED", "STEREO", "GETBLKSIZE", "SETFMT",
378 "CHANNELS", "?", "POST", "SUBDIVIDE", "SETFRAGMENT", "GETFMTS",
379 "GETOSPACE", "GETISPACE", "NONBLOCK", "GETCAPS", "GET/SETTRIGGER",
380 "GETIPTR", "GETOPTR", "MAPINBUF", "MAPOUTBUF", "SETSYNCRO",
381 "SETDUPLEX", "GETODELAY"
382};
383#define OSSPCM_IOCTLS ARRAY_SIZE(osspcm_ioctls)
384
385static void saa7134_oss_print_ioctl(char *name, unsigned int cmd)
386{
387 char *dir;
388
389 switch (_IOC_DIR(cmd)) {
390 case _IOC_NONE: dir = "--"; break;
391 case _IOC_READ: dir = "r-"; break;
392 case _IOC_WRITE: dir = "-w"; break;
393 case _IOC_READ | _IOC_WRITE: dir = "rw"; break;
394 default: dir = "??"; break;
395 }
396 switch (_IOC_TYPE(cmd)) {
397 case 'P':
398 printk(KERN_DEBUG "%s: ioctl 0x%08x (oss dsp, %s, SNDCTL_DSP_%s)\n",
399 name, cmd, dir, (_IOC_NR(cmd) < OSSPCM_IOCTLS) ?
400 osspcm_ioctls[_IOC_NR(cmd)] : "???");
401 break;
402 case 'M':
403 printk(KERN_DEBUG "%s: ioctl 0x%08x (oss mixer, %s, #%d)\n",
404 name, cmd, dir, _IOC_NR(cmd));
405 break;
406 default:
407 printk(KERN_DEBUG "%s: ioctl 0x%08x (???, %s, #%d)\n",
408 name, cmd, dir, _IOC_NR(cmd));
409 }
410}
411
376static int dsp_ioctl(struct inode *inode, struct file *file, 412static int dsp_ioctl(struct inode *inode, struct file *file,
377 unsigned int cmd, unsigned long arg) 413 unsigned int cmd, unsigned long arg)
378{ 414{
@@ -382,7 +418,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
382 int val = 0; 418 int val = 0;
383 419
384 if (debug > 1) 420 if (debug > 1)
385 saa7134_print_ioctl(dev->name,cmd); 421 saa7134_oss_print_ioctl(dev->name,cmd);
386 switch (cmd) { 422 switch (cmd) {
387 case OSS_GETVERSION: 423 case OSS_GETVERSION:
388 return put_user(SOUND_VERSION, p); 424 return put_user(SOUND_VERSION, p);
@@ -678,7 +714,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
678 int __user *p = argp; 714 int __user *p = argp;
679 715
680 if (debug > 1) 716 if (debug > 1)
681 saa7134_print_ioctl(dev->name,cmd); 717 saa7134_oss_print_ioctl(dev->name,cmd);
682 switch (cmd) { 718 switch (cmd) {
683 case OSS_GETVERSION: 719 case OSS_GETVERSION:
684 return put_user(SOUND_VERSION, p); 720 return put_user(SOUND_VERSION, p);