aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-09-14 12:36:34 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 11:30:36 -0400
commit1c2d034e3c0ce4c1c89f1636a9f4aa7615cc7474 (patch)
tree53e7454a2dac4f21de1056f1fdc75ac73e855918 /drivers
parent3d265c96ccb8f72153b4e926053a79e1a52bf264 (diff)
V4L/DVB (4637): Add a default method for VIDIOC_G_PARM
For most drivers, VIDIOC_G_PARM will just return the current standard fps. So, instead of failing, drivers based on video_ioctl2 will implement the default method. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/videodev.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 26e7ea252a0e..479a0675cf60 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -1283,9 +1283,29 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
1283 case VIDIOC_G_PARM: 1283 case VIDIOC_G_PARM:
1284 { 1284 {
1285 struct v4l2_streamparm *p=arg; 1285 struct v4l2_streamparm *p=arg;
1286 if (!vfd->vidioc_g_parm) 1286 if (vfd->vidioc_g_parm) {
1287 break; 1287 ret=vfd->vidioc_g_parm(file, fh, p);
1288 ret=vfd->vidioc_g_parm(file, fh, p); 1288 } else {
1289 struct v4l2_standard s;
1290
1291 if (!vfd->tvnormsize) {
1292 printk (KERN_WARNING "%s: no TV norms defined!\n",
1293 vfd->name);
1294 break;
1295 }
1296
1297 if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1298 return -EINVAL;
1299
1300 v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id,
1301 vfd->tvnorms[vfd->current_norm].name);
1302
1303 memset(p,0,sizeof(*p));
1304
1305 p->parm.capture.timeperframe = s.frameperiod;
1306 ret=0;
1307 }
1308
1289 dbgarg (cmd, "type=%d\n", p->type); 1309 dbgarg (cmd, "type=%d\n", p->type);
1290 break; 1310 break;
1291 } 1311 }