[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>
This commit is contained in:
Hans Verkuil 2011-03-12 06:36:08 -03:00 committed by Mauro Carvalho Chehab
parent 0b5f265a88
commit a64bb4b711
3 changed files with 0 additions and 61 deletions

View File

@ -409,7 +409,6 @@ struct cx18_open_id {
struct v4l2_fh fh; struct v4l2_fh fh;
u32 open_id; u32 open_id;
int type; int type;
enum v4l2_priority prio;
struct cx18 *cx; struct cx18 *cx;
}; };
@ -605,7 +604,6 @@ struct cx18 {
uninitialized value in the stream->id. */ uninitialized value in the stream->id. */
u32 base_addr; u32 base_addr;
struct v4l2_prio_state prio;
u8 card_rev; u8 card_rev;
void __iomem *enc_mem, *reg_mem; void __iomem *enc_mem, *reg_mem;

View File

@ -683,7 +683,6 @@ int cx18_v4l2_close(struct file *filp)
CX18_DEBUG_IOCTL("close() of %s\n", s->name); CX18_DEBUG_IOCTL("close() of %s\n", s->name);
v4l2_prio_close(&cx->prio, id->prio);
v4l2_fh_del(fh); v4l2_fh_del(fh);
v4l2_fh_exit(fh); v4l2_fh_exit(fh);
@ -740,7 +739,6 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
item->cx = cx; item->cx = cx;
item->type = s->type; item->type = s->type;
v4l2_prio_open(&cx->prio, &item->prio);
item->open_id = cx->open_id++; item->open_id = cx->open_id++;
filp->private_data = &item->fh; filp->private_data = &item->fh;

View File

@ -277,10 +277,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
int ret; int ret;
int w, h; int w, h;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
ret = cx18_try_fmt_vid_cap(file, fh, fmt); ret = cx18_try_fmt_vid_cap(file, fh, fmt);
if (ret) if (ret)
return ret; return ret;
@ -307,10 +303,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = id->cx; struct cx18 *cx = id->cx;
int ret; int ret;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
/* /*
* Changing the Encoder's Raw VBI parameters won't have any effect * Changing the Encoder's Raw VBI parameters won't have any effect
* if any analog capture is ongoing * if any analog capture is ongoing
@ -342,10 +334,6 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
int ret; int ret;
struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced; struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
cx18_try_fmt_sliced_vbi_cap(file, fh, fmt); cx18_try_fmt_sliced_vbi_cap(file, fh, fmt);
/* /*
@ -464,22 +452,6 @@ static int cx18_s_register(struct file *file, void *fh,
} }
#endif #endif
static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
{
struct cx18 *cx = file2id(file)->cx;
*p = v4l2_prio_max(&cx->prio);
return 0;
}
static int cx18_s_priority(struct file *file, void *fh, enum v4l2_priority prio)
{
struct cx18_open_id *id = file2id(file);
struct cx18 *cx = id->cx;
return v4l2_prio_change(&cx->prio, &id->prio, prio);
}
static int cx18_querycap(struct file *file, void *fh, static int cx18_querycap(struct file *file, void *fh,
struct v4l2_capability *vcap) struct v4l2_capability *vcap)
{ {
@ -548,11 +520,6 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
{ {
struct cx18_open_id *id = fh2id(fh); struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx; struct cx18 *cx = id->cx;
int ret;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL; return -EINVAL;
@ -600,11 +567,6 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
{ {
struct cx18_open_id *id = fh2id(fh); struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx; struct cx18 *cx = id->cx;
int ret;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
if (inp >= cx->nof_inputs) if (inp >= cx->nof_inputs)
return -EINVAL; return -EINVAL;
@ -646,11 +608,6 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
{ {
struct cx18_open_id *id = fh2id(fh); struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx; struct cx18 *cx = id->cx;
int ret;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
if (vf->tuner != 0) if (vf->tuner != 0)
return -EINVAL; return -EINVAL;
@ -674,11 +631,6 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
{ {
struct cx18_open_id *id = fh2id(fh); struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx; struct cx18 *cx = id->cx;
int ret;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
if ((*std & V4L2_STD_ALL) == 0) if ((*std & V4L2_STD_ALL) == 0)
return -EINVAL; return -EINVAL;
@ -715,11 +667,6 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
{ {
struct cx18_open_id *id = fh2id(fh); struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx; struct cx18 *cx = id->cx;
int ret;
ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;
if (vt->index != 0) if (vt->index != 0)
return -EINVAL; return -EINVAL;
@ -1088,8 +1035,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
mutex_lock(&cx->serialize_lock); mutex_lock(&cx->serialize_lock);
/* FIXME - consolidate v4l2_prio_check()'s here */
if (cx18_debug & CX18_DBGFLG_IOCTL) if (cx18_debug & CX18_DBGFLG_IOCTL)
vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
res = video_ioctl2(filp, cmd, arg); res = video_ioctl2(filp, cmd, arg);
@ -1100,8 +1045,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
static const struct v4l2_ioctl_ops cx18_ioctl_ops = { static const struct v4l2_ioctl_ops cx18_ioctl_ops = {
.vidioc_querycap = cx18_querycap, .vidioc_querycap = cx18_querycap,
.vidioc_g_priority = cx18_g_priority,
.vidioc_s_priority = cx18_s_priority,
.vidioc_s_audio = cx18_s_audio, .vidioc_s_audio = cx18_s_audio,
.vidioc_g_audio = cx18_g_audio, .vidioc_g_audio = cx18_g_audio,
.vidioc_enumaudio = cx18_enumaudio, .vidioc_enumaudio = cx18_enumaudio,