linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Baruch Siach <baruch@tkos.co.il>
Cc: linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH 1/3] mx2_camera: Add soc_camera support for i.MX25/i.MX27
Date: Fri, 21 May 2010 09:19:34 +0200	[thread overview]
Message-ID: <20100521071934.GC17272@pengutronix.de> (raw)
In-Reply-To: <a029bab8fcb3273df4a1d98f779f110b127742bd.1273150585.git.baruch@tkos.co.il>

On Thu, May 06, 2010 at 04:09:39PM +0300, Baruch Siach wrote:
> This is the soc_camera support developed by Sascha Hauer for the i.MX27.  Alan
> Carvalho de Assis modified the original driver to get it working on more recent
> kernels. I modified it further to add support for i.MX25. This driver has only
> been tested on the i.MX25 platform.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  arch/arm/plat-mxc/include/mach/memory.h  |    4 +-
>  arch/arm/plat-mxc/include/mach/mx2_cam.h |   41 +
>  drivers/media/video/Kconfig              |   14 +
>  drivers/media/video/Makefile             |    1 +
>  drivers/media/video/mx2_camera.c         | 1396 ++++++++++++++++++++++++++++++
>  5 files changed, 1454 insertions(+), 2 deletions(-)
>  create mode 100644 arch/arm/plat-mxc/include/mach/mx2_cam.h
>  create mode 100644 drivers/media/video/mx2_camera.c
> 

On i.MX27 in DMA mode you pass the kernel virtual address to the DMA
engine. Should be a physical address, so please amend the following:

>From 8a1e1ac8b2448a5c83ed933e427cccd00d470308 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Fri, 21 May 2010 09:15:22 +0200
Subject: [PATCH 2/2] mx2_camera: pass physical address to DMA engine

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/media/video/mx2_camera.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 5d6fb08..6436968 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -216,6 +216,7 @@ struct mx2_camera_dev {
 
 	unsigned int		irq_csi, irq_emma;
 	void __iomem		*base_csi, *base_emma;
+	unsigned long		base_dma;
 
 	struct mx2_camera_platform_data *pdata;
 	struct resource		*res_csi, *res_emma;
@@ -550,7 +551,7 @@ static void mx2_videobuf_queue(struct videobuf_queue *vq,
 		if (!pcdev->active) {
 			ret = imx_dma_setup_single(pcdev->dma,
 					videobuf_to_dma_contig(vb), vb->size,
-					(u32)pcdev->base_csi + 0x10,
+					(u32)pcdev->base_dma + 0x10,
 					DMA_MODE_READ);
 			if (ret) {
 				vb->state = VIDEOBUF_ERROR;
@@ -976,7 +977,8 @@ static void mx27_camera_frame_done(struct mx2_camera_dev *pcdev, int state)
 	vb->state = VIDEOBUF_ACTIVE;
 
 	ret = imx_dma_setup_single(pcdev->dma, videobuf_to_dma_contig(vb),
-			vb->size, (u32)pcdev->base_csi + 0x10, DMA_MODE_READ);
+			vb->size, (u32)pcdev->base_dma + 0x10, DMA_MODE_READ);
+
 	if (ret) {
 		vb->state = VIDEOBUF_ERROR;
 		wake_up(&vb->done);
@@ -1273,6 +1275,7 @@ static int mx2_camera_probe(struct platform_device *pdev)
 	}
 	pcdev->irq_csi = irq_csi;
 	pcdev->base_csi = base_csi;
+	pcdev->base_dma = res_csi->start;
 	pcdev->dev = &pdev->dev;
 
 	err = request_irq(pcdev->irq_csi, mx2_cam_irq_handler, 0,
-- 
1.7.0

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  parent reply	other threads:[~2010-05-21  7:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 13:09 [PATCH 0/3] Driver for the i.MX2x CMOS Sensor Interface Baruch Siach
2010-05-06 13:09 ` [PATCH 1/3] mx2_camera: Add soc_camera support for i.MX25/i.MX27 Baruch Siach
2010-05-12 19:02   ` Guennadi Liakhovetski
2010-05-13  5:21     ` Baruch Siach
2010-05-17  7:27     ` Sascha Hauer
2010-05-17 13:58       ` Baruch Siach
2010-05-19  8:55         ` Sascha Hauer
2010-05-21  7:19   ` Sascha Hauer [this message]
2010-05-06 13:09 ` [PATCH 2/3] mx27: add support for the CSI device Baruch Siach
2010-05-21  7:17   ` Sascha Hauer
2010-05-06 13:09 ` [PATCH 3/3] mx25: " Baruch Siach
2010-05-12 19:11   ` Guennadi Liakhovetski
2010-05-21  7:20 ` [PATCH 0/3] Driver for the i.MX2x CMOS Sensor Interface Sascha Hauer
2010-05-21  7:27   ` Baruch Siach
2010-05-21 18:33     ` Guennadi Liakhovetski
2010-05-25  7:20       ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100521071934.GC17272@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=baruch@tkos.co.il \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).