summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-01-22 23:31:53 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 13:34:54 -0200
commitdbbff48f39263f7e5c96a55624da87879de2bf71 (patch)
tree8baff62c9a7235bc1578952907f5ae6f271afe41 /drivers/media/video/cx88/cx88-video.c
parent758117c25b65ed5fa502c13f3cdf040a8f954161 (diff)
downloadop-kernel-dev-dbbff48f39263f7e5c96a55624da87879de2bf71.zip
op-kernel-dev-dbbff48f39263f7e5c96a55624da87879de2bf71.tar.gz
V4L/DVB (5144): Restore VIDIOC_INT_[SG]_REGISTER calls
Add support for these ioctls to the video_ioctl2 system and the cx88 driver. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 360046e..ee8cbd3 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1385,6 +1385,32 @@ static int vidioc_s_frequency (struct file *file, void *priv,
cx88_set_freq (core,f);
}
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int vidioc_g_register (struct file *file, void *fh,
+ struct v4l2_register *reg)
+{
+ struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
+
+ if (reg->i2c_id != 0)
+ return -EINVAL;
+ /* cx2388x has a 24-bit register space */
+ reg->val = cx_read(reg->reg&0xffffff);
+ return 0;
+}
+
+static int vidioc_s_register (struct file *file, void *fh,
+ struct v4l2_register *reg)
+{
+ struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
+
+ if (reg->i2c_id != 0)
+ return -EINVAL;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ cx_write(reg->reg&0xffffff, reg->val);
+ return 0;
+}
+#endif
/* ----------------------------------------------------------- */
/* RADIO ESPECIFIC IOCTLS */
@@ -1656,8 +1682,12 @@ static struct video_device cx8800_video_template =
.vidioc_s_tuner = vidioc_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency,
.vidioc_s_frequency = vidioc_s_frequency,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+ .vidioc_g_register = vidioc_g_register,
+ .vidioc_s_register = vidioc_s_register,
+#endif
.tvnorms = CX88_NORMS,
- .current_norm = V4L2_STD_NTSC_M,
+ .current_norm = V4L2_STD_NTSC_M,
};
static const struct file_operations radio_fops =
OpenPOWER on IntegriCloud