aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-03-12 04:36:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 15:38:04 -0400
commita64bb4b7111e063154f97ff64dab03144cdfb5d9 (patch)
treeddfede98c2436d588d41c101e0e78756e7c635a0 /drivers/media/video
parent0b5f265a88d89cbbf8abc42ca3311cb3219162ab (diff)
[media] cx18: use core priority handling
VIDIOC_S/G_PRIORITY handling is now done by the v4l2 core framework. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx18/cx18-driver.h2
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c2
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c57
3 files changed, 0 insertions, 61 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h
index 30a857473e54..b86a740c68df 100644
--- a/drivers/media/video/cx18/cx18-driver.h
+++ b/drivers/media/video/cx18/cx18-driver.h
@@ -409,7 +409,6 @@ struct cx18_open_id {
409 struct v4l2_fh fh; 409 struct v4l2_fh fh;
410 u32 open_id; 410 u32 open_id;
411 int type; 411 int type;
412 enum v4l2_priority prio;
413 struct cx18 *cx; 412 struct cx18 *cx;
414}; 413};
415 414
@@ -605,7 +604,6 @@ struct cx18 {
605 uninitialized value in the stream->id. */ 604 uninitialized value in the stream->id. */
606 605
607 u32 base_addr; 606 u32 base_addr;
608 struct v4l2_prio_state prio;
609 607
610 u8 card_rev; 608 u8 card_rev;
611 void __iomem *enc_mem, *reg_mem; 609 void __iomem *enc_mem, *reg_mem;
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 1172d68925c0..e9802d99439b 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -683,7 +683,6 @@ int cx18_v4l2_close(struct file *filp)
683 683
684 CX18_DEBUG_IOCTL("close() of %s\n", s->name); 684 CX18_DEBUG_IOCTL("close() of %s\n", s->name);
685 685
686 v4l2_prio_close(&cx->prio, id->prio);
687 v4l2_fh_del(fh); 686 v4l2_fh_del(fh);
688 v4l2_fh_exit(fh); 687 v4l2_fh_exit(fh);
689 688
@@ -740,7 +739,6 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
740 739
741 item->cx = cx; 740 item->cx = cx;
742 item->type = s->type; 741 item->type = s->type;
743 v4l2_prio_open(&cx->prio, &item->prio);
744 742
745 item->open_id = cx->open_id++; 743 item->open_id = cx->open_id++;
746 filp->private_data = &item->fh; 744 filp->private_data = &item->fh;
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 6624ec2419d3..86c30b9963e5 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -277,10 +277,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
277 int ret; 277 int ret;
278 int w, h; 278 int w, h;
279 279
280 ret = v4l2_prio_check(&cx->prio, id->prio);
281 if (ret)
282 return ret;
283
284 ret = cx18_try_fmt_vid_cap(file, fh, fmt); 280 ret = cx18_try_fmt_vid_cap(file, fh, fmt);
285 if (ret) 281 if (ret)
286 return ret; 282 return ret;
@@ -307,10 +303,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
307 struct cx18 *cx = id->cx; 303 struct cx18 *cx = id->cx;
308 int ret; 304 int ret;
309 305
310 ret = v4l2_prio_check(&cx->prio, id->prio);
311 if (ret)
312 return ret;
313
314 /* 306 /*
315 * Changing the Encoder's Raw VBI parameters won't have any effect 307 * Changing the Encoder's Raw VBI parameters won't have any effect
316 * if any analog capture is ongoing 308 * if any analog capture is ongoing
@@ -342,10 +334,6 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
342 int ret; 334 int ret;
343 struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced; 335 struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
344 336
345 ret = v4l2_prio_check(&cx->prio, id->prio);
346 if (ret)
347 return ret;
348
349 cx18_try_fmt_sliced_vbi_cap(file, fh, fmt); 337 cx18_try_fmt_sliced_vbi_cap(file, fh, fmt);
350 338
351 /* 339 /*
@@ -464,22 +452,6 @@ static int cx18_s_register(struct file *file, void *fh,
464} 452}
465#endif 453#endif
466 454
467static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
468{
469 struct cx18 *cx = file2id(file)->cx;
470
471 *p = v4l2_prio_max(&cx->prio);
472 return 0;
473}
474
475static int cx18_s_priority(struct file *file, void *fh, enum v4l2_priority prio)
476{
477 struct cx18_open_id *id = file2id(file);
478 struct cx18 *cx = id->cx;
479
480 return v4l2_prio_change(&cx->prio, &id->prio, prio);
481}
482
483static int cx18_querycap(struct file *file, void *fh, 455static int cx18_querycap(struct file *file, void *fh,
484 struct v4l2_capability *vcap) 456 struct v4l2_capability *vcap)
485{ 457{
@@ -548,11 +520,6 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
548{ 520{
549 struct cx18_open_id *id = fh2id(fh); 521 struct cx18_open_id *id = fh2id(fh);
550 struct cx18 *cx = id->cx; 522 struct cx18 *cx = id->cx;
551 int ret;
552
553 ret = v4l2_prio_check(&cx->prio, id->prio);
554 if (ret)
555 return ret;
556 523
557 if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 524 if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
558 return -EINVAL; 525 return -EINVAL;
@@ -600,11 +567,6 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
600{ 567{
601 struct cx18_open_id *id = fh2id(fh); 568 struct cx18_open_id *id = fh2id(fh);
602 struct cx18 *cx = id->cx; 569 struct cx18 *cx = id->cx;
603 int ret;
604
605 ret = v4l2_prio_check(&cx->prio, id->prio);
606 if (ret)
607 return ret;
608 570
609 if (inp >= cx->nof_inputs) 571 if (inp >= cx->nof_inputs)
610 return -EINVAL; 572 return -EINVAL;
@@ -646,11 +608,6 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
646{ 608{
647 struct cx18_open_id *id = fh2id(fh); 609 struct cx18_open_id *id = fh2id(fh);
648 struct cx18 *cx = id->cx; 610 struct cx18 *cx = id->cx;
649 int ret;
650
651 ret = v4l2_prio_check(&cx->prio, id->prio);
652 if (ret)
653 return ret;
654 611
655 if (vf->tuner != 0) 612 if (vf->tuner != 0)
656 return -EINVAL; 613 return -EINVAL;
@@ -674,11 +631,6 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
674{ 631{
675 struct cx18_open_id *id = fh2id(fh); 632 struct cx18_open_id *id = fh2id(fh);
676 struct cx18 *cx = id->cx; 633 struct cx18 *cx = id->cx;
677 int ret;
678
679 ret = v4l2_prio_check(&cx->prio, id->prio);
680 if (ret)
681 return ret;
682 634
683 if ((*std & V4L2_STD_ALL) == 0) 635 if ((*std & V4L2_STD_ALL) == 0)
684 return -EINVAL; 636 return -EINVAL;
@@ -715,11 +667,6 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
715{ 667{
716 struct cx18_open_id *id = fh2id(fh); 668 struct cx18_open_id *id = fh2id(fh);
717 struct cx18 *cx = id->cx; 669 struct cx18 *cx = id->cx;
718 int ret;
719
720 ret = v4l2_prio_check(&cx->prio, id->prio);
721 if (ret)
722 return ret;
723 670
724 if (vt->index != 0) 671 if (vt->index != 0)
725 return -EINVAL; 672 return -EINVAL;
@@ -1088,8 +1035,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
1088 1035
1089 mutex_lock(&cx->serialize_lock); 1036 mutex_lock(&cx->serialize_lock);
1090 1037
1091 /* FIXME - consolidate v4l2_prio_check()'s here */
1092
1093 if (cx18_debug & CX18_DBGFLG_IOCTL) 1038 if (cx18_debug & CX18_DBGFLG_IOCTL)
1094 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 1039 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
1095 res = video_ioctl2(filp, cmd, arg); 1040 res = video_ioctl2(filp, cmd, arg);
@@ -1100,8 +1045,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
1100 1045
1101static const struct v4l2_ioctl_ops cx18_ioctl_ops = { 1046static const struct v4l2_ioctl_ops cx18_ioctl_ops = {
1102 .vidioc_querycap = cx18_querycap, 1047 .vidioc_querycap = cx18_querycap,
1103 .vidioc_g_priority = cx18_g_priority,
1104 .vidioc_s_priority = cx18_s_priority,
1105 .vidioc_s_audio = cx18_s_audio, 1048 .vidioc_s_audio = cx18_s_audio,
1106 .vidioc_g_audio = cx18_g_audio, 1049 .vidioc_g_audio = cx18_g_audio,
1107 .vidioc_enumaudio = cx18_enumaudio, 1050 .vidioc_enumaudio = cx18_enumaudio,