summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c198
1 files changed, 92 insertions, 106 deletions
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)