Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285663
b: refs/heads/master
c: 09b3bc2
h: refs/heads/master
i:
  285661: 548c3c8
  285659: 544be6f
  285655: 0554b24
  285647: c6f78d9
  285631: 3abf507
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Jan 5, 2012
1 parent e67d492 commit 6d5abc6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 66 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 350451375d6d8e9b124eacad67e221a0fdff0ac9
refs/heads/master: 09b3bc223b99a01f9f33a20a0bbc255da1b6539d
101 changes: 36 additions & 65 deletions trunk/drivers/media/video/cx23885/cx23885-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,16 @@ static int cx23885_querymenu(struct cx23885_dev *dev,
cx2341x_ctrl_get_menu(&dev->mpeg_params, qmenu->id));
}

static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;

call_all(dev, core, g_std, id);

return 0;
}

static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
{
struct cx23885_fh *fh = file->private_data;
Expand All @@ -1224,55 +1234,31 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
if (i == ARRAY_SIZE(cx23885_tvnorms))
return -EINVAL;
dev->encodernorm = cx23885_tvnorms[i];

/* Have the drier core notify the subdevices */
mutex_lock(&dev->lock);
cx23885_set_tvnorm(dev, *id);
mutex_unlock(&dev->lock);

return 0;
}

static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
struct v4l2_input *i)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;
struct cx23885_input *input;
int n;

if (i->index >= 4)
return -EINVAL;

input = &cx23885_boards[dev->board].input[i->index];

if (input->type == 0)
return -EINVAL;

/* FIXME
* strcpy(i->name, input->name); */
strcpy(i->name, "unset");

if (input->type == CX23885_VMUX_TELEVISION ||
input->type == CX23885_VMUX_CABLE)
i->type = V4L2_INPUT_TYPE_TUNER;
else
i->type = V4L2_INPUT_TYPE_CAMERA;

for (n = 0; n < ARRAY_SIZE(cx23885_tvnorms); n++)
i->std |= cx23885_tvnorms[n].id;
return 0;
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;
dprintk(1, "%s()\n", __func__);
return cx23885_enum_input(dev, i);
}

static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;

*i = dev->input;
return 0;
return cx23885_get_input(file, priv, i);
}

static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
{
if (i >= 4)
return -EINVAL;

return 0;
return cx23885_set_input(file, priv, i);
}

static int vidioc_g_tuner(struct file *file, void *priv,
Expand Down Expand Up @@ -1325,43 +1311,25 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}

static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
struct v4l2_frequency *f)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;

cx23885_api_cmd(fh->dev, CX2341X_ENC_STOP_CAPTURE, 3, 0,
CX23885_END_NOW, CX23885_MPEG_CAPTURE,
CX23885_RAW_BITS_NONE);

dprintk(1, "VIDIOC_S_FREQUENCY: dev type %d, f\n",
dev->tuner_type);
dprintk(1, "VIDIOC_S_FREQUENCY: f tuner %d, f type %d\n",
f->tuner, f->type);
if (UNSET == dev->tuner_type)
return -EINVAL;
if (f->tuner != 0)
return -EINVAL;
if (f->type != V4L2_TUNER_ANALOG_TV)
return -EINVAL;
dev->freq = f->frequency;

call_all(dev, tuner, s_frequency, f);
return cx23885_set_frequency(file, priv, f);
}

cx23885_initialize_codec(dev, 0);
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctl)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;

return 0;
return cx23885_get_control(dev, ctl);
}

static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctl)
struct v4l2_control *ctl)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;

/* Update the A/V core */
call_all(dev, core, s_ctrl, ctl);
return 0;
return cx23885_set_control(dev, ctl);
}

static int vidioc_querycap(struct file *file, void *priv,
Expand Down Expand Up @@ -1693,6 +1661,8 @@ static struct v4l2_file_operations mpeg_fops = {
};

static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
.vidioc_querystd = vidioc_g_std,
.vidioc_g_std = vidioc_g_std,
.vidioc_s_std = vidioc_s_std,
.vidioc_enum_input = vidioc_enum_input,
.vidioc_g_input = vidioc_g_input,
Expand All @@ -1702,6 +1672,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
.vidioc_g_frequency = vidioc_g_frequency,
.vidioc_s_frequency = vidioc_s_frequency,
.vidioc_s_ctrl = vidioc_s_ctrl,
.vidioc_g_ctrl = vidioc_g_ctrl,
.vidioc_querycap = vidioc_querycap,
.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
.vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
Expand Down

0 comments on commit 6d5abc6

Please sign in to comment.