diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
commit | 0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch) | |
tree | 4ef7c20a8be8393006c6fe9627eb29dd30877d61 /drivers/media/video/mx2_camera.c | |
parent | 00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff) | |
parent | 7655e594945289b418af39f6669fea4666a7b520 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits)
[media] af9015: Fix max I2C message size when used with tda18271
[media] IR: initialize ir_raw_event in few more drivers
[media] Guard a divide in v4l1 compat layer
[media] imon: fix nomouse modprobe option
[media] imon: remove redundant change_protocol call
[media] imon: fix my egregious brown paper bag w/rdev/idev split
[media] cafe_ccic: Configure ov7670 correctly
[media] ov7670: allow configuration of image size, clock speed, and I/O method
[media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016]
[media] af9015: map DigitalNow TinyTwin v2 remote
[media] DigitalNow TinyTwin remote controller
[media] af9015: RC fixes and improvements
videodev2.h.xml: Update to reflect the latest changes at videodev2.h
[media] v4l: document new Bayer and monochrome pixel formats
[media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028
[media] firedtv: add parameter to fake ca_system_ids in CA_INFO
[media] tm6000: fix a macro coding style issue
tm6000: Remove some ugly debug code
[media] Nova-S-Plus audio line input
[media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers
...
Diffstat (limited to 'drivers/media/video/mx2_camera.c')
-rw-r--r-- | drivers/media/video/mx2_camera.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index b6ea67221d1d..4a27862da30d 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -461,9 +461,9 @@ static void free_buffer(struct videobuf_queue *vq, struct mx2_buffer *buf) | |||
461 | 461 | ||
462 | /* | 462 | /* |
463 | * This waits until this buffer is out of danger, i.e., until it is no | 463 | * This waits until this buffer is out of danger, i.e., until it is no |
464 | * longer in STATE_QUEUED or STATE_ACTIVE | 464 | * longer in state VIDEOBUF_QUEUED or VIDEOBUF_ACTIVE |
465 | */ | 465 | */ |
466 | videobuf_waiton(vb, 0, 0); | 466 | videobuf_waiton(vq, vb, 0, 0); |
467 | 467 | ||
468 | videobuf_dma_contig_free(vq, vb); | 468 | videobuf_dma_contig_free(vq, vb); |
469 | dev_dbg(&icd->dev, "%s freed\n", __func__); | 469 | dev_dbg(&icd->dev, "%s freed\n", __func__); |
@@ -640,15 +640,27 @@ static void mx2_videobuf_release(struct videobuf_queue *vq, | |||
640 | * Terminate only queued but inactive buffers. Active buffers are | 640 | * Terminate only queued but inactive buffers. Active buffers are |
641 | * released when they become inactive after videobuf_waiton(). | 641 | * released when they become inactive after videobuf_waiton(). |
642 | * | 642 | * |
643 | * FIXME: implement forced termination of active buffers, so that the | 643 | * FIXME: implement forced termination of active buffers for mx27 and |
644 | * user won't get stuck in an uninterruptible state. This requires a | 644 | * mx27 eMMA, so that the user won't get stuck in an uninterruptible |
645 | * specific handling for each of the three DMA types that this driver | 645 | * state. This requires a specific handling for each of the these DMA |
646 | * supports. | 646 | * types. |
647 | */ | 647 | */ |
648 | spin_lock_irqsave(&pcdev->lock, flags); | 648 | spin_lock_irqsave(&pcdev->lock, flags); |
649 | if (vb->state == VIDEOBUF_QUEUED) { | 649 | if (vb->state == VIDEOBUF_QUEUED) { |
650 | list_del(&vb->queue); | 650 | list_del(&vb->queue); |
651 | vb->state = VIDEOBUF_ERROR; | 651 | vb->state = VIDEOBUF_ERROR; |
652 | } else if (cpu_is_mx25() && vb->state == VIDEOBUF_ACTIVE) { | ||
653 | if (pcdev->fb1_active == buf) { | ||
654 | pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN; | ||
655 | writel(0, pcdev->base_csi + CSIDMASA_FB1); | ||
656 | pcdev->fb1_active = NULL; | ||
657 | } else if (pcdev->fb2_active == buf) { | ||
658 | pcdev->csicr1 &= ~CSICR1_FB2_DMA_INTEN; | ||
659 | writel(0, pcdev->base_csi + CSIDMASA_FB2); | ||
660 | pcdev->fb2_active = NULL; | ||
661 | } | ||
662 | writel(pcdev->csicr1, pcdev->base_csi + CSICR1); | ||
663 | vb->state = VIDEOBUF_ERROR; | ||
652 | } | 664 | } |
653 | spin_unlock_irqrestore(&pcdev->lock, flags); | 665 | spin_unlock_irqrestore(&pcdev->lock, flags); |
654 | 666 | ||
@@ -670,7 +682,7 @@ static void mx2_camera_init_videobuf(struct videobuf_queue *q, | |||
670 | 682 | ||
671 | videobuf_queue_dma_contig_init(q, &mx2_videobuf_ops, pcdev->dev, | 683 | videobuf_queue_dma_contig_init(q, &mx2_videobuf_ops, pcdev->dev, |
672 | &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, | 684 | &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, |
673 | V4L2_FIELD_NONE, sizeof(struct mx2_buffer), icd); | 685 | V4L2_FIELD_NONE, sizeof(struct mx2_buffer), icd, NULL); |
674 | } | 686 | } |
675 | 687 | ||
676 | #define MX2_BUS_FLAGS (SOCAM_DATAWIDTH_8 | \ | 688 | #define MX2_BUS_FLAGS (SOCAM_DATAWIDTH_8 | \ |
@@ -716,8 +728,11 @@ static void mx27_camera_emma_buf_init(struct soc_camera_device *icd, | |||
716 | /* | 728 | /* |
717 | * We only use the EMMA engine to get rid of the broken | 729 | * We only use the EMMA engine to get rid of the broken |
718 | * DMA Engine. No color space consversion at the moment. | 730 | * DMA Engine. No color space consversion at the moment. |
719 | * We adjust incoming and outgoing pixelformat to rgb16 | 731 | * We set the incomming and outgoing pixelformat to an |
720 | * and adjust the bytesperline accordingly. | 732 | * 16 Bit wide format and adjust the bytesperline |
733 | * accordingly. With this configuration the inputdata | ||
734 | * will not be changed by the emma and could be any type | ||
735 | * of 16 Bit Pixelformat. | ||
721 | */ | 736 | */ |
722 | writel(PRP_CNTL_CH1EN | | 737 | writel(PRP_CNTL_CH1EN | |
723 | PRP_CNTL_CSIEN | | 738 | PRP_CNTL_CSIEN | |
@@ -903,10 +918,6 @@ static int mx2_camera_set_fmt(struct soc_camera_device *icd, | |||
903 | return -EINVAL; | 918 | return -EINVAL; |
904 | } | 919 | } |
905 | 920 | ||
906 | /* eMMA can only do RGB565 */ | ||
907 | if (mx27_camera_emma(pcdev) && pix->pixelformat != V4L2_PIX_FMT_RGB565) | ||
908 | return -EINVAL; | ||
909 | |||
910 | mf.width = pix->width; | 921 | mf.width = pix->width; |
911 | mf.height = pix->height; | 922 | mf.height = pix->height; |
912 | mf.field = pix->field; | 923 | mf.field = pix->field; |
@@ -950,10 +961,6 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd, | |||
950 | 961 | ||
951 | /* FIXME: implement MX27 limits */ | 962 | /* FIXME: implement MX27 limits */ |
952 | 963 | ||
953 | /* eMMA can only do RGB565 */ | ||
954 | if (mx27_camera_emma(pcdev) && pixfmt != V4L2_PIX_FMT_RGB565) | ||
955 | return -EINVAL; | ||
956 | |||
957 | /* limit to MX25 hardware capabilities */ | 964 | /* limit to MX25 hardware capabilities */ |
958 | if (cpu_is_mx25()) { | 965 | if (cpu_is_mx25()) { |
959 | if (xlate->host_fmt->bits_per_sample <= 8) | 966 | if (xlate->host_fmt->bits_per_sample <= 8) |
@@ -1426,6 +1433,9 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev) | |||
1426 | if (err) | 1433 | if (err) |
1427 | goto exit_free_emma; | 1434 | goto exit_free_emma; |
1428 | 1435 | ||
1436 | dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n", | ||
1437 | clk_get_rate(pcdev->clk_csi)); | ||
1438 | |||
1429 | return 0; | 1439 | return 0; |
1430 | 1440 | ||
1431 | exit_free_emma: | 1441 | exit_free_emma: |