Skip to content

Commit

Permalink
[media] cx18: use core priority handling
Browse files Browse the repository at this point in the history
VIDIOC_S/G_PRIORITY handling is now done by the v4l2 core framework.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
hverkuil authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent 0b5f265 commit a64bb4b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 61 deletions.
2 changes: 0 additions & 2 deletions drivers/media/video/cx18/cx18-driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ struct cx18_open_id {
struct v4l2_fh fh;
u32 open_id;
int type;
enum v4l2_priority prio;
struct cx18 *cx;
};

Expand Down Expand Up @@ -605,7 +604,6 @@ struct cx18 {
uninitialized value in the stream->id. */

u32 base_addr;
struct v4l2_prio_state prio;

u8 card_rev;
void __iomem *enc_mem, *reg_mem;
Expand Down
2 changes: 0 additions & 2 deletions drivers/media/video/cx18/cx18-fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ int cx18_v4l2_close(struct file *filp)

CX18_DEBUG_IOCTL("close() of %s\n", s->name);

v4l2_prio_close(&cx->prio, id->prio);
v4l2_fh_del(fh);
v4l2_fh_exit(fh);

Expand Down Expand Up @@ -740,7 +739,6 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)

item->cx = cx;
item->type = s->type;
v4l2_prio_open(&cx->prio, &item->prio);

item->open_id = cx->open_id++;
filp->private_data = &item->fh;
Expand Down
57 changes: 0 additions & 57 deletions drivers/media/video/cx18/cx18-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,6 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
int ret;
int w, h;

ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;

ret = cx18_try_fmt_vid_cap(file, fh, fmt);
if (ret)
return ret;
Expand All @@ -307,10 +303,6 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
struct cx18 *cx = id->cx;
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
* if any analog capture is ongoing
Expand Down Expand Up @@ -342,10 +334,6 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
int ret;
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);

/*
Expand Down Expand Up @@ -464,22 +452,6 @@ static int cx18_s_register(struct file *file, void *fh,
}
#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,
struct v4l2_capability *vcap)
{
Expand Down Expand Up @@ -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 *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)
return -EINVAL;
Expand Down Expand Up @@ -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 *cx = id->cx;
int ret;

ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;

if (inp >= cx->nof_inputs)
return -EINVAL;
Expand Down Expand Up @@ -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 *cx = id->cx;
int ret;

ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;

if (vf->tuner != 0)
return -EINVAL;
Expand All @@ -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 *cx = id->cx;
int ret;

ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;

if ((*std & V4L2_STD_ALL) == 0)
return -EINVAL;
Expand Down Expand Up @@ -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 *cx = id->cx;
int ret;

ret = v4l2_prio_check(&cx->prio, id->prio);
if (ret)
return ret;

if (vt->index != 0)
return -EINVAL;
Expand Down Expand Up @@ -1088,8 +1035,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,

mutex_lock(&cx->serialize_lock);

/* FIXME - consolidate v4l2_prio_check()'s here */

if (cx18_debug & CX18_DBGFLG_IOCTL)
vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
res = video_ioctl2(filp, cmd, arg);
Expand All @@ -1100,8 +1045,6 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,

static const struct v4l2_ioctl_ops cx18_ioctl_ops = {
.vidioc_querycap = cx18_querycap,
.vidioc_g_priority = cx18_g_priority,
.vidioc_s_priority = cx18_s_priority,
.vidioc_s_audio = cx18_s_audio,
.vidioc_g_audio = cx18_g_audio,
.vidioc_enumaudio = cx18_enumaudio,
Expand Down

0 comments on commit a64bb4b

Please sign in to comment.