From patchwork Fri Sep 2 10:50:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Wu X-Patchwork-Id: 1121572 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p82AoOts027817 for ; Fri, 2 Sep 2011 10:50:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933369Ab1IBKuW (ORCPT ); Fri, 2 Sep 2011 06:50:22 -0400 Received: from newsmtp5.atmel.com ([204.2.163.5]:46357 "EHLO sjogate2.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933313Ab1IBKuV (ORCPT ); Fri, 2 Sep 2011 06:50:21 -0400 Received: from penbh01.corp.atmel.com ([10.168.5.31]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id p82AkqoX012334; Fri, 2 Sep 2011 03:46:53 -0700 (PDT) Received: from penmb01.corp.atmel.com ([10.168.5.33]) by penbh01.corp.atmel.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 2 Sep 2011 18:50:11 +0800 Received: from localhost.localdomain ([10.217.2.52]) by penmb01.corp.atmel.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 2 Sep 2011 18:50:10 +0800 From: Josh Wu To: linux-arm-kernel@lists.infradead.org Cc: linux-media@vger.kernel.org, nicolas.ferre@atmel.com, g.liakhovetski@gmx.de, Josh Wu Subject: [PATCH] at91: add Atmel ISI and ov2640 support on m10/g45 board. Date: Fri, 2 Sep 2011 18:50:09 +0800 Message-Id: <1314960609-23396-1-git-send-email-josh.wu@atmel.com> X-Mailer: git-send-email 1.6.3.3 X-OriginalArrivalTime: 02 Sep 2011 10:50:10.0630 (UTC) FILETIME=[16257E60:01CC695E] 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.6 (demeter2.kernel.org [140.211.167.43]); Fri, 02 Sep 2011 10:50:25 +0000 (UTC) AT91: m10/g45: add Atmel ISI device and OV2640 on board. Signed-off-by: Josh Wu --- arch/arm/mach-at91/at91sam9g45_devices.c | 66 ++++++++++++++++++++ arch/arm/mach-at91/board-sam9m10g45ek.c | 97 ++++++++++++++++++++++++++++++ arch/arm/mach-at91/include/mach/board.h | 3 +- 3 files changed, 165 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 1e8f275..ea9a161 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c @@ -28,6 +28,8 @@ #include #include +#include + #include "generic.h" @@ -872,6 +874,70 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data) void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} #endif +/* -------------------------------------------------------------------- + * Image Sensor Interface + * -------------------------------------------------------------------- */ +#if defined(CONFIG_VIDEO_ATMEL_ISI) || defined(CONFIG_VIDEO_ATMEL_ISI_MODULE) +static u64 isi_dmamask = DMA_BIT_MASK(32); +static struct isi_platform_data isi_data; + +struct resource isi_resources[] = { + [0] = { + .start = AT91SAM9G45_BASE_ISI, + .end = AT91SAM9G45_BASE_ISI + SZ_16K - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = AT91SAM9G45_ID_ISI, + .end = AT91SAM9G45_ID_ISI, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device at91sam9g45_isi_device = { + .name = "atmel_isi", + .id = 0, + .dev = { + .dma_mask = &isi_dmamask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &isi_data, + }, + .resource = isi_resources, + .num_resources = ARRAY_SIZE(isi_resources), +}; + +void __init at91_add_device_isi(struct isi_platform_data * data) +{ + struct platform_device *pdev; + + if (!data) + return; + isi_data = *data; + + at91_set_A_periph(AT91_PIN_PB20, 0); /* ISI_D0 */ + at91_set_A_periph(AT91_PIN_PB21, 0); /* ISI_D1 */ + at91_set_A_periph(AT91_PIN_PB22, 0); /* ISI_D2 */ + at91_set_A_periph(AT91_PIN_PB23, 0); /* ISI_D3 */ + at91_set_A_periph(AT91_PIN_PB24, 0); /* ISI_D4 */ + at91_set_A_periph(AT91_PIN_PB25, 0); /* ISI_D5 */ + at91_set_A_periph(AT91_PIN_PB26, 0); /* ISI_D6 */ + at91_set_A_periph(AT91_PIN_PB27, 0); /* ISI_D7 */ + at91_set_A_periph(AT91_PIN_PB28, 0); /* ISI_PCK */ + at91_set_A_periph(AT91_PIN_PB30, 0); /* ISI_HSYNC */ + at91_set_A_periph(AT91_PIN_PB29, 0); /* ISI_VSYNC */ + at91_set_B_periph(AT91_PIN_PB31, 0); /* ISI_MCK (PCK1) */ + at91_set_B_periph(AT91_PIN_PB8, 0); /* ISI_PD8 */ + at91_set_B_periph(AT91_PIN_PB9, 0); /* ISI_PD9 */ + at91_set_B_periph(AT91_PIN_PB10, 0); /* ISI_PD10 */ + at91_set_B_periph(AT91_PIN_PB11, 0); /* ISI_PD11 */ + + pdev = &at91sam9g45_isi_device; + platform_device_register(pdev); +} +#else +void __init at91_add_device_isi(struct isi_platform_data * data) { } +#endif + /* -------------------------------------------------------------------- * LCD Controller diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index 6c999db..2ca219e 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c @@ -25,9 +25,12 @@ #include #include #include +#include #include #include