aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-02-06 16:33:43 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:39 -0400
commitdcc0ef88209a26719241bcb7741f05f1b9ecc30e (patch)
tree2c1f352821c648c42b775b7fff5cf86366a0e2ba /drivers/media/video/cx18/cx18-ioctl.c
parentc1994084d6ad7d1a411219727fc135a18c40f9c8 (diff)
V4L/DVB (10442): cx18: Fixes for enforcing when Encoder Raw VBI params can be set
The Encoder will only allow the Raw VBI parameters, along with a number of other API parameters, to take effect when no analog captures are in progress. These parameters must be set before the first analog capture starts, be it MPEG, VBI, YUV, etc., and cannot be changed until the last one stops. It is not obvious to me what capture channel API parameters are shared and which ones must be set per capture channel, so set them all for every analog capture channel start up. This fixes the driver so that VBI capture can be started up after the MPEG capture is going. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index a454ede568a5..0f0cd560226c 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -42,13 +42,6 @@
42#include <media/v4l2-chip-ident.h> 42#include <media/v4l2-chip-ident.h>
43#include <linux/i2c-id.h> 43#include <linux/i2c-id.h>
44 44
45static int cx18_vbi_streaming(struct cx18 *cx)
46{
47 struct cx18_stream *s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI];
48 return (s_vbi->handle != CX18_INVALID_TASK_HANDLE) &&
49 test_bit(CX18_F_S_STREAMING, &s_vbi->s_flags);
50}
51
52u16 cx18_service2vbi(int type) 45u16 cx18_service2vbi(int type)
53{ 46{
54 switch (type) { 47 switch (type) {
@@ -312,7 +305,11 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
312 if (ret) 305 if (ret)
313 return ret; 306 return ret;
314 307
315 if (!cx18_raw_vbi(cx) && cx18_vbi_streaming(cx)) 308 /*
309 * Changing the Encoder's Raw VBI parameters won't have any effect
310 * if any analog capture is ongoing
311 */
312 if (!cx18_raw_vbi(cx) && atomic_read(&cx->ana_capturing) > 0)
316 return -EBUSY; 313 return -EBUSY;
317 314
318 /* 315 /*
@@ -345,8 +342,13 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
345 342
346 cx18_try_fmt_sliced_vbi_cap(file, fh, fmt); 343 cx18_try_fmt_sliced_vbi_cap(file, fh, fmt);
347 344
348 if (cx18_raw_vbi(cx) && cx18_vbi_streaming(cx)) 345 /*
346 * Changing the Encoder's Raw VBI parameters won't have any effect
347 * if any analog capture is ongoing
348 */
349 if (cx18_raw_vbi(cx) && atomic_read(&cx->ana_capturing) > 0)
349 return -EBUSY; 350 return -EBUSY;
351
350 /* 352 /*
351 * Set the service_lines requested in the digitizer/slicer registers. 353 * Set the service_lines requested in the digitizer/slicer registers.
352 * Note, cx18_av_vbi() wipes some "impossible" service lines in the 354 * Note, cx18_av_vbi() wipes some "impossible" service lines in the