aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
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