From patchwork Wed Aug 7 15:34:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 2840420 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF5339F479 for ; Wed, 7 Aug 2013 17:33:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 589E720430 for ; Wed, 7 Aug 2013 17:33:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB6AE20435 for ; Wed, 7 Aug 2013 17:33:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V75pN-00075o-Ub; Wed, 07 Aug 2013 15:39:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V75oK-00043E-48; Wed, 07 Aug 2013 15:38:04 +0000 Received: from svenfoo.org ([82.94.215.22] helo=mail.zonque.de) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V75lp-0003km-BO; Wed, 07 Aug 2013 15:35:38 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 0F6EEC05AE; Wed, 7 Aug 2013 17:35:05 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sXa1Qf8QhWY7; Wed, 7 Aug 2013 17:35:04 +0200 (CEST) Received: from tamtam.fritz.box (p5DDC7ADB.dip0.t-ipconnect.de [93.220.122.219]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id A20ECC05AD; Wed, 7 Aug 2013 17:35:02 +0200 (CEST) From: Daniel Mack To: haojian.zhuang@linaro.org, eric.y.miao@gmail.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 18/20] ARM: pxa: register static mmp_pdma device Date: Wed, 7 Aug 2013 17:34:07 +0200 Message-Id: <1375889649-14638-19-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1375889649-14638-1-git-send-email-zonque@gmail.com> References: <1375889649-14638-1-git-send-email-zonque@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130807_113529_726040_E22D79D5 X-CRM114-Status: GOOD ( 15.00 ) X-Spam-Score: 1.5 (+) Cc: mark.rutland@arm.com, s.neumann@raumfeld.com, linux-mtd@lists.infradead.org, Daniel Mack , cxie4@marvell.com, lars@metafoo.de, nico@linaro.org, vinod.koul@intel.com, marek.vasut@gmail.com, ezequiel.garcia@free-electrons.com, rmk+kernel@arm.linux.org.uk, devicetree@vger.kernel.org, samuel@sortiz.org, arnd@arndb.de, broonie@kernel.org, mika.westerberg@linux.intel.com, thomas.petazzoni@free-electrons.com, gregkh@linuxfoundation.org, g.liakhovetski@gmx.de, sachin.kamat@linaro.org, kernel@pengutronix.de, djbw@fb.com, davem@davemloft.net X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,KHOP_BIG_TO_CC,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop the init call to the properietary dma subsystem and register the mmp_pdma device. Signed-off-by: Daniel Mack --- arch/arm/mach-pxa/devices.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-pxa/devices.h | 1 + arch/arm/mach-pxa/pxa25x.c | 9 ++++++--- arch/arm/mach-pxa/pxa27x.c | 9 ++++++--- arch/arm/mach-pxa/pxa3xx.c | 11 +++++++---- 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index eb7afe6..78b7181 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -46,6 +46,32 @@ struct platform_device pxa_device_pmu = { .num_resources = 1, }; +static struct resource pxadma_resources[] = { + [0] = { + .start = 0x40000000, + .end = 0x40001fff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_DMA, + .end = IRQ_DMA, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 pxadma_dmamask = 0xffffffffUL; + +struct platform_device pxa_device_dma = { + .name = "mmp-pdma", + .id = 0, + .dev = { + .dma_mask = &pxadma_dmamask, + .coherent_dma_mask = 0xffffffff, + }, + .num_resources = ARRAY_SIZE(pxadma_resources), + .resource = pxadma_resources, +}; + static struct resource pxamci_resources[] = { [0] = { .start = 0x41100000, diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h index 0f3fd0d..19906c9 100644 --- a/arch/arm/mach-pxa/devices.h +++ b/arch/arm/mach-pxa/devices.h @@ -1,4 +1,5 @@ extern struct platform_device pxa_device_pmu; +extern struct platform_device pxa_device_dma; extern struct platform_device pxa_device_mci; extern struct platform_device pxa3xx_device_mci2; extern struct platform_device pxa3xx_device_mci3; diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index f2c2897..f9b76f7 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include #include "generic.h" @@ -348,6 +348,10 @@ static struct pxa_gpio_platform_data pxa25x_gpio_info __initdata = { .gpio_set_wake = gpio_set_wake, }; +static struct mmp_dma_platdata pxa25x_dma_data __initdata = { + .dma_channels = 16, +}; + static struct platform_device *pxa25x_devices[] __initdata = { &pxa25x_device_udc, &pxa_device_pmu, @@ -371,8 +375,7 @@ static int __init pxa25x_init(void) clkdev_add_table(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs)); - if ((ret = pxa_init_dma(IRQ_DMA, 16))) - return ret; + pxa_register_device(&pxa_device_dma, &pxa25x_dma_data); pxa25x_init_pm(); diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 301471a..0cb17f1 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include "generic.h" @@ -435,6 +435,10 @@ static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = { .gpio_set_wake = gpio_set_wake, }; +static struct mmp_dma_platdata pxa27x_dma_data __initdata = { + .dma_channels = 32, +}; + static struct platform_device *devices[] __initdata = { &pxa27x_device_udc, &pxa_device_pmu, @@ -462,8 +466,7 @@ static int __init pxa27x_init(void) clkdev_add_table(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); - if ((ret = pxa_init_dma(IRQ_DMA, 32))) - return ret; + pxa_register_device(&pxa_device_dma, &pxa27x_dma_data); pxa27x_init_pm(); diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 87011f3..7675a5d 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include @@ -441,6 +441,10 @@ static struct pxa_gpio_platform_data pxa3xx_gpio_pdata = { .irq_base = PXA_GPIO_TO_IRQ(0), }; +static struct mmp_dma_platdata pxa3xx_dma_data __initdata = { + .dma_channels = 32, +}; + static struct platform_device *devices[] __initdata = { &pxa27x_device_udc, &pxa_device_pmu, @@ -478,9 +482,6 @@ static int __init pxa3xx_init(void) clkdev_add_table(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); - if ((ret = pxa_init_dma(IRQ_DMA, 32))) - return ret; - pxa3xx_init_pm(); register_syscore_ops(&pxa_irq_syscore_ops); @@ -490,6 +491,8 @@ static int __init pxa3xx_init(void) if (of_have_populated_dt()) return 0; + pxa_register_device(&pxa_device_dma, &pxa3xx_dma_data); + ret = platform_add_devices(devices, ARRAY_SIZE(devices)); if (ret) return ret;