mx31: add camera device
authorValentin Longchamp <valentin.longchamp@epfl.ch>
Thu, 7 May 2009 09:51:42 +0000 (11:51 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Thu, 7 May 2009 14:21:16 +0000 (16:21 +0200)
This adds the camera device based on Guennadi's soc_camera architecture
for the mx31.

The proposed init by Guennadi was removed and must be implemented in the
board init file as it contains a lot of board specific info (memory
size, clock speed).

Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx3/devices.c
arch/arm/mach-mx3/devices.h

index f55c9863ea42238644add41e21bf5d56ec454fad..d927eddcad460432200db70adf10ae4a5263f55e 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/serial.h>
 #include <linux/gpio.h>
+#include <linux/dma-mapping.h>
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <mach/common.h>
 #include <mach/imx-uart.h>
+#include <mach/mx3_camera.h>
 
 #include "devices.h"
 
@@ -346,10 +348,28 @@ struct platform_device mx3_fb = {
        .num_resources  = ARRAY_SIZE(fb_resources),
        .resource       = fb_resources,
        .dev            = {
-               .coherent_dma_mask = 0xffffffff,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
        },
 };
 
+static struct resource camera_resources[] = {
+       {
+               .start  = IPU_CTRL_BASE_ADDR + 0x60,
+               .end    = IPU_CTRL_BASE_ADDR + 0x87,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device mx3_camera = {
+       .name           = "mx3-camera",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(camera_resources),
+       .resource       = camera_resources,
+       .dev            = {
+               .coherent_dma_mask = DMA_BIT_MASK(32),
+       },
+};
+
 static struct resource otg_resources[] = {
        {
                .start  = OTG_BASE_ADDR,
index 27779c3e93e74045cbf3cea3e0f319ecea041d4e..475410ada60abbbbfd721898bb5a3c9a377c4301 100644 (file)
@@ -11,6 +11,7 @@ extern struct platform_device mxc_i2c_device1;
 extern struct platform_device mxc_i2c_device2;
 extern struct platform_device mx3_ipu;
 extern struct platform_device mx3_fb;
+extern struct platform_device mx3_camera;
 extern struct platform_device mxc_fec_device;
 extern struct platform_device mxcsdhc_device0;
 extern struct platform_device mxcsdhc_device1;