linux-ti33x-psp 3.2: add fixed for cssp, fbset and OPP50
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0078-beaglebone-error-handling-for-DMA-completion-in-cssp.patch
1 From 823d8b7b4a1dcfefc7260110a3acada0d1f45695 Mon Sep 17 00:00:00 2001
2 From: Dan Aizenstros <daizenstros@quicklogic.com>
3 Date: Thu, 12 Jul 2012 16:52:21 -0400
4 Subject: [PATCH 78/79] beaglebone: error handling for DMA completion in
5  cssp_camera.c
7 Signed-off-by: Dan Aizenstros <daizenstros@quicklogic.com>
8 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9 ---
10  drivers/media/video/cssp_camera/cssp_camera.c |   16 +++++++++++++++-
11  1 file changed, 15 insertions(+), 1 deletion(-)
13 diff --git a/drivers/media/video/cssp_camera/cssp_camera.c b/drivers/media/video/cssp_camera/cssp_camera.c
14 index acd38ee..fca199b 100644
15 --- a/drivers/media/video/cssp_camera/cssp_camera.c
16 +++ b/drivers/media/video/cssp_camera/cssp_camera.c
17 @@ -191,6 +191,21 @@ static void dma_callback(unsigned lch, u16 ch_status, void *data)
18         if (ch_status == DMA_COMPLETE) {
19                 struct vb2_buffer *vb = dev->current_vb;
20                 struct timeval ts;
21 +               struct edmacc_param dma_tr_params;
22 +
23 +               edma_read_slot(dev->dma_ch, &dma_tr_params);
24 +               if ((dma_tr_params.opt != 0) ||
25 +                       (dma_tr_params.src != 0) ||
26 +                       (dma_tr_params.a_b_cnt != 0) ||
27 +                       (dma_tr_params.dst != 0) ||
28 +                       (dma_tr_params.src_dst_bidx != 0) ||
29 +                       (dma_tr_params.link_bcntrld != 0xffff) ||
30 +                       (dma_tr_params.src_dst_cidx != 0) ||
31 +                       (dma_tr_params.ccnt != 0)) {
32 +
33 +                       trigger_dma_transfer_to_buf(dev, dev->current_vb);
34 +                       return;
35 +               }
36  
37                 vb->v4l2_buf.field = dev->field;
38                 dev->field_count++;
39 @@ -204,7 +219,6 @@ static void dma_callback(unsigned lch, u16 ch_status, void *data)
40                 /* check if we have new buffer queued */
41                 dequeue_buffer_for_dma(dev);
42         } else {
43 -               printk(KERN_ERR "[cssp_camera]: EDMA error (ch_status = %d)\n", ch_status);
44                 /* we got a missed interrupt so just start a new DMA with the existing buffer */
45                 if (dev->current_vb != NULL)
46                         trigger_dma_transfer_to_buf(dev, dev->current_vb);
47 -- 
48 1.7.10