diff options
author | Andy Walls <awalls@radix.net> | 2009-09-26 21:50:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:16 -0500 |
commit | 74618244003a5a9e11240af8c5795ae747d9a2e0 (patch) | |
tree | 20021195d0e5b841808e4e5dfb6b1d40c16f3f9e /drivers/media/video/cx23885/cx23885-video.c | |
parent | f56db93cef5d368b4fa5db49b68bc4ab0b20c4fd (diff) |
V4L/DVB (13085): cx23885: Fix support for v4l2-dbg access to CX2388[578] and CX23417 regs
This changes corrects the ioctl() operations for both the CX2388[578] analog
video and MPEG video device nodes to properly and consistently support
VIDIOC_G_CHIP_IDENT, VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER ioctl()s.
This caused some ioctl() support routines to be broken out into a separate
source file.
Now v4l2-dbg can be used to manipulate CX2388[578] and CX23417 registers
including the CX2388[57] functions handled by the cx25840 module.
This was done in anticipation of developing a new v4l2_subdev for the
integrated IR controller of the CX23888.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-video.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 654cc253cd50..3f1d07e6490a 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "cx23885.h" | 35 | #include "cx23885.h" |
36 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
37 | #include <media/v4l2-ioctl.h> | 37 | #include <media/v4l2-ioctl.h> |
38 | #include "cx23885-ioctl.h" | ||
38 | 39 | ||
39 | MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards"); | 40 | MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards"); |
40 | MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>"); | 41 | MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>"); |
@@ -1312,34 +1313,6 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
1312 | cx23885_set_freq(dev, f); | 1313 | cx23885_set_freq(dev, f); |
1313 | } | 1314 | } |
1314 | 1315 | ||
1315 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
1316 | static int vidioc_g_register(struct file *file, void *fh, | ||
1317 | struct v4l2_dbg_register *reg) | ||
1318 | { | ||
1319 | struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; | ||
1320 | |||
1321 | if (!v4l2_chip_match_host(®->match)) | ||
1322 | return -EINVAL; | ||
1323 | |||
1324 | call_all(dev, core, g_register, reg); | ||
1325 | |||
1326 | return 0; | ||
1327 | } | ||
1328 | |||
1329 | static int vidioc_s_register(struct file *file, void *fh, | ||
1330 | struct v4l2_dbg_register *reg) | ||
1331 | { | ||
1332 | struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; | ||
1333 | |||
1334 | if (!v4l2_chip_match_host(®->match)) | ||
1335 | return -EINVAL; | ||
1336 | |||
1337 | call_all(dev, core, s_register, reg); | ||
1338 | |||
1339 | return 0; | ||
1340 | } | ||
1341 | #endif | ||
1342 | |||
1343 | /* ----------------------------------------------------------- */ | 1316 | /* ----------------------------------------------------------- */ |
1344 | 1317 | ||
1345 | static void cx23885_vid_timeout(unsigned long data) | 1318 | static void cx23885_vid_timeout(unsigned long data) |
@@ -1449,9 +1422,10 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { | |||
1449 | .vidioc_s_tuner = vidioc_s_tuner, | 1422 | .vidioc_s_tuner = vidioc_s_tuner, |
1450 | .vidioc_g_frequency = vidioc_g_frequency, | 1423 | .vidioc_g_frequency = vidioc_g_frequency, |
1451 | .vidioc_s_frequency = vidioc_s_frequency, | 1424 | .vidioc_s_frequency = vidioc_s_frequency, |
1425 | .vidioc_g_chip_ident = cx23885_g_chip_ident, | ||
1452 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1426 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1453 | .vidioc_g_register = vidioc_g_register, | 1427 | .vidioc_g_register = cx23885_g_register, |
1454 | .vidioc_s_register = vidioc_s_register, | 1428 | .vidioc_s_register = cx23885_s_register, |
1455 | #endif | 1429 | #endif |
1456 | }; | 1430 | }; |
1457 | 1431 | ||