diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-11 21:03:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-11 21:03:50 -0500 |
commit | e6f1227e8bc8a2ea2d76d09e19c89fa66c2f3a4c (patch) | |
tree | 4f0f965bd2a4a544811190c22cdb9c3dd82d1db2 /drivers | |
parent | 3455229fd6a51978439f9c6256d677b745fad06b (diff) | |
parent | 1249a3a82d08d73ece65ae79e0553cd0f3407a15 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] v4l2-ctrl: Send change events to all fh for auto cluster slave controls
[media] v4l2-event: Don't set sev->fh to NULL on unsubscribe
[media] v4l2-event: Remove pending events from fh event queue when unsubscribing
[media] v4l2-event: Deny subscribing with a type of V4L2_EVENT_ALL
[media] MAINTAINERS: add a maintainer for s5p-mfc driver
[media] v4l: s5p-mfc: fix reported capabilities
[media] media: vb2: reset queued list on REQBUFS(0) call
[media] media: vb2: set buffer length correctly for all buffer types
[media] media: vb2: add a check for uninitialized buffer
[media] mxl111sf: fix build warning
[media] mxl111sf: remove pointless if condition in mxl111sf_config_spi
[media] mxl111sf: check for errors after mxl111sf_write_reg in mxl111sf_idac_config
[media] mxl111sf: fix return value of mxl111sf_idac_config
[media] uvcvideo: GET_RES should only be checked for BITMAP type menu controls
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/dvb-usb/mxl111sf-i2c.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/mxl111sf-phy.c | 7 | ||||
-rw-r--r-- | drivers/media/video/s5p-mfc/s5p_mfc_dec.c | 4 | ||||
-rw-r--r-- | drivers/media/video/s5p-mfc/s5p_mfc_enc.c | 4 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 6 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ctrls.c | 5 | ||||
-rw-r--r-- | drivers/media/video/v4l2-event.c | 10 | ||||
-rw-r--r-- | drivers/media/video/videobuf2-core.c | 6 |
8 files changed, 29 insertions, 16 deletions
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c b/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c index 2e8c288258a9..34434557ef65 100644 --- a/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c +++ b/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c | |||
@@ -398,7 +398,6 @@ static int mxl111sf_i2c_readagain(struct mxl111sf_state *state, | |||
398 | u8 i2c_r_data[24]; | 398 | u8 i2c_r_data[24]; |
399 | u8 i = 0; | 399 | u8 i = 0; |
400 | u8 fifo_status = 0; | 400 | u8 fifo_status = 0; |
401 | int ret; | ||
402 | int status = 0; | 401 | int status = 0; |
403 | 402 | ||
404 | mxl_i2c("read %d bytes", count); | 403 | mxl_i2c("read %d bytes", count); |
@@ -418,7 +417,7 @@ static int mxl111sf_i2c_readagain(struct mxl111sf_state *state, | |||
418 | i2c_w_data[4+(i*3)] = 0x00; | 417 | i2c_w_data[4+(i*3)] = 0x00; |
419 | } | 418 | } |
420 | 419 | ||
421 | ret = mxl111sf_i2c_get_data(state, 0, i2c_w_data, i2c_r_data); | 420 | mxl111sf_i2c_get_data(state, 0, i2c_w_data, i2c_r_data); |
422 | 421 | ||
423 | /* Check for I2C NACK status */ | 422 | /* Check for I2C NACK status */ |
424 | if (mxl111sf_i2c_check_status(state) == 1) { | 423 | if (mxl111sf_i2c_check_status(state) == 1) { |
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-phy.c b/drivers/media/dvb/dvb-usb/mxl111sf-phy.c index 91dc1fc2825b..b741b3a7a325 100644 --- a/drivers/media/dvb/dvb-usb/mxl111sf-phy.c +++ b/drivers/media/dvb/dvb-usb/mxl111sf-phy.c | |||
@@ -296,8 +296,7 @@ int mxl111sf_config_spi(struct mxl111sf_state *state, int onoff) | |||
296 | goto fail; | 296 | goto fail; |
297 | 297 | ||
298 | ret = mxl111sf_write_reg(state, 0x00, 0x00); | 298 | ret = mxl111sf_write_reg(state, 0x00, 0x00); |
299 | if (mxl_fail(ret)) | 299 | mxl_fail(ret); |
300 | goto fail; | ||
301 | fail: | 300 | fail: |
302 | return ret; | 301 | return ret; |
303 | } | 302 | } |
@@ -328,11 +327,13 @@ int mxl111sf_idac_config(struct mxl111sf_state *state, | |||
328 | /* set hysteresis value reg: 0x0B<5:0> */ | 327 | /* set hysteresis value reg: 0x0B<5:0> */ |
329 | ret = mxl111sf_write_reg(state, V6_IDAC_HYSTERESIS_REG, | 328 | ret = mxl111sf_write_reg(state, V6_IDAC_HYSTERESIS_REG, |
330 | (hysteresis_value & 0x3F)); | 329 | (hysteresis_value & 0x3F)); |
330 | mxl_fail(ret); | ||
331 | } | 331 | } |
332 | 332 | ||
333 | ret = mxl111sf_write_reg(state, V6_IDAC_SETTINGS_REG, val); | 333 | ret = mxl111sf_write_reg(state, V6_IDAC_SETTINGS_REG, val); |
334 | mxl_fail(ret); | ||
334 | 335 | ||
335 | return val; | 336 | return ret; |
336 | } | 337 | } |
337 | 338 | ||
338 | /* | 339 | /* |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c index 725634d9736d..844a4d7797bc 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c | |||
@@ -220,8 +220,8 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
220 | strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); | 220 | strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); |
221 | cap->bus_info[0] = 0; | 221 | cap->bus_info[0] = 0; |
222 | cap->version = KERNEL_VERSION(1, 0, 0); | 222 | cap->version = KERNEL_VERSION(1, 0, 0); |
223 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT | 223 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE_MPLANE | |
224 | | V4L2_CAP_STREAMING; | 224 | V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_STREAMING; |
225 | return 0; | 225 | return 0; |
226 | } | 226 | } |
227 | 227 | ||
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index ecef127dbc66..1e8cdb77d4b8 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c | |||
@@ -785,8 +785,8 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
785 | strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); | 785 | strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); |
786 | cap->bus_info[0] = 0; | 786 | cap->bus_info[0] = 0; |
787 | cap->version = KERNEL_VERSION(1, 0, 0); | 787 | cap->version = KERNEL_VERSION(1, 0, 0); |
788 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | 788 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE_MPLANE |
789 | | V4L2_CAP_VIDEO_OUTPUT | 789 | | V4L2_CAP_VIDEO_OUTPUT_MPLANE |
790 | | V4L2_CAP_STREAMING; | 790 | | V4L2_CAP_STREAMING; |
791 | return 0; | 791 | return 0; |
792 | } | 792 | } |
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index 10c2364f3e8a..254d32688843 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -1016,7 +1016,8 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain, | |||
1016 | 1016 | ||
1017 | menu_info = &mapping->menu_info[query_menu->index]; | 1017 | menu_info = &mapping->menu_info[query_menu->index]; |
1018 | 1018 | ||
1019 | if (ctrl->info.flags & UVC_CTRL_FLAG_GET_RES) { | 1019 | if (mapping->data_type == UVC_CTRL_DATA_TYPE_BITMASK && |
1020 | (ctrl->info.flags & UVC_CTRL_FLAG_GET_RES)) { | ||
1020 | s32 bitmap; | 1021 | s32 bitmap; |
1021 | 1022 | ||
1022 | if (!ctrl->cached) { | 1023 | if (!ctrl->cached) { |
@@ -1225,7 +1226,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, | |||
1225 | /* Valid menu indices are reported by the GET_RES request for | 1226 | /* Valid menu indices are reported by the GET_RES request for |
1226 | * UVC controls that support it. | 1227 | * UVC controls that support it. |
1227 | */ | 1228 | */ |
1228 | if (ctrl->info.flags & UVC_CTRL_FLAG_GET_RES) { | 1229 | if (mapping->data_type == UVC_CTRL_DATA_TYPE_BITMASK && |
1230 | (ctrl->info.flags & UVC_CTRL_FLAG_GET_RES)) { | ||
1229 | if (!ctrl->cached) { | 1231 | if (!ctrl->cached) { |
1230 | ret = uvc_ctrl_populate_cache(chain, ctrl); | 1232 | ret = uvc_ctrl_populate_cache(chain, ctrl); |
1231 | if (ret < 0) | 1233 | if (ret < 0) |
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index f17f92b86a30..0f415dade05a 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c | |||
@@ -821,8 +821,8 @@ static void send_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, u32 changes) | |||
821 | fill_event(&ev, ctrl, changes); | 821 | fill_event(&ev, ctrl, changes); |
822 | 822 | ||
823 | list_for_each_entry(sev, &ctrl->ev_subs, node) | 823 | list_for_each_entry(sev, &ctrl->ev_subs, node) |
824 | if (sev->fh && (sev->fh != fh || | 824 | if (sev->fh != fh || |
825 | (sev->flags & V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK))) | 825 | (sev->flags & V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK)) |
826 | v4l2_event_queue_fh(sev->fh, &ev); | 826 | v4l2_event_queue_fh(sev->fh, &ev); |
827 | } | 827 | } |
828 | 828 | ||
@@ -947,6 +947,7 @@ static void new_to_cur(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, | |||
947 | if (ctrl->cluster[0]->has_volatiles) | 947 | if (ctrl->cluster[0]->has_volatiles) |
948 | ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; | 948 | ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; |
949 | } | 949 | } |
950 | fh = NULL; | ||
950 | } | 951 | } |
951 | if (changed || update_inactive) { | 952 | if (changed || update_inactive) { |
952 | /* If a control was changed that was not one of the controls | 953 | /* If a control was changed that was not one of the controls |
diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c index 46037f225529..c26ad9637143 100644 --- a/drivers/media/video/v4l2-event.c +++ b/drivers/media/video/v4l2-event.c | |||
@@ -216,6 +216,9 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, | |||
216 | unsigned long flags; | 216 | unsigned long flags; |
217 | unsigned i; | 217 | unsigned i; |
218 | 218 | ||
219 | if (sub->type == V4L2_EVENT_ALL) | ||
220 | return -EINVAL; | ||
221 | |||
219 | if (elems < 1) | 222 | if (elems < 1) |
220 | elems = 1; | 223 | elems = 1; |
221 | if (sub->type == V4L2_EVENT_CTRL) { | 224 | if (sub->type == V4L2_EVENT_CTRL) { |
@@ -283,6 +286,7 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, | |||
283 | { | 286 | { |
284 | struct v4l2_subscribed_event *sev; | 287 | struct v4l2_subscribed_event *sev; |
285 | unsigned long flags; | 288 | unsigned long flags; |
289 | int i; | ||
286 | 290 | ||
287 | if (sub->type == V4L2_EVENT_ALL) { | 291 | if (sub->type == V4L2_EVENT_ALL) { |
288 | v4l2_event_unsubscribe_all(fh); | 292 | v4l2_event_unsubscribe_all(fh); |
@@ -293,8 +297,12 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, | |||
293 | 297 | ||
294 | sev = v4l2_event_subscribed(fh, sub->type, sub->id); | 298 | sev = v4l2_event_subscribed(fh, sub->type, sub->id); |
295 | if (sev != NULL) { | 299 | if (sev != NULL) { |
300 | /* Remove any pending events for this subscription */ | ||
301 | for (i = 0; i < sev->in_use; i++) { | ||
302 | list_del(&sev->events[sev_pos(sev, i)].list); | ||
303 | fh->navailable--; | ||
304 | } | ||
296 | list_del(&sev->list); | 305 | list_del(&sev->list); |
297 | sev->fh = NULL; | ||
298 | } | 306 | } |
299 | 307 | ||
300 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 308 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 979e544388cb..95a3f5e82aef 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c | |||
@@ -131,6 +131,7 @@ static void __setup_offsets(struct vb2_queue *q, unsigned int n) | |||
131 | continue; | 131 | continue; |
132 | 132 | ||
133 | for (plane = 0; plane < vb->num_planes; ++plane) { | 133 | for (plane = 0; plane < vb->num_planes; ++plane) { |
134 | vb->v4l2_planes[plane].length = q->plane_sizes[plane]; | ||
134 | vb->v4l2_planes[plane].m.mem_offset = off; | 135 | vb->v4l2_planes[plane].m.mem_offset = off; |
135 | 136 | ||
136 | dprintk(3, "Buffer %d, plane %d offset 0x%08lx\n", | 137 | dprintk(3, "Buffer %d, plane %d offset 0x%08lx\n", |
@@ -264,6 +265,7 @@ static void __vb2_queue_free(struct vb2_queue *q, unsigned int buffers) | |||
264 | q->num_buffers -= buffers; | 265 | q->num_buffers -= buffers; |
265 | if (!q->num_buffers) | 266 | if (!q->num_buffers) |
266 | q->memory = 0; | 267 | q->memory = 0; |
268 | INIT_LIST_HEAD(&q->queued_list); | ||
267 | } | 269 | } |
268 | 270 | ||
269 | /** | 271 | /** |
@@ -296,14 +298,14 @@ static bool __buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb) | |||
296 | { | 298 | { |
297 | unsigned int plane; | 299 | unsigned int plane; |
298 | for (plane = 0; plane < vb->num_planes; ++plane) { | 300 | for (plane = 0; plane < vb->num_planes; ++plane) { |
301 | void *mem_priv = vb->planes[plane].mem_priv; | ||
299 | /* | 302 | /* |
300 | * If num_users() has not been provided, call_memop | 303 | * If num_users() has not been provided, call_memop |
301 | * will return 0, apparently nobody cares about this | 304 | * will return 0, apparently nobody cares about this |
302 | * case anyway. If num_users() returns more than 1, | 305 | * case anyway. If num_users() returns more than 1, |
303 | * we are not the only user of the plane's memory. | 306 | * we are not the only user of the plane's memory. |
304 | */ | 307 | */ |
305 | if (call_memop(q, plane, num_users, | 308 | if (mem_priv && call_memop(q, plane, num_users, mem_priv) > 1) |
306 | vb->planes[plane].mem_priv) > 1) | ||
307 | return true; | 309 | return true; |
308 | } | 310 | } |
309 | return false; | 311 | return false; |