V4L/DVB: pxa_camera: move fifo reset direct before dma start

Move the fifo reset from pxa_camera_start_capture to pxa_camera_irq direct
before the dma start after an end of frame interrupt to prevent images from
shifting because of old data at the begin of the frame.

Signed-off-by: Stefan Herbrechtsmeier <hbmeier@hni.uni-paderborn.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by Stefan Herbrechtsmeier and committed by Mauro Carvalho Chehab a47f6be4 981cbef2

+6 -5
+6 -5
drivers/media/video/pxa_camera.c
··· 609 609 */ 610 610 static void pxa_camera_start_capture(struct pxa_camera_dev *pcdev) 611 611 { 612 - unsigned long cicr0, cifr; 612 + unsigned long cicr0; 613 613 614 614 dev_dbg(pcdev->soc_host.v4l2_dev.dev, "%s\n", __func__); 615 - /* Reset the FIFOs */ 616 - cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F; 617 - __raw_writel(cifr, pcdev->base + CIFR); 618 615 /* Enable End-Of-Frame Interrupt */ 619 616 cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB; 620 617 cicr0 &= ~CICR0_EOFM; ··· 932 935 static irqreturn_t pxa_camera_irq(int irq, void *data) 933 936 { 934 937 struct pxa_camera_dev *pcdev = data; 935 - unsigned long status, cicr0; 938 + unsigned long status, cifr, cicr0; 936 939 struct pxa_buffer *buf; 937 940 struct videobuf_buffer *vb; 938 941 ··· 946 949 __raw_writel(status, pcdev->base + CISR); 947 950 948 951 if (status & CISR_EOF) { 952 + /* Reset the FIFOs */ 953 + cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F; 954 + __raw_writel(cifr, pcdev->base + CIFR); 955 + 949 956 pcdev->active = list_first_entry(&pcdev->capture, 950 957 struct pxa_buffer, vb.queue); 951 958 vb = &pcdev->active->vb;