From patchwork Sat Sep 11 01:34:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 4309 Return-path: Envelope-to: mchehab@pedra Delivery-date: Sat, 11 Sep 2010 10:18:58 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1OuPys-00028O-JU for mchehab@pedra; Sat, 11 Sep 2010 10:18:58 -0300 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Sat, 11 Sep 2010 10:18:58 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OuEzD-0008Ht-4h; Sat, 11 Sep 2010 01:34:35 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753284Ab0IKBec (ORCPT + 1 other); Fri, 10 Sep 2010 21:34:32 -0400 Received: from d1.icnet.pl ([212.160.220.21]:42548 "EHLO d1.icnet.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750916Ab0IKBeb (ORCPT ); Fri, 10 Sep 2010 21:34:31 -0400 Received: from 87-205-12-81.ip.netia.com.pl ([87.205.12.81] helo=vclass.intranet) by d1.icnet.pl with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1OuEz8-00039C-6b; Sat, 11 Sep 2010 03:34:30 +0200 From: Janusz Krzysztofik Organization: Tele-Info-System, Poznan, PL To: "linux-omap@vger.kernel.org" Subject: [RESEND][PATCH v2 2/6] OMAP1: Add support for SoC camera interface Date: Sat, 11 Sep 2010 03:34:02 +0200 User-Agent: KMail/1.9.10 Cc: linux-media@vger.kernel.org, Guennadi Liakhovetski , Tony Lindgren , "Discussion of the Amstrad E3 emailer hardware/software" References: <201009110317.54899.jkrzyszt@tis.icnet.pl> <201009110323.12250.jkrzyszt@tis.icnet.pl> In-Reply-To: <201009110323.12250.jkrzyszt@tis.icnet.pl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201009110334.03905.jkrzyszt@tis.icnet.pl> X-SA-Exim-Scanned: No (on d1.icnet); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab This patch adds support for SoC camera interface to OMAP1 devices. Created and tested against linux-2.6.36-rc3 on Amstrad Delta. For successfull compilation, requires a header file provided by PATCH 1/6 from this series, "SoC Camera: add driver for OMAP1 camera interface". Signed-off-by: Janusz Krzysztofik --- Resend because of wrapped lines, sorry. Janusz v1->v2 changes: - no functional changes, - refreshed against linux-2.6.36-rc3 arch/arm/mach-omap1/devices.c | 43 ++++++++++++++++++++++++++++++ arch/arm/mach-omap1/include/mach/camera.h | 8 +++++ 2 files changed, 51 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -upr linux-2.6.36-rc3.orig/arch/arm/mach-omap1/devices.c linux-2.6.36-rc3/arch/arm/mach-omap1/devices.c --- linux-2.6.36-rc3.orig/arch/arm/mach-omap1/devices.c 2010-09-03 22:29:00.000000000 +0200 +++ linux-2.6.36-rc3/arch/arm/mach-omap1/devices.c 2010-09-09 18:42:30.000000000 +0200 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -25,6 +26,7 @@ #include #include #include +#include /*-------------------------------------------------------------------------*/ @@ -191,6 +193,47 @@ static inline void omap_init_spi100k(voi } #endif + +#define OMAP1_CAMERA_BASE 0xfffb6800 + +static struct resource omap1_camera_resources[] = { + [0] = { + .start = OMAP1_CAMERA_BASE, + .end = OMAP1_CAMERA_BASE + OMAP1_CAMERA_IOSIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = INT_CAMERA, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 omap1_camera_dma_mask = DMA_BIT_MASK(32); + +static struct platform_device omap1_camera_device = { + .name = "omap1-camera", + .id = 0, /* This is used to put cameras on this interface */ + .dev = { + .dma_mask = &omap1_camera_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .num_resources = ARRAY_SIZE(omap1_camera_resources), + .resource = omap1_camera_resources, +}; + +void __init omap1_set_camera_info(struct omap1_cam_platform_data *info) +{ + struct platform_device *dev = &omap1_camera_device; + int ret; + + dev->dev.platform_data = info; + + ret = platform_device_register(dev); + if (ret) + dev_err(&dev->dev, "unable to register device: %d\n", ret); +} + + /*-------------------------------------------------------------------------*/ static inline void omap_init_sti(void) {} diff -upr linux-2.6.36-rc3.orig/arch/arm/mach-omap1/include/mach/camera.h linux-2.6.36-rc3/arch/arm/mach-omap1/include/mach/camera.h --- linux-2.6.36-rc3.orig/arch/arm/mach-omap1/include/mach/camera.h 2010-09-03 22:34:03.000000000 +0200 +++ linux-2.6.36-rc3/arch/arm/mach-omap1/include/mach/camera.h 2010-09-09 18:42:30.000000000 +0200 @@ -0,0 +1,8 @@ +#ifndef __ASM_ARCH_CAMERA_H_ +#define __ASM_ARCH_CAMERA_H_ + +#include + +extern void omap1_set_camera_info(struct omap1_cam_platform_data *); + +#endif /* __ASM_ARCH_CAMERA_H_ */