summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/saa7134')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-core.c4
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-empress.c293
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c198
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h13
4 files changed, 275 insertions, 233 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c
index 74b881864..002422380 100644
--- a/linux/drivers/media/video/saa7134/saa7134-core.c
+++ b/linux/drivers/media/video/saa7134/saa7134-core.c
@@ -1149,7 +1149,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
dev->name,dev->video_dev->minor & 0x1f);
- dev->vbi_dev = vdev_init(dev,&saa7134_vbi_template,"vbi");
+ dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
+ dev->vbi_dev->type = VID_TYPE_TUNER | VID_TYPE_TELETEXT;
+
err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
vbi_nr[dev->nr]);
if (err < 0)
diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c
index 5fe8f5320..b406aabef 100644
--- a/linux/drivers/media/video/saa7134/saa7134-empress.c
+++ b/linux/drivers/media/video/saa7134/saa7134-empress.c
@@ -170,152 +170,176 @@ ts_mmap(struct file *file, struct vm_area_struct * vma)
* video_generic_ioctl (and maybe others). userspace
* copying is done already, arg is a kernel pointer.
*/
-static int ts_do_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+
+static int empress_querycap(struct file *file, void *priv,
+ struct v4l2_capability *cap)
{
- struct saa7134_dev *dev = file->private_data;
- struct v4l2_ext_controls *ctrls = arg;
-
- if (debug > 1)
- v4l_print_ioctl(dev->name,cmd);
- switch (cmd) {
- case VIDIOC_QUERYCAP:
- {
- struct v4l2_capability *cap = arg;
-
- memset(cap,0,sizeof(*cap));
- strcpy(cap->driver, "saa7134");
- strlcpy(cap->card, saa7134_boards[dev->board].name,
- sizeof(cap->card));
- sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci));
- cap->version = SAA7134_VERSION_CODE;
- cap->capabilities =
- V4L2_CAP_VIDEO_CAPTURE |
- V4L2_CAP_READWRITE |
- V4L2_CAP_STREAMING;
- return 0;
- }
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ strcpy(cap->driver, "saa7134");
+ strlcpy(cap->card, saa7134_boards[dev->board].name,
+ sizeof(cap->card));
+ sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
+ cap->version = SAA7134_VERSION_CODE;
+ cap->capabilities =
+ V4L2_CAP_VIDEO_CAPTURE |
+ V4L2_CAP_READWRITE |
+ V4L2_CAP_STREAMING;
+ return 0;
+}
- /* --- input switching --------------------------------------- */
- case VIDIOC_ENUMINPUT:
- {
- struct v4l2_input *i = arg;
+static int empress_enum_input(struct file *file, void *priv,
+ struct v4l2_input *i)
+{
+ if (i->index != 0)
+ return -EINVAL;
- if (i->index != 0)
- return -EINVAL;
- i->type = V4L2_INPUT_TYPE_CAMERA;
- strcpy(i->name,"CCIR656");
- return 0;
- }
- case VIDIOC_G_INPUT:
- {
- int *i = arg;
- *i = 0;
- return 0;
- }
- case VIDIOC_S_INPUT:
- {
- int *i = arg;
+ i->type = V4L2_INPUT_TYPE_CAMERA;
+ strcpy(i->name, "CCIR656");
- if (*i != 0)
- return -EINVAL;
- return 0;
- }
- /* --- capture ioctls ---------------------------------------- */
-
- case VIDIOC_ENUM_FMT:
- {
- struct v4l2_fmtdesc *f = arg;
- int index;
-
- index = f->index;
- if (index != 0)
- return -EINVAL;
-
- memset(f,0,sizeof(*f));
- f->index = index;
- strlcpy(f->description, "MPEG TS", sizeof(f->description));
- f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- f->pixelformat = V4L2_PIX_FMT_MPEG;
- return 0;
- }
+ return 0;
+}
- case VIDIOC_G_FMT:
- {
- struct v4l2_format *f = arg;
+static int empress_g_input(struct file *file, void *priv, unsigned int *i)
+{
+ *i = 0;
+ return 0;
+}
- memset(f,0,sizeof(*f));
- f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+static int empress_s_input(struct file *file, void *priv, unsigned int i)
+{
+ if (i != 0)
+ return -EINVAL;
- saa7134_i2c_call_clients(dev, cmd, arg);
- f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
- f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
- return 0;
- }
+ return 0;
+}
- case VIDIOC_S_FMT:
- {
- struct v4l2_format *f = arg;
+static int empress_enum_fmt_cap(struct file *file, void *priv,
+ struct v4l2_fmtdesc *f)
+{
+ if (f->index != 0)
+ return -EINVAL;
- if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
- return -EINVAL;
+ strlcpy(f->description, "MPEG TS", sizeof(f->description));
+ f->pixelformat = V4L2_PIX_FMT_MPEG;
- saa7134_i2c_call_clients(dev, cmd, arg);
- f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
- f->fmt.pix.sizeimage = TS_PACKET_SIZE* dev->ts.nr_packets;
- return 0;
- }
+ return 0;
+}
- case VIDIOC_REQBUFS:
- return videobuf_reqbufs(&dev->empress_tsq,arg);
+static int empress_g_fmt_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
- case VIDIOC_QUERYBUF:
- return videobuf_querybuf(&dev->empress_tsq,arg);
+ saa7134_i2c_call_clients(dev, VIDIOC_G_FMT, f);
- case VIDIOC_QBUF:
- return videobuf_qbuf(&dev->empress_tsq,arg);
+ f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
+ f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
- case VIDIOC_DQBUF:
- return videobuf_dqbuf(&dev->empress_tsq,arg,
- file->f_flags & O_NONBLOCK);
+ return 0;
+}
- case VIDIOC_STREAMON:
- return videobuf_streamon(&dev->empress_tsq);
+static int empress_s_fmt_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
- case VIDIOC_STREAMOFF:
- return videobuf_streamoff(&dev->empress_tsq);
+ saa7134_i2c_call_clients(dev, VIDIOC_S_FMT, f);
- case VIDIOC_QUERYCTRL:
- case VIDIOC_G_CTRL:
- case VIDIOC_S_CTRL:
- return saa7134_common_ioctl(dev, cmd, arg);
+ f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
+ f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
- case VIDIOC_S_EXT_CTRLS:
- /* count == 0 is abused in saa6752hs.c, so that special
- case is handled here explicitly. */
- if (ctrls->count == 0)
- return 0;
- if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
- return -EINVAL;
- saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, arg);
- ts_init_encoder(dev);
- return 0;
- case VIDIOC_G_EXT_CTRLS:
- if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
- return -EINVAL;
- saa7134_i2c_call_clients(dev, VIDIOC_G_EXT_CTRLS, arg);
+ return 0;
+}
+
+
+static int empress_reqbufs(struct file *file, void *priv,
+ struct v4l2_requestbuffers *p)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ return videobuf_reqbufs(&dev->empress_tsq, p);
+}
+
+static int empress_querybuf(struct file *file, void *priv,
+ struct v4l2_buffer *b)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ return videobuf_querybuf(&dev->empress_tsq, b);
+}
+
+static int empress_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ return videobuf_qbuf(&dev->empress_tsq, b);
+}
+
+static int empress_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ return videobuf_dqbuf(&dev->empress_tsq, b,
+ file->f_flags & O_NONBLOCK);
+}
+
+static int empress_streamon(struct file *file, void *priv,
+ enum v4l2_buf_type type)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ return videobuf_streamon(&dev->empress_tsq);
+}
+
+static int empress_streamoff(struct file *file, void *priv,
+ enum v4l2_buf_type type)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ return videobuf_streamoff(&dev->empress_tsq);
+}
+
+static int empress_s_ext_ctrls(struct file *file, void *priv,
+ struct v4l2_ext_controls *ctrls)
+{
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ /* count == 0 is abused in saa6752hs.c, so that special
+ case is handled here explicitly. */
+ if (ctrls->count == 0)
return 0;
- default:
- return -ENOIOCTLCMD;
- }
+ if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
+ return -EINVAL;
+
+ saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, ctrls);
+ ts_init_encoder(dev);
+
return 0;
}
-static int ts_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static int empress_g_ext_ctrls(struct file *file, void *priv,
+ struct v4l2_ext_controls *ctrls)
{
- return video_usercopy(inode, file, cmd, arg, ts_do_ioctl);
+ struct saa7134_fh *fh = priv;
+ struct saa7134_dev *dev = fh->dev;
+
+ if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
+ return -EINVAL;
+ saa7134_i2c_call_clients(dev, VIDIOC_G_EXT_CTRLS, ctrls);
+
+ return 0;
}
static const struct file_operations ts_fops =
@@ -326,7 +350,7 @@ static const struct file_operations ts_fops =
.read = ts_read,
.poll = ts_poll,
.mmap = ts_mmap,
- .ioctl = ts_ioctl,
+ .ioctl = video_ioctl2,
.llseek = no_llseek,
};
@@ -339,6 +363,29 @@ static struct video_device saa7134_empress_template =
.type2 = 0 /* FIXME */,
.fops = &ts_fops,
.minor = -1,
+
+ .vidioc_querycap = empress_querycap,
+ .vidioc_enum_fmt_cap = empress_enum_fmt_cap,
+ .vidioc_s_fmt_cap = empress_s_fmt_cap,
+ .vidioc_g_fmt_cap = empress_g_fmt_cap,
+ .vidioc_reqbufs = empress_reqbufs,
+ .vidioc_querybuf = empress_querybuf,
+ .vidioc_qbuf = empress_qbuf,
+ .vidioc_dqbuf = empress_dqbuf,
+ .vidioc_streamon = empress_streamon,
+ .vidioc_streamoff = empress_streamoff,
+ .vidioc_s_ext_ctrls = empress_s_ext_ctrls,
+ .vidioc_g_ext_ctrls = empress_g_ext_ctrls,
+ .vidioc_enum_input = empress_enum_input,
+ .vidioc_g_input = empress_g_input,
+ .vidioc_s_input = empress_s_input,
+
+ .vidioc_queryctrl = saa7134_queryctrl,
+ .vidioc_g_ctrl = saa7134_g_ctrl,
+ .vidioc_s_ctrl = saa7134_s_ctrl,
+
+ .tvnorms = SAA7134_NORMS,
+ .current_norm = V4L2_STD_PAL,
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c
index 7d04a24e0..f71def0fa 100644
--- a/linux/drivers/media/video/saa7134/saa7134-video.c
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c
@@ -217,12 +217,6 @@ static struct saa7134_format formats[] = {
.vbi_v_start_1 = 273, \
.src_timing = 7
-#define SAA7134_NORMS \
- V4L2_STD_PAL | V4L2_STD_PAL_N | \
- V4L2_STD_PAL_Nc | V4L2_STD_SECAM | \
- V4L2_STD_NTSC | V4L2_STD_PAL_M | \
- V4L2_STD_PAL_60
-
static struct saa7134_tvnorm tvnorms[] = {
{
.name = "PAL", /* autodetect */
@@ -1123,8 +1117,7 @@ static struct videobuf_queue_ops video_qops = {
/* ------------------------------------------------------------------ */
-static int vidioc_g_ctrl(struct file *file, void *priv,
- struct v4l2_control *c)
+int saa7134_g_ctrl(struct file *file, void *priv, struct v4l2_control *c)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
@@ -1172,9 +1165,9 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
}
return 0;
}
+EXPORT_SYMBOL_GPL(saa7134_g_ctrl);
-static int vidioc_s_ctrl(struct file *file, void *f,
- struct v4l2_control *c)
+int saa7134_s_ctrl(struct file *file, void *f, struct v4l2_control *c)
{
const struct v4l2_queryctrl* ctrl;
struct saa7134_fh *fh = f;
@@ -1286,6 +1279,7 @@ error:
mutex_unlock(&dev->lock);
return err;
}
+EXPORT_SYMBOL_GPL(saa7134_s_ctrl);
/* ------------------------------------------------------------------ */
@@ -1507,7 +1501,7 @@ static int video_mmap(struct file *file, struct vm_area_struct * vma)
/* ------------------------------------------------------------------ */
-static int vidioc_try_get_set_fmt_vbi(struct file *file, void *priv,
+static int saa7134_try_get_set_fmt_vbi(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
@@ -1534,7 +1528,7 @@ static int vidioc_try_get_set_fmt_vbi(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_fmt_cap(struct file *file, void *priv,
+static int saa7134_g_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
@@ -1550,7 +1544,7 @@ static int vidioc_g_fmt_cap(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_fmt_overlay(struct file *file, void *priv,
+static int saa7134_g_fmt_overlay(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
@@ -1564,7 +1558,7 @@ static int vidioc_g_fmt_overlay(struct file *file, void *priv,
return 0;
}
-static int vidioc_try_fmt_cap(struct file *file, void *priv,
+static int saa7134_try_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
@@ -1615,7 +1609,7 @@ static int vidioc_try_fmt_cap(struct file *file, void *priv,
return 0;
}
-static int vidioc_try_fmt_overlay(struct file *file, void *priv,
+static int saa7134_try_fmt_overlay(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
@@ -1629,13 +1623,13 @@ static int vidioc_try_fmt_overlay(struct file *file, void *priv,
return verify_preview(dev, &f->fmt.win);
}
-static int vidioc_s_fmt_cap(struct file *file, void *priv,
+static int saa7134_s_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
int err;
- err = vidioc_try_fmt_cap(file, priv, f);
+ err = saa7134_try_fmt_cap(file, priv, f);
if (0 != err)
return err;
@@ -1646,7 +1640,7 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv,
return 0;
}
-static int vidioc_s_fmt_overlay(struct file *file, void *priv,
+static int saa7134_s_fmt_overlay(struct file *file, void *priv,
struct v4l2_format *f)
{
struct saa7134_fh *fh = priv;
@@ -1687,8 +1681,7 @@ static int vidioc_s_fmt_overlay(struct file *file, void *priv,
return 0;
}
-static int vidioc_queryctrl(struct file *file, void *priv,
- struct v4l2_queryctrl *c)
+int saa7134_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c)
{
const struct v4l2_queryctrl *ctrl;
@@ -1701,8 +1694,9 @@ static int vidioc_queryctrl(struct file *file, void *priv,
*c = (NULL != ctrl) ? *ctrl : no_ctrl;
return 0;
}
+EXPORT_SYMBOL_GPL(saa7134_queryctrl);
-static int vidioc_enum_input(struct file *file, void *priv,
+static int saa7134_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
{
struct saa7134_fh *fh = priv;
@@ -1736,7 +1730,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
+static int saa7134_g_input(struct file *file, void *priv, unsigned int *i)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
@@ -1745,7 +1739,7 @@ static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
return 0;
}
-static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
+static int saa7134_s_input(struct file *file, void *priv, unsigned int i)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
@@ -1765,7 +1759,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
return 0;
}
-static int vidioc_querycap(struct file *file, void *priv,
+static int saa7134_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct saa7134_fh *fh = priv;
@@ -1792,7 +1786,7 @@ static int vidioc_querycap(struct file *file, void *priv,
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * id)
+static int saa7134_s_std(struct file *file, void *priv, v4l2_std_id *id)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
@@ -1854,7 +1848,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * id)
return 0;
}
-static int vidioc_cropcap(struct file *file, void *priv,
+static int saa7134_cropcap(struct file *file, void *priv,
struct v4l2_cropcap *cap)
{
struct saa7134_fh *fh = priv;
@@ -1878,7 +1872,7 @@ static int vidioc_cropcap(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_crop(struct file *file, void *f, struct v4l2_crop *crop)
+static int saa7134_g_crop(struct file *file, void *f, struct v4l2_crop *crop)
{
struct saa7134_fh *fh = f;
struct saa7134_dev *dev = fh->dev;
@@ -1890,7 +1884,7 @@ static int vidioc_g_crop(struct file *file, void *f, struct v4l2_crop *crop)
return 0;
}
-static int vidioc_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
+static int saa7134_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
{
struct saa7134_fh *fh = f;
struct saa7134_dev *dev = fh->dev;
@@ -1927,7 +1921,7 @@ static int vidioc_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
return 0;
}
-static int vidioc_g_tuner(struct file *file, void *priv,
+static int saa7134_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
{
struct saa7134_fh *fh = priv;
@@ -1956,7 +1950,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
return 0;
}
-static int vidioc_s_tuner(struct file *file, void *priv,
+static int saa7134_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
{
struct saa7134_fh *fh = priv;
@@ -1978,7 +1972,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_frequency(struct file *file, void *priv,
+static int saa7134_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct saa7134_fh *fh = priv;
@@ -1990,7 +1984,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
return 0;
}
-static int vidioc_s_frequency(struct file *file, void *priv,
+static int saa7134_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct saa7134_fh *fh = priv;
@@ -2017,18 +2011,18 @@ static int vidioc_s_frequency(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
+static int saa7134_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
{
strcpy(a->name, "audio");
return 0;
}
-static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
+static int saa7134_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
{
return 0;
}
-static int vidioc_g_priority(struct file *file, void *f, enum v4l2_priority *p)
+static int saa7134_g_priority(struct file *file, void *f, enum v4l2_priority *p)
{
struct saa7134_fh *fh = f;
struct saa7134_dev *dev = fh->dev;
@@ -2037,7 +2031,7 @@ static int vidioc_g_priority(struct file *file, void *f, enum v4l2_priority *p)
return 0;
}
-static int vidioc_s_priority(struct file *file, void *f,
+static int saa7134_s_priority(struct file *file, void *f,
enum v4l2_priority prio)
{
struct saa7134_fh *fh = f;
@@ -2046,7 +2040,7 @@ static int vidioc_s_priority(struct file *file, void *f,
return v4l2_prio_change(&dev->prio, &fh->prio, prio);
}
-static int vidioc_enum_fmt_cap(struct file *file, void *priv,
+static int saa7134_enum_fmt_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
if (f->index >= FORMATS)
@@ -2060,7 +2054,7 @@ static int vidioc_enum_fmt_cap(struct file *file, void *priv,
return 0;
}
-static int vidioc_enum_fmt_overlay(struct file *file, void *priv,
+static int saa7134_enum_fmt_overlay(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
if (saa7134_no_overlay > 0) {
@@ -2079,7 +2073,7 @@ static int vidioc_enum_fmt_overlay(struct file *file, void *priv,
return 0;
}
-static int vidioc_enum_fmt_vbi(struct file *file, void *priv,
+static int saa7134_enum_fmt_vbi(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
if (0 != f->index)
@@ -2091,7 +2085,7 @@ static int vidioc_enum_fmt_vbi(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_fbuf(struct file *file, void *f,
+static int saa7134_g_fbuf(struct file *file, void *f,
struct v4l2_framebuffer *fb)
{
struct saa7134_fh *fh = f;
@@ -2103,7 +2097,7 @@ static int vidioc_g_fbuf(struct file *file, void *f,
return 0;
}
-static int vidioc_s_fbuf(struct file *file, void *f,
+static int saa7134_s_fbuf(struct file *file, void *f,
struct v4l2_framebuffer *fb)
{
struct saa7134_fh *fh = f;
@@ -2128,7 +2122,7 @@ static int vidioc_s_fbuf(struct file *file, void *f,
return 0;
}
-static int vidioc_overlay(struct file *file, void *f, unsigned int on)
+static int saa7134_overlay(struct file *file, void *f, unsigned int on)
{
struct saa7134_fh *fh = f;
struct saa7134_dev *dev = fh->dev;
@@ -2165,34 +2159,34 @@ static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
}
#endif
-static int vidioc_reqbufs(struct file *file, void *priv,
+static int saa7134_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{
struct saa7134_fh *fh = priv;
return videobuf_reqbufs(saa7134_queue(fh), p);
}
-static int vidioc_querybuf(struct file *file, void *priv,
+static int saa7134_querybuf(struct file *file, void *priv,
struct v4l2_buffer *b)
{
struct saa7134_fh *fh = priv;
return videobuf_querybuf(saa7134_queue(fh), b);
}
-static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
+static int saa7134_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
{
struct saa7134_fh *fh = priv;
return videobuf_qbuf(saa7134_queue(fh), b);
}
-static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
+static int saa7134_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
{
struct saa7134_fh *fh = priv;
return videobuf_dqbuf(saa7134_queue(fh), b,
file->f_flags & O_NONBLOCK);
}
-static int vidioc_streamon(struct file *file, void *priv,
+static int saa7134_streamon(struct file *file, void *priv,
enum v4l2_buf_type type)
{
struct saa7134_fh *fh = priv;
@@ -2205,7 +2199,7 @@ static int vidioc_streamon(struct file *file, void *priv,
return videobuf_streamon(saa7134_queue(fh));
}
-static int vidioc_streamoff(struct file *file, void *priv,
+static int saa7134_streamoff(struct file *file, void *priv,
enum v4l2_buf_type type)
{
int err;
@@ -2220,7 +2214,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
return 0;
}
-static int vidioc_g_parm(struct file *file, void *fh,
+static int saa7134_g_parm(struct file *file, void *fh,
struct v4l2_streamparm *parm)
{
return 0;
@@ -2369,68 +2363,60 @@ struct video_device saa7134_video_template =
VID_TYPE_CLIPPING|VID_TYPE_SCALES,
.fops = &video_fops,
.minor = -1,
- .vidioc_querycap = vidioc_querycap,
- .vidioc_enum_fmt_cap = vidioc_enum_fmt_cap,
- .vidioc_g_fmt_cap = vidioc_g_fmt_cap,
- .vidioc_try_fmt_cap = vidioc_try_fmt_cap,
- .vidioc_s_fmt_cap = vidioc_s_fmt_cap,
- .vidioc_enum_fmt_overlay = vidioc_enum_fmt_overlay,
- .vidioc_g_fmt_overlay = vidioc_g_fmt_overlay,
- .vidioc_try_fmt_overlay = vidioc_try_fmt_overlay,
- .vidioc_s_fmt_overlay = vidioc_s_fmt_overlay,
- .vidioc_enum_fmt_vbi = vidioc_enum_fmt_vbi,
- .vidioc_g_fmt_vbi = vidioc_try_get_set_fmt_vbi,
- .vidioc_try_fmt_vbi = vidioc_try_get_set_fmt_vbi,
- .vidioc_s_fmt_vbi = vidioc_try_get_set_fmt_vbi,
- .vidioc_g_audio = vidioc_g_audio,
- .vidioc_s_audio = vidioc_s_audio,
- .vidioc_cropcap = vidioc_cropcap,
- .vidioc_reqbufs = vidioc_reqbufs,
- .vidioc_querybuf = vidioc_querybuf,
- .vidioc_qbuf = vidioc_qbuf,
- .vidioc_dqbuf = vidioc_dqbuf,
- .vidioc_s_std = vidioc_s_std,
- .vidioc_enum_input = vidioc_enum_input,
- .vidioc_g_input = vidioc_g_input,
- .vidioc_s_input = vidioc_s_input,
- .vidioc_queryctrl = vidioc_queryctrl,
- .vidioc_g_ctrl = vidioc_g_ctrl,
- .vidioc_s_ctrl = vidioc_s_ctrl,
- .vidioc_streamon = vidioc_streamon,
- .vidioc_streamoff = vidioc_streamoff,
- .vidioc_g_tuner = vidioc_g_tuner,
- .vidioc_s_tuner = vidioc_s_tuner,
+ .vidioc_querycap = saa7134_querycap,
+ .vidioc_enum_fmt_cap = saa7134_enum_fmt_cap,
+ .vidioc_g_fmt_cap = saa7134_g_fmt_cap,
+ .vidioc_try_fmt_cap = saa7134_try_fmt_cap,
+ .vidioc_s_fmt_cap = saa7134_s_fmt_cap,
+ .vidioc_enum_fmt_overlay = saa7134_enum_fmt_overlay,
+ .vidioc_g_fmt_overlay = saa7134_g_fmt_overlay,
+ .vidioc_try_fmt_overlay = saa7134_try_fmt_overlay,
+ .vidioc_s_fmt_overlay = saa7134_s_fmt_overlay,
+ .vidioc_enum_fmt_vbi = saa7134_enum_fmt_vbi,
+ .vidioc_g_fmt_vbi = saa7134_try_get_set_fmt_vbi,
+ .vidioc_try_fmt_vbi = saa7134_try_get_set_fmt_vbi,
+ .vidioc_s_fmt_vbi = saa7134_try_get_set_fmt_vbi,
+ .vidioc_g_audio = saa7134_g_audio,
+ .vidioc_s_audio = saa7134_s_audio,
+ .vidioc_cropcap = saa7134_cropcap,
+ .vidioc_reqbufs = saa7134_reqbufs,
+ .vidioc_querybuf = saa7134_querybuf,
+ .vidioc_qbuf = saa7134_qbuf,
+ .vidioc_dqbuf = saa7134_dqbuf,
+ .vidioc_s_std = saa7134_s_std,
+ .vidioc_enum_input = saa7134_enum_input,
+ .vidioc_g_input = saa7134_g_input,
+ .vidioc_s_input = saa7134_s_input,
+ .vidioc_queryctrl = saa7134_queryctrl,
+ .vidioc_g_ctrl = saa7134_g_ctrl,
+ .vidioc_s_ctrl = saa7134_s_ctrl,
+ .vidioc_streamon = saa7134_streamon,
+ .vidioc_streamoff = saa7134_streamoff,
+ .vidioc_g_tuner = saa7134_g_tuner,
+ .vidioc_s_tuner = saa7134_s_tuner,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
- .vidioc_g_crop = vidioc_g_crop,
- .vidioc_s_crop = vidioc_s_crop,
- .vidioc_g_fbuf = vidioc_g_fbuf,
- .vidioc_s_fbuf = vidioc_s_fbuf,
- .vidioc_overlay = vidioc_overlay,
- .vidioc_g_priority = vidioc_g_priority,
- .vidioc_s_priority = vidioc_s_priority,
- .vidioc_g_parm = vidioc_g_parm,
- .vidioc_g_frequency = vidioc_g_frequency,
- .vidioc_s_frequency = vidioc_s_frequency,
+ .vidioc_g_crop = saa7134_g_crop,
+ .vidioc_s_crop = saa7134_s_crop,
+ .vidioc_g_fbuf = saa7134_g_fbuf,
+ .vidioc_s_fbuf = saa7134_s_fbuf,
+ .vidioc_overlay = saa7134_overlay,
+ .vidioc_g_priority = saa7134_g_priority,
+ .vidioc_s_priority = saa7134_s_priority,
+ .vidioc_g_parm = saa7134_g_parm,
+ .vidioc_g_frequency = saa7134_g_frequency,
+ .vidioc_s_frequency = saa7134_s_frequency,
.tvnorms = SAA7134_NORMS,
.current_norm = V4L2_STD_PAL,
};
-struct video_device saa7134_vbi_template =
-{
- .name = "saa7134-vbi",
- .type = VID_TYPE_TUNER|VID_TYPE_TELETEXT,
- .fops = &video_fops,
- .minor = -1,
-};
-
struct video_device saa7134_radio_template =
{
- .name = "saa7134-radio",
- .type = VID_TYPE_TUNER,
- .fops = &radio_fops,
- .minor = -1,
+ .name = "saa7134-radio",
+ .type = VID_TYPE_TUNER,
+ .fops = &radio_fops,
+ .minor = -1,
.vidioc_querycap = radio_querycap,
.vidioc_g_tuner = radio_g_tuner,
.vidioc_enum_input = radio_enum_input,
@@ -2441,10 +2427,10 @@ struct video_device saa7134_radio_template =
.vidioc_s_std = radio_s_std,
.vidioc_queryctrl = radio_queryctrl,
.vidioc_g_input = radio_g_input,
- .vidioc_g_ctrl = vidioc_g_ctrl,
- .vidioc_s_ctrl = vidioc_s_ctrl,
- .vidioc_g_frequency = vidioc_g_frequency,
- .vidioc_s_frequency = vidioc_s_frequency,
+ .vidioc_g_ctrl = saa7134_g_ctrl,
+ .vidioc_s_ctrl = saa7134_s_ctrl,
+ .vidioc_g_frequency = saa7134_g_frequency,
+ .vidioc_s_frequency = saa7134_s_frequency,
};
int saa7134_video_init1(struct saa7134_dev *dev)
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index 336fe002e..a0a59ce12 100644
--- a/linux/drivers/media/video/saa7134/saa7134.h
+++ b/linux/drivers/media/video/saa7134/saa7134.h
@@ -587,6 +587,12 @@ struct saa7134_dev {
#define saa_wait(us) { udelay(us); }
+#define SAA7134_NORMS (\
+ V4L2_STD_PAL | V4L2_STD_PAL_N | \
+ V4L2_STD_PAL_Nc | V4L2_STD_SECAM | \
+ V4L2_STD_NTSC | V4L2_STD_PAL_M | \
+ V4L2_STD_PAL_60)
+
/* ----------------------------------------------------------- */
/* saa7134-core.c */
@@ -650,12 +656,13 @@ extern unsigned int video_debug;
extern struct video_device saa7134_video_template;
extern struct video_device saa7134_radio_template;
+int saa7134_g_ctrl(struct file *file, void *priv, struct v4l2_control *c);
+int saa7134_s_ctrl(struct file *file, void *f, struct v4l2_control *c);
+int saa7134_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c);
+
int saa7134_videoport_init(struct saa7134_dev *dev);
void saa7134_set_tvnorm_hw(struct saa7134_dev *dev);
-int saa7134_common_ioctl(struct saa7134_dev *dev,
- unsigned int cmd, void *arg);
-
int saa7134_video_init1(struct saa7134_dev *dev);
int saa7134_video_init2(struct saa7134_dev *dev);
void saa7134_irq_video_signalchange(struct saa7134_dev *dev);