From patchwork Tue Sep 4 12:56:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Carlier?= X-Patchwork-Id: 181551 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AF0A72C0099 for ; Tue, 4 Sep 2012 23:02:39 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T8siW-00017x-L3; Tue, 04 Sep 2012 12:58:56 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T8siT-00017Y-Id for linux-arm-kernel@lists.infradead.org; Tue, 04 Sep 2012 12:58:54 +0000 Received: by weyr3 with SMTP id r3so3605604wey.36 for ; Tue, 04 Sep 2012 05:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=LtVr3O3RaIs7Z0TMHZ9dJtbjXDRRxsx0Iq4bwDhcexY=; b=iiLB8upAQGATN5zE48RJDXPo7MEeHPr8yyPuHDM+nX+SPSIsOq6OnN6llC2LFVqDUm 1EUkIvreFGZL4cPflIOUHForbDkcqX9hKuDJPBVRxQ6liFV6I7pWLN5lQ/n8ahbNIr+5 gw3MBXG9mfhLyzsNQpw7l8u4aTRQ+oP7lExN2OXzpoqNCACOKJiX+xyXi5j4AOAftaIk /xTp1kNWR+sOEemRZbnz2j+Km/yaxCGn1jH8u2vqIMMS6aubgLqPrr8Ues6vOHwe2N77 qjB6K2KePiM2oPs16AJe++Pcdwl+5TF8BoYuDNFHBvnlgpxpj6Ip8rESC9pRnaR9BuU0 LjqA== Received: by 10.180.91.1 with SMTP id ca1mr23994662wib.8.1346763530063; Tue, 04 Sep 2012 05:58:50 -0700 (PDT) Received: from t410.TRUMP (34.16-66-87.adsl-static.isp.belgacom.be. [87.66.16.34]) by mx.google.com with ESMTPS id l5sm36115524wix.5.2012.09.04.05.58.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 05:58:49 -0700 (PDT) From: =?UTF-8?q?Ga=C3=ABtan=20Carlier?= To: Sascha Hauer , Russell King , Javier Martin Subject: [PATCH] ARM : i.MX27 : split code for allocation of ressources of camera and eMMA Date: Tue, 4 Sep 2012 14:56:38 +0200 Message-Id: <1346763398-13536-1-git-send-email-gcembed@gmail.com> X-Mailer: git-send-email 1.7.7.4 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gcembed[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Dong Aisheng , =?UTF-8?q?Ga=C3=ABtan=20Carlier?= , Richard Zhu , linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org IMX_HAVE_PLATFORM_MX2_EMMA define has been added. Signed-off-by: Gaƫtan Carlier --- arch/arm/mach-imx/devices-imx27.h | 4 ++- arch/arm/plat-mxc/devices/Kconfig | 3 ++ arch/arm/plat-mxc/devices/Makefile | 1 + arch/arm/plat-mxc/devices/platform-mx2-camera.c | 17 --------- arch/arm/plat-mxc/devices/platform-mx2-emma.c | 41 +++++++++++++++++++++++ arch/arm/plat-mxc/include/mach/devices-common.h | 9 ++++- 6 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 arch/arm/plat-mxc/devices/platform-mx2-emma.c diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 0482293..d8eb4a0 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h @@ -54,8 +54,10 @@ extern const struct imx_imx_uart_1irq_data imx27_imx_uart_data[]; extern const struct imx_mx2_camera_data imx27_mx2_camera_data; #define imx27_add_mx2_camera(pdata) \ imx_add_mx2_camera(&imx27_mx2_camera_data, pdata) + +extern const struct imx_mx2_emma_data imx27_mx2_emmaprp_data; #define imx27_add_mx2_emmaprp() \ - imx_add_mx2_emmaprp(&imx27_mx2_camera_data) + imx_add_mx2_emmaprp(&imx27_mx2_emmaprp_data) extern const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data; #define imx27_add_mxc_ehci_otg(pdata) \ diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 6b46cee..96feef7 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig @@ -56,6 +56,9 @@ config IMX_HAVE_PLATFORM_MX1_CAMERA config IMX_HAVE_PLATFORM_MX2_CAMERA bool +config IMX_HAVE_PLATFORM_MX2_EMMA + bool + config IMX_HAVE_PLATFORM_MXC_EHCI bool diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 76f3195..7292c1f 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile @@ -28,3 +28,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += platform-ahci-imx.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_EMMA) += platform-mx2-emma.o diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c index 11eace9..11c688f 100644 --- a/arch/arm/plat-mxc/devices/platform-mx2-camera.c +++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c @@ -63,20 +63,3 @@ struct platform_device *__init imx_add_mx2_camera( pdata, sizeof(*pdata), DMA_BIT_MASK(32)); } -struct platform_device *__init imx_add_mx2_emmaprp( - const struct imx_mx2_camera_data *data) -{ - struct resource res[] = { - { - .start = data->iobaseemmaprp, - .end = data->iobaseemmaprp + data->iosizeemmaprp - 1, - .flags = IORESOURCE_MEM, - }, { - .start = data->irqemmaprp, - .end = data->irqemmaprp, - .flags = IORESOURCE_IRQ, - }, - }; - return imx_add_platform_device_dmamask("m2m-emmaprp", 0, - res, 2, NULL, 0, DMA_BIT_MASK(32)); -} diff --git a/arch/arm/plat-mxc/devices/platform-mx2-emma.c b/arch/arm/plat-mxc/devices/platform-mx2-emma.c new file mode 100644 index 0000000..a51749a --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mx2-emma.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2010 Pengutronix + * Uwe Kleine-Koenig + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ +#include +#include + +#define imx_mx2_emmaprp_data_entry_single(soc) \ + { \ + .iobase = soc ## _EMMAPRP_BASE_ADDR, \ + .iosize = SZ_32, \ + .irq = soc ## _INT_EMMAPRP, \ + } + +#ifdef CONFIG_SOC_IMX27 +const struct imx_mx2_emma_data imx27_mx2_emmaprp_data __initconst = + imx_mx2_emmaprp_data_entry_single(MX27); +#endif /* ifdef CONFIG_SOC_IMX27 */ + +struct platform_device *__init imx_add_mx2_emmaprp( + const struct imx_mx2_emma_data *data) +{ + struct resource res[] = { + { + .start = data->iobase, + .end = data->iobase + data->iosize - 1, + .flags = IORESOURCE_MEM, + }, { + .start = data->irq, + .end = data->irq, + .flags = IORESOURCE_IRQ, + }, + }; + return imx_add_platform_device_dmamask("m2m-emmaprp", 0, + res, 2, NULL, 0, DMA_BIT_MASK(32)); +} + diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 762780c..2117072 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h @@ -229,8 +229,15 @@ struct imx_mx2_camera_data { struct platform_device *__init imx_add_mx2_camera( const struct imx_mx2_camera_data *data, const struct mx2_camera_platform_data *pdata); + + +struct imx_mx2_emma_data { + resource_size_t iobase; + resource_size_t iosize; + resource_size_t irq; +}; struct platform_device *__init imx_add_mx2_emmaprp( - const struct imx_mx2_camera_data *data); + const struct imx_mx2_emma_data *data); #include struct imx_mxc_ehci_data {