From patchwork Tue Apr 20 06:51:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 93619 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3K6pmHX025721 for ; Tue, 20 Apr 2010 06:51:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225Ab0DTGvq (ORCPT ); Tue, 20 Apr 2010 02:51:46 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:47072 "EHLO mail.uni-paderborn.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752471Ab0DTGvq (ORCPT ); Tue, 20 Apr 2010 02:51:46 -0400 Received: from pova.uni-paderborn.de ([131.234.200.75] helo=localhost.localdomain) by mail.uni-paderborn.de with esmtp (Exim 4.69 hoth) id 1O47JA-000829-RY; Tue, 20 Apr 2010 08:51:44 +0200 Received: from mail.uni-paderborn.de by pova with queue id 17295075-6; Tue, 20 Apr 2010 06:51:33 GMT Received: from hbmeier@hni.uni-paderborn.de ( [131.234.87.59]) by mail.uni-paderborn.de with SMTP id 1O47Iy-0005zm-JL; Tue, 20 Apr 2010 06:51:33 GMT (envelope-from hbmeier@hni.uni-paderborn.de) Received: from [131.234.87.59] (helo=localhost.localdomain) by mail.uni-paderborn.de with esmtp (Exim 4.69 spheron) id 1O47Iy-0005zm-JL; Tue, 20 Apr 2010 08:51:33 +0200 Cc: g.liakhovetski@gmx.de, jic23@cam.ac.uk, Stefan Herbrechtsmeier Subject: [PATCH] pxa_camera: move fifo reset direct before dma start In-Reply-To: <> X-Mailer: git-send-email 1.5.4.3 X-Envelope-From: Date: Tue, 20 Apr 2010 08:51:29 +0200 X-IMT-Authenticated-Sender: References: <> Message-Id: <1271746289-14849-1-git-send-email-hbmeier@hni.uni-paderborn.de> To: linux-media@vger.kernel.org From: Stefan Herbrechtsmeier X-PMX-Version: 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.4.20.63920 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, TO_NO_NAME 0, __CP_MEDIA_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-IMT-Spam-Score: 0.8 () X-IMT-Authenticated-Sender: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 20 Apr 2010 06:52:00 +0000 (UTC) diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 5ecc30d..04bf5c1 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -609,12 +609,9 @@ static void pxa_dma_add_tail_buf(struct pxa_camera_dev *pcdev, */ static void pxa_camera_start_capture(struct pxa_camera_dev *pcdev) { - unsigned long cicr0, cifr; + unsigned long cicr0; dev_dbg(pcdev->soc_host.v4l2_dev.dev, "%s\n", __func__); - /* Reset the FIFOs */ - cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F; - __raw_writel(cifr, pcdev->base + CIFR); /* Enable End-Of-Frame Interrupt */ cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB; cicr0 &= ~CICR0_EOFM; @@ -935,7 +932,7 @@ static void pxa_camera_deactivate(struct pxa_camera_dev *pcdev) static irqreturn_t pxa_camera_irq(int irq, void *data) { struct pxa_camera_dev *pcdev = data; - unsigned long status, cicr0; + unsigned long status, cifr, cicr0; struct pxa_buffer *buf; struct videobuf_buffer *vb; @@ -949,6 +946,10 @@ static irqreturn_t pxa_camera_irq(int irq, void *data) __raw_writel(status, pcdev->base + CISR); if (status & CISR_EOF) { + /* Reset the FIFOs */ + cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F; + __raw_writel(cifr, pcdev->base + CIFR); + pcdev->active = list_first_entry(&pcdev->capture, struct pxa_buffer, vb.queue); vb = &pcdev->active->vb;