From patchwork Sat Jul 16 20:44:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Arnaud Patard (Rtp)" X-Patchwork-Id: 982542 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6GLIS5W026486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 16 Jul 2011 21:18:48 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QiCFW-00046s-Rg; Sat, 16 Jul 2011 21:18:11 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QiCFV-0003pu-R0; Sat, 16 Jul 2011 21:18:09 +0000 Received: from lebrac.rtp-net.org ([88.191.135.105]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QiCET-0003e7-E6 for linux-arm-kernel@lists.infradead.org; Sat, 16 Jul 2011 21:17:07 +0000 Received: by lebrac.rtp-net.org (Postfix, from userid 1000) id 8F94F29260; Sat, 16 Jul 2011 23:16:41 +0200 (CEST) Message-Id: <20110716210149.854331030@rtp-net.org> User-Agent: quilt/0.48-1 Date: Sat, 16 Jul 2011 22:44:12 +0200 From: Arnaud Patard (Rtp) To: linux-arm-kernel@lists.infradead.org Subject: [patch 1/3] imx51: add pata device References: <20110716204411.832712955@rtp-net.org> Content-Disposition: inline; filename=efika_pata_add_dev.patch X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110716_171705_827219_DE43E02D X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: s.hauer@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 16 Jul 2011 21:18:48 +0000 (UTC) Declare the pata device found on mx51 Signed-off-by: Arnaud Patard Index: linux-2.6-submit/arch/arm/mach-mx5/devices-imx51.h =================================================================== --- linux-2.6-submit.orig/arch/arm/mach-mx5/devices-imx51.h 2011-07-16 16:16:40.000000000 +0200 +++ linux-2.6-submit/arch/arm/mach-mx5/devices-imx51.h 2011-07-16 16:20:33.000000000 +0200 @@ -52,3 +52,5 @@ extern const struct imx_mxc_pwm_data imx extern const struct imx_imx_keypad_data imx51_imx_keypad_data; #define imx51_add_imx_keypad(pdata) \ imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) + +extern const struct imx_mxc_pata_data im51_mxc_pata_data; Index: linux-2.6-submit/arch/arm/plat-mxc/devices/Kconfig =================================================================== --- linux-2.6-submit.orig/arch/arm/plat-mxc/devices/Kconfig 2011-07-16 16:16:40.000000000 +0200 +++ linux-2.6-submit/arch/arm/plat-mxc/devices/Kconfig 2011-07-16 16:20:08.000000000 +0200 @@ -31,6 +31,9 @@ config IMX_HAVE_PLATFORM_IMX_I2C config IMX_HAVE_PLATFORM_IMX_KEYPAD bool +config IMX_HAVE_PLATFORM_IMX_PATA + bool + config IMX_HAVE_PLATFORM_IMX_SSI bool Index: linux-2.6-submit/arch/arm/plat-mxc/devices/Makefile =================================================================== --- linux-2.6-submit.orig/arch/arm/plat-mxc/devices/Makefile 2011-07-16 16:16:40.000000000 +0200 +++ linux-2.6-submit/arch/arm/plat-mxc/devices/Makefile 2011-07-16 16:20:08.000000000 +0200 @@ -10,6 +10,7 @@ obj-y += platform-imx-dma.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_PATA) += platform-imx-pata.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o Index: linux-2.6-submit/arch/arm/plat-mxc/devices/platform-imx-pata.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-submit/arch/arm/plat-mxc/devices/platform-imx-pata.c 2011-07-16 16:20:08.000000000 +0200 @@ -0,0 +1,38 @@ +/* + * 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_mxc_pata_data_entry_single(soc) \ + { \ + .iobase = soc ## _ATA_BASE_ADDR, \ + .irq = soc ## _MXC_INT_ATA, \ + } + +#ifdef CONFIG_SOC_IMX51 +const struct imx_mxc_pata_data im51_mxc_pata_data __initconst = + imx_mxc_pata_data_entry_single(MX51); +#endif /* ifdef CONFIG_SOC_IMX51 */ + +struct platform_device *__init imx_add_mxc_pata( + const struct imx_mxc_pata_data *data) +{ + struct resource res[] = { + { + .start = data->iobase, + .end = data->iobase + SZ_16K - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = data->irq, + .end = data->irq, + .flags = IORESOURCE_IRQ, + }, + }; + return imx_add_platform_device("pata_imx", -1, + res, ARRAY_SIZE(res), NULL, 0); +} + Index: linux-2.6-submit/arch/arm/plat-mxc/include/mach/devices-common.h =================================================================== --- linux-2.6-submit.orig/arch/arm/plat-mxc/include/mach/devices-common.h 2011-07-16 16:16:40.000000000 +0200 +++ linux-2.6-submit/arch/arm/plat-mxc/include/mach/devices-common.h 2011-07-16 16:20:08.000000000 +0200 @@ -250,6 +250,13 @@ struct platform_device *__init imx_add_m const struct imx_mxc_nand_data *data, const struct mxc_nand_platform_data *pdata); +struct imx_mxc_pata_data { + resource_size_t iobase; + resource_size_t irq; +}; +struct platform_device *__init imx_add_mxc_pata( + const struct imx_mxc_pata_data *data); + struct imx_mxc_pwm_data { int id; resource_size_t iobase;