diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-23 23:07:12 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-23 23:07:12 -0500 |
| commit | 2116e02a96b44be4d7c82a067554de321c87afe8 (patch) | |
| tree | 48b1c388e808890adb405a705665f6e9f138ab59 | |
| parent | 248152b60209874b1707a23d336b137486756a29 (diff) | |
| parent | 68d6f84ba0c47e658beff3a4bf0c43acee4b4690 (diff) | |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
- gspca: add needed delay for I2C traffic for sonixb/sonixj cameras
- gspca: add one missing Kinect USB ID
- usbvideo: some regression fixes
- omap3isp: fix some build issues
- videobuf2: fix video output handling
- exynos s5p/m5mols: a few regression fixes.
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures
[media] uvcvideo: Cleanup leftovers of partial revert
[media] uvcvideo: Return -EACCES when trying to set a read-only control
[media] omap3isp: Don't include <plat/cpu.h>
[media] s5p-mfc: Fix interrupt error handling routine
[media] s5p-fimc: Fix return value of __fimc_md_create_flite_source_links()
[media] m5mols: Fix typo in get_fmt callback
[media] v4l: vb2: Set data_offset to 0 for single-plane output buffers
[media] [FOR,v3.8] omap3isp: Don't include deleted OMAP plat/ header files
[media] gspca_sonixj: Add a small delay after i2c_w1
[media] gspca_sonixb: Properly wait between i2c writes
[media] gspca_kinect: add Kinect for Windows USB id
| -rw-r--r-- | drivers/media/i2c/m5mols/m5mols_core.c | 2 | ||||
| -rw-r--r-- | drivers/media/platform/omap3isp/ispvideo.c | 3 | ||||
| -rw-r--r-- | drivers/media/platform/s5p-fimc/fimc-mdevice.c | 2 | ||||
| -rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc.c | 88 | ||||
| -rw-r--r-- | drivers/media/usb/gspca/kinect.c | 1 | ||||
| -rw-r--r-- | drivers/media/usb/gspca/sonixb.c | 13 | ||||
| -rw-r--r-- | drivers/media/usb/gspca/sonixj.c | 1 | ||||
| -rw-r--r-- | drivers/media/usb/uvc/uvc_ctrl.c | 4 | ||||
| -rw-r--r-- | drivers/media/usb/uvc/uvc_v4l2.c | 6 | ||||
| -rw-r--r-- | drivers/media/v4l2-core/videobuf2-core.c | 4 |
10 files changed, 57 insertions, 67 deletions
diff --git a/drivers/media/i2c/m5mols/m5mols_core.c b/drivers/media/i2c/m5mols/m5mols_core.c index 8a8d42fe2633..d4e7567b367c 100644 --- a/drivers/media/i2c/m5mols/m5mols_core.c +++ b/drivers/media/i2c/m5mols/m5mols_core.c | |||
| @@ -556,7 +556,7 @@ static int m5mols_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | |||
| 556 | mutex_lock(&info->lock); | 556 | mutex_lock(&info->lock); |
| 557 | 557 | ||
| 558 | format = __find_format(info, fh, fmt->which, info->res_type); | 558 | format = __find_format(info, fh, fmt->which, info->res_type); |
| 559 | if (!format) | 559 | if (format) |
| 560 | fmt->format = *format; | 560 | fmt->format = *format; |
| 561 | else | 561 | else |
| 562 | ret = -EINVAL; | 562 | ret = -EINVAL; |
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c index e0d73a642186..8dac17511e61 100644 --- a/drivers/media/platform/omap3isp/ispvideo.c +++ b/drivers/media/platform/omap3isp/ispvideo.c | |||
| @@ -35,9 +35,6 @@ | |||
| 35 | #include <linux/vmalloc.h> | 35 | #include <linux/vmalloc.h> |
| 36 | #include <media/v4l2-dev.h> | 36 | #include <media/v4l2-dev.h> |
| 37 | #include <media/v4l2-ioctl.h> | 37 | #include <media/v4l2-ioctl.h> |
| 38 | #include <plat/iommu.h> | ||
| 39 | #include <plat/iovmm.h> | ||
| 40 | #include <plat/omap-pm.h> | ||
| 41 | 38 | ||
| 42 | #include "ispvideo.h" | 39 | #include "ispvideo.h" |
| 43 | #include "isp.h" | 40 | #include "isp.h" |
diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c index 4ab99f3a7b09..b4a68ecf0ca7 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c | |||
| @@ -593,7 +593,7 @@ static int __fimc_md_create_flite_source_links(struct fimc_md *fmd) | |||
| 593 | { | 593 | { |
| 594 | struct media_entity *source, *sink; | 594 | struct media_entity *source, *sink; |
| 595 | unsigned int flags = MEDIA_LNK_FL_ENABLED; | 595 | unsigned int flags = MEDIA_LNK_FL_ENABLED; |
| 596 | int i, ret; | 596 | int i, ret = 0; |
| 597 | 597 | ||
| 598 | for (i = 0; i < FIMC_LITE_MAX_DEVS; i++) { | 598 | for (i = 0; i < FIMC_LITE_MAX_DEVS; i++) { |
| 599 | struct fimc_lite *fimc = fmd->fimc_lite[i]; | 599 | struct fimc_lite *fimc = fmd->fimc_lite[i]; |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 379f57433711..681bc6ba149d 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c | |||
| @@ -412,62 +412,48 @@ leave_handle_frame: | |||
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | /* Error handling for interrupt */ | 414 | /* Error handling for interrupt */ |
| 415 | static void s5p_mfc_handle_error(struct s5p_mfc_ctx *ctx, | 415 | static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, |
| 416 | unsigned int reason, unsigned int err) | 416 | struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err) |
| 417 | { | 417 | { |
| 418 | struct s5p_mfc_dev *dev; | ||
| 419 | unsigned long flags; | 418 | unsigned long flags; |
| 420 | 419 | ||
| 421 | /* If no context is available then all necessary | ||
| 422 | * processing has been done. */ | ||
| 423 | if (ctx == NULL) | ||
| 424 | return; | ||
| 425 | |||
| 426 | dev = ctx->dev; | ||
| 427 | mfc_err("Interrupt Error: %08x\n", err); | 420 | mfc_err("Interrupt Error: %08x\n", err); |
| 428 | s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); | ||
| 429 | wake_up_dev(dev, reason, err); | ||
| 430 | 421 | ||
| 431 | /* Error recovery is dependent on the state of context */ | 422 | if (ctx != NULL) { |
| 432 | switch (ctx->state) { | 423 | /* Error recovery is dependent on the state of context */ |
| 433 | case MFCINST_INIT: | 424 | switch (ctx->state) { |
| 434 | /* This error had to happen while acquireing instance */ | 425 | case MFCINST_RES_CHANGE_INIT: |
| 435 | case MFCINST_GOT_INST: | 426 | case MFCINST_RES_CHANGE_FLUSH: |
| 436 | /* This error had to happen while parsing the header */ | 427 | case MFCINST_RES_CHANGE_END: |
| 437 | case MFCINST_HEAD_PARSED: | 428 | case MFCINST_FINISHING: |
| 438 | /* This error had to happen while setting dst buffers */ | 429 | case MFCINST_FINISHED: |
| 439 | case MFCINST_RETURN_INST: | 430 | case MFCINST_RUNNING: |
| 440 | /* This error had to happen while releasing instance */ | 431 | /* It is higly probable that an error occured |
| 441 | clear_work_bit(ctx); | 432 | * while decoding a frame */ |
| 442 | wake_up_ctx(ctx, reason, err); | 433 | clear_work_bit(ctx); |
| 443 | if (test_and_clear_bit(0, &dev->hw_lock) == 0) | 434 | ctx->state = MFCINST_ERROR; |
| 444 | BUG(); | 435 | /* Mark all dst buffers as having an error */ |
| 445 | s5p_mfc_clock_off(); | 436 | spin_lock_irqsave(&dev->irqlock, flags); |
| 446 | ctx->state = MFCINST_ERROR; | 437 | s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, |
| 447 | break; | 438 | &ctx->dst_queue, &ctx->vq_dst); |
| 448 | case MFCINST_FINISHING: | 439 | /* Mark all src buffers as having an error */ |
| 449 | case MFCINST_FINISHED: | 440 | s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, |
| 450 | case MFCINST_RUNNING: | 441 | &ctx->src_queue, &ctx->vq_src); |
| 451 | /* It is higly probable that an error occured | 442 | spin_unlock_irqrestore(&dev->irqlock, flags); |
| 452 | * while decoding a frame */ | 443 | wake_up_ctx(ctx, reason, err); |
| 453 | clear_work_bit(ctx); | 444 | break; |
| 454 | ctx->state = MFCINST_ERROR; | 445 | default: |
| 455 | /* Mark all dst buffers as having an error */ | 446 | clear_work_bit(ctx); |
| 456 | spin_lock_irqsave(&dev->irqlock, flags); | 447 | ctx->state = MFCINST_ERROR; |
| 457 | s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->dst_queue, | 448 | wake_up_ctx(ctx, reason, err); |
| 458 | &ctx->vq_dst); | 449 | break; |
| 459 | /* Mark all src buffers as having an error */ | 450 | } |
| 460 | s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->src_queue, | ||
| 461 | &ctx->vq_src); | ||
| 462 | spin_unlock_irqrestore(&dev->irqlock, flags); | ||
| 463 | if (test_and_clear_bit(0, &dev->hw_lock) == 0) | ||
| 464 | BUG(); | ||
| 465 | s5p_mfc_clock_off(); | ||
| 466 | break; | ||
| 467 | default: | ||
| 468 | mfc_err("Encountered an error interrupt which had not been handled\n"); | ||
| 469 | break; | ||
| 470 | } | 451 | } |
| 452 | if (test_and_clear_bit(0, &dev->hw_lock) == 0) | ||
| 453 | BUG(); | ||
| 454 | s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); | ||
| 455 | s5p_mfc_clock_off(); | ||
| 456 | wake_up_dev(dev, reason, err); | ||
| 471 | return; | 457 | return; |
| 472 | } | 458 | } |
| 473 | 459 | ||
| @@ -632,7 +618,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) | |||
| 632 | dev->warn_start) | 618 | dev->warn_start) |
| 633 | s5p_mfc_handle_frame(ctx, reason, err); | 619 | s5p_mfc_handle_frame(ctx, reason, err); |
| 634 | else | 620 | else |
| 635 | s5p_mfc_handle_error(ctx, reason, err); | 621 | s5p_mfc_handle_error(dev, ctx, reason, err); |
| 636 | clear_bit(0, &dev->enter_suspend); | 622 | clear_bit(0, &dev->enter_suspend); |
| 637 | break; | 623 | break; |
| 638 | 624 | ||
diff --git a/drivers/media/usb/gspca/kinect.c b/drivers/media/usb/gspca/kinect.c index 40ad6687ee5d..3773a8a745df 100644 --- a/drivers/media/usb/gspca/kinect.c +++ b/drivers/media/usb/gspca/kinect.c | |||
| @@ -381,6 +381,7 @@ static const struct sd_desc sd_desc = { | |||
| 381 | /* -- module initialisation -- */ | 381 | /* -- module initialisation -- */ |
| 382 | static const struct usb_device_id device_table[] = { | 382 | static const struct usb_device_id device_table[] = { |
| 383 | {USB_DEVICE(0x045e, 0x02ae)}, | 383 | {USB_DEVICE(0x045e, 0x02ae)}, |
| 384 | {USB_DEVICE(0x045e, 0x02bf)}, | ||
| 384 | {} | 385 | {} |
| 385 | }; | 386 | }; |
| 386 | 387 | ||
diff --git a/drivers/media/usb/gspca/sonixb.c b/drivers/media/usb/gspca/sonixb.c index 70511d5f9538..1220340e7602 100644 --- a/drivers/media/usb/gspca/sonixb.c +++ b/drivers/media/usb/gspca/sonixb.c | |||
| @@ -496,7 +496,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
| 496 | } | 496 | } |
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | static void i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer) | 499 | static void i2c_w(struct gspca_dev *gspca_dev, const u8 *buf) |
| 500 | { | 500 | { |
| 501 | int retry = 60; | 501 | int retry = 60; |
| 502 | 502 | ||
| @@ -504,16 +504,19 @@ static void i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer) | |||
| 504 | return; | 504 | return; |
| 505 | 505 | ||
| 506 | /* is i2c ready */ | 506 | /* is i2c ready */ |
| 507 | reg_w(gspca_dev, 0x08, buffer, 8); | 507 | reg_w(gspca_dev, 0x08, buf, 8); |
| 508 | while (retry--) { | 508 | while (retry--) { |
| 509 | if (gspca_dev->usb_err < 0) | 509 | if (gspca_dev->usb_err < 0) |
| 510 | return; | 510 | return; |
| 511 | msleep(10); | 511 | msleep(1); |
| 512 | reg_r(gspca_dev, 0x08); | 512 | reg_r(gspca_dev, 0x08); |
| 513 | if (gspca_dev->usb_buf[0] & 0x04) { | 513 | if (gspca_dev->usb_buf[0] & 0x04) { |
| 514 | if (gspca_dev->usb_buf[0] & 0x08) { | 514 | if (gspca_dev->usb_buf[0] & 0x08) { |
| 515 | dev_err(gspca_dev->v4l2_dev.dev, | 515 | dev_err(gspca_dev->v4l2_dev.dev, |
| 516 | "i2c write error\n"); | 516 | "i2c error writing %02x %02x %02x %02x" |
| 517 | " %02x %02x %02x %02x\n", | ||
| 518 | buf[0], buf[1], buf[2], buf[3], | ||
| 519 | buf[4], buf[5], buf[6], buf[7]); | ||
| 517 | gspca_dev->usb_err = -EIO; | 520 | gspca_dev->usb_err = -EIO; |
| 518 | } | 521 | } |
| 519 | return; | 522 | return; |
| @@ -530,7 +533,7 @@ static void i2c_w_vector(struct gspca_dev *gspca_dev, | |||
| 530 | for (;;) { | 533 | for (;;) { |
| 531 | if (gspca_dev->usb_err < 0) | 534 | if (gspca_dev->usb_err < 0) |
| 532 | return; | 535 | return; |
| 533 | reg_w(gspca_dev, 0x08, *buffer, 8); | 536 | i2c_w(gspca_dev, *buffer); |
| 534 | len -= 8; | 537 | len -= 8; |
| 535 | if (len <= 0) | 538 | if (len <= 0) |
| 536 | break; | 539 | break; |
diff --git a/drivers/media/usb/gspca/sonixj.c b/drivers/media/usb/gspca/sonixj.c index 5a86047b846f..36307a9028a9 100644 --- a/drivers/media/usb/gspca/sonixj.c +++ b/drivers/media/usb/gspca/sonixj.c | |||
| @@ -1550,6 +1550,7 @@ static void i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val) | |||
| 1550 | 0, | 1550 | 0, |
| 1551 | gspca_dev->usb_buf, 8, | 1551 | gspca_dev->usb_buf, 8, |
| 1552 | 500); | 1552 | 500); |
| 1553 | msleep(2); | ||
| 1553 | if (ret < 0) { | 1554 | if (ret < 0) { |
| 1554 | pr_err("i2c_w1 err %d\n", ret); | 1555 | pr_err("i2c_w1 err %d\n", ret); |
| 1555 | gspca_dev->usb_err = ret; | 1556 | gspca_dev->usb_err = ret; |
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 2bb7613ddebb..d5baab17a5ef 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c | |||
| @@ -1431,8 +1431,10 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, | |||
| 1431 | int ret; | 1431 | int ret; |
| 1432 | 1432 | ||
| 1433 | ctrl = uvc_find_control(chain, xctrl->id, &mapping); | 1433 | ctrl = uvc_find_control(chain, xctrl->id, &mapping); |
| 1434 | if (ctrl == NULL || (ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR) == 0) | 1434 | if (ctrl == NULL) |
| 1435 | return -EINVAL; | 1435 | return -EINVAL; |
| 1436 | if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR)) | ||
| 1437 | return -EACCES; | ||
| 1436 | 1438 | ||
| 1437 | /* Clamp out of range values. */ | 1439 | /* Clamp out of range values. */ |
| 1438 | switch (mapping->v4l2_type) { | 1440 | switch (mapping->v4l2_type) { |
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index f2ee8c6b0d8d..68d59b527492 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c | |||
| @@ -657,8 +657,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
| 657 | ret = uvc_ctrl_get(chain, ctrl); | 657 | ret = uvc_ctrl_get(chain, ctrl); |
| 658 | if (ret < 0) { | 658 | if (ret < 0) { |
| 659 | uvc_ctrl_rollback(handle); | 659 | uvc_ctrl_rollback(handle); |
| 660 | ctrls->error_idx = ret == -ENOENT | 660 | ctrls->error_idx = i; |
| 661 | ? ctrls->count : i; | ||
| 662 | return ret; | 661 | return ret; |
| 663 | } | 662 | } |
| 664 | } | 663 | } |
| @@ -686,8 +685,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
| 686 | ret = uvc_ctrl_set(chain, ctrl); | 685 | ret = uvc_ctrl_set(chain, ctrl); |
| 687 | if (ret < 0) { | 686 | if (ret < 0) { |
| 688 | uvc_ctrl_rollback(handle); | 687 | uvc_ctrl_rollback(handle); |
| 689 | ctrls->error_idx = (ret == -ENOENT && | 688 | ctrls->error_idx = cmd == VIDIOC_S_EXT_CTRLS |
| 690 | cmd == VIDIOC_S_EXT_CTRLS) | ||
| 691 | ? ctrls->count : i; | 689 | ? ctrls->count : i; |
| 692 | return ret; | 690 | return ret; |
| 693 | } | 691 | } |
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 9f81be23a81f..e02c4797b1c6 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c | |||
| @@ -921,8 +921,10 @@ static void __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b | |||
| 921 | * In videobuf we use our internal V4l2_planes struct for | 921 | * In videobuf we use our internal V4l2_planes struct for |
| 922 | * single-planar buffers as well, for simplicity. | 922 | * single-planar buffers as well, for simplicity. |
| 923 | */ | 923 | */ |
| 924 | if (V4L2_TYPE_IS_OUTPUT(b->type)) | 924 | if (V4L2_TYPE_IS_OUTPUT(b->type)) { |
| 925 | v4l2_planes[0].bytesused = b->bytesused; | 925 | v4l2_planes[0].bytesused = b->bytesused; |
| 926 | v4l2_planes[0].data_offset = 0; | ||
| 927 | } | ||
| 926 | 928 | ||
| 927 | if (b->memory == V4L2_MEMORY_USERPTR) { | 929 | if (b->memory == V4L2_MEMORY_USERPTR) { |
| 928 | v4l2_planes[0].m.userptr = b->m.userptr; | 930 | v4l2_planes[0].m.userptr = b->m.userptr; |
