diff options
-rw-r--r-- | drivers/media/video/cx18/cx18-controls.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-mailbox.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-mailbox.h | 7 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-streams.c | 6 |
4 files changed, 19 insertions, 4 deletions
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c index f46c7e5ed747..17edf305d649 100644 --- a/drivers/media/video/cx18/cx18-controls.c +++ b/drivers/media/video/cx18/cx18-controls.c | |||
@@ -259,6 +259,7 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) | |||
259 | return err; | 259 | return err; |
260 | } | 260 | } |
261 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) { | 261 | if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) { |
262 | struct cx18_api_func_private priv; | ||
262 | struct cx2341x_mpeg_params p = cx->params; | 263 | struct cx2341x_mpeg_params p = cx->params; |
263 | int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing), | 264 | int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing), |
264 | c, VIDIOC_S_EXT_CTRLS); | 265 | c, VIDIOC_S_EXT_CTRLS); |
@@ -278,7 +279,9 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c) | |||
278 | fmt.fmt.pix.height = cx->params.height; | 279 | fmt.fmt.pix.height = cx->params.height; |
279 | cx18_av_cmd(cx, VIDIOC_S_FMT, &fmt); | 280 | cx18_av_cmd(cx, VIDIOC_S_FMT, &fmt); |
280 | } | 281 | } |
281 | err = cx2341x_update(cx, cx18_api_func, &cx->params, &p); | 282 | priv.cx = cx; |
283 | priv.s = &cx->streams[id->type]; | ||
284 | err = cx2341x_update(&priv, cx18_api_func, &cx->params, &p); | ||
282 | if (!err && cx->params.stream_vbi_fmt != p.stream_vbi_fmt) | 285 | if (!err && cx->params.stream_vbi_fmt != p.stream_vbi_fmt) |
283 | err = cx18_setup_vbi_fmt(cx, p.stream_vbi_fmt); | 286 | err = cx18_setup_vbi_fmt(cx, p.stream_vbi_fmt); |
284 | cx->params = p; | 287 | cx->params = p; |
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c index ca8d5f4b731a..d62351466e26 100644 --- a/drivers/media/video/cx18/cx18-mailbox.c +++ b/drivers/media/video/cx18/cx18-mailbox.c | |||
@@ -606,8 +606,9 @@ static int cx18_set_filter_param(struct cx18_stream *s) | |||
606 | int cx18_api_func(void *priv, u32 cmd, int in, int out, | 606 | int cx18_api_func(void *priv, u32 cmd, int in, int out, |
607 | u32 data[CX2341X_MBOX_MAX_DATA]) | 607 | u32 data[CX2341X_MBOX_MAX_DATA]) |
608 | { | 608 | { |
609 | struct cx18 *cx = priv; | 609 | struct cx18_api_func_private *api_priv = priv; |
610 | struct cx18_stream *s = &cx->streams[CX18_ENC_STREAM_TYPE_MPG]; | 610 | struct cx18 *cx = api_priv->cx; |
611 | struct cx18_stream *s = api_priv->s; | ||
611 | 612 | ||
612 | switch (cmd) { | 613 | switch (cmd) { |
613 | case CX2341X_ENC_SET_OUTPUT_PORT: | 614 | case CX2341X_ENC_SET_OUTPUT_PORT: |
diff --git a/drivers/media/video/cx18/cx18-mailbox.h b/drivers/media/video/cx18/cx18-mailbox.h index 33d5a0e7080b..ce2b6686aa00 100644 --- a/drivers/media/video/cx18/cx18-mailbox.h +++ b/drivers/media/video/cx18/cx18-mailbox.h | |||
@@ -79,6 +79,13 @@ struct cx18_mailbox { | |||
79 | u32 error; | 79 | u32 error; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct cx18_stream; | ||
83 | |||
84 | struct cx18_api_func_private { | ||
85 | struct cx18 *cx; | ||
86 | struct cx18_stream *s; | ||
87 | }; | ||
88 | |||
82 | int cx18_api(struct cx18 *cx, u32 cmd, int args, u32 data[]); | 89 | int cx18_api(struct cx18 *cx, u32 cmd, int args, u32 data[]); |
83 | int cx18_vapi_result(struct cx18 *cx, u32 data[MAX_MB_ARGUMENTS], u32 cmd, | 90 | int cx18_vapi_result(struct cx18 *cx, u32 data[MAX_MB_ARGUMENTS], u32 cmd, |
84 | int args, ...); | 91 | int args, ...); |
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c index 600a5fcac3d0..63c336c95ff5 100644 --- a/drivers/media/video/cx18/cx18-streams.c +++ b/drivers/media/video/cx18/cx18-streams.c | |||
@@ -494,6 +494,8 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s) | |||
494 | cx18_vapi(cx, CX18_CPU_SET_CHANNEL_TYPE, 2, s->handle, captype); | 494 | cx18_vapi(cx, CX18_CPU_SET_CHANNEL_TYPE, 2, s->handle, captype); |
495 | 495 | ||
496 | if (atomic_read(&cx->ana_capturing) == 0 && !ts) { | 496 | if (atomic_read(&cx->ana_capturing) == 0 && !ts) { |
497 | struct cx18_api_func_private priv; | ||
498 | |||
497 | /* Stuff from Windows, we don't know what it is */ | 499 | /* Stuff from Windows, we don't know what it is */ |
498 | cx18_vapi(cx, CX18_CPU_SET_VER_CROP_LINE, 2, s->handle, 0); | 500 | cx18_vapi(cx, CX18_CPU_SET_VER_CROP_LINE, 2, s->handle, 0); |
499 | cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 3, s->handle, 3, 1); | 501 | cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 3, s->handle, 3, 1); |
@@ -513,7 +515,9 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s) | |||
513 | cx18_vapi_result(cx, data, CX18_CPU_SET_INDEXTABLE, 1, 0); | 515 | cx18_vapi_result(cx, data, CX18_CPU_SET_INDEXTABLE, 1, 0); |
514 | 516 | ||
515 | /* Setup API for Stream */ | 517 | /* Setup API for Stream */ |
516 | cx2341x_update(cx, cx18_api_func, NULL, &cx->params); | 518 | priv.cx = cx; |
519 | priv.s = s; | ||
520 | cx2341x_update(&priv, cx18_api_func, NULL, &cx->params); | ||
517 | } | 521 | } |
518 | 522 | ||
519 | if (atomic_read(&cx->tot_capturing) == 0) { | 523 | if (atomic_read(&cx->tot_capturing) == 0) { |