]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/media/video/mx2_camera.c
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
[net-next-2.6.git] / drivers / media / video / mx2_camera.c
index 026bef0ba403d1e855f804ebfd8287f2902ceff7..b6ea67221d1d5fc64594348f49715539c19f9840 100644 (file)
@@ -378,6 +378,9 @@ static void mx25_camera_frame_done(struct mx2_camera_dev *pcdev, int fb,
 
        spin_lock_irqsave(&pcdev->lock, flags);
 
+       if (*fb_active == NULL)
+               goto out;
+
        vb = &(*fb_active)->vb;
        dev_dbg(pcdev->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
                vb, vb->baddr, vb->bsize);
@@ -402,6 +405,7 @@ static void mx25_camera_frame_done(struct mx2_camera_dev *pcdev, int fb,
 
        *fb_active = buf;
 
+out:
        spin_unlock_irqrestore(&pcdev->lock, flags);
 }
 
@@ -785,6 +789,8 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd,
        if (ret < 0)
                return ret;
 
+       if (common_flags & SOCAM_PCLK_SAMPLE_RISING)
+               csicr1 |= CSICR1_REDGE;
        if (common_flags & SOCAM_PCLK_SAMPLE_FALLING)
                csicr1 |= CSICR1_INV_PCLK;
        if (common_flags & SOCAM_VSYNC_ACTIVE_HIGH)
@@ -1201,7 +1207,7 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev,
        buf = list_entry(pcdev->capture.next,
                        struct mx2_buffer, vb.queue);
 
-       buf->bufnum = bufnum;
+       buf->bufnum = !bufnum;
 
        list_move_tail(pcdev->capture.next, &pcdev->active_bufs);