From patchwork Fri Nov 27 08:29:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 7711501 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55432BF90C for ; Fri, 27 Nov 2015 08:31:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AD452054B for ; Fri, 27 Nov 2015 08:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FD832045B for ; Fri, 27 Nov 2015 08:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754084AbbK0Iau (ORCPT ); Fri, 27 Nov 2015 03:30:50 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:57541 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754103AbbK0Iah (ORCPT ); Fri, 27 Nov 2015 03:30:37 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id tAR8U8n9028875; Fri, 27 Nov 2015 02:30:08 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAR8U73w012506; Fri, 27 Nov 2015 02:30:08 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Fri, 27 Nov 2015 02:30:04 -0600 Received: from dlep32.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAR8TjEV016879; Fri, 27 Nov 2015 02:30:02 -0600 From: Peter Ujfalusi To: , , CC: , , , , , Subject: [RFC 5/6] ARM: davinci: devices-da8xx: device -> dma instance mapping support Date: Fri, 27 Nov 2015 10:29:41 +0200 Message-ID: <1448612982-28141-6-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1448612982-28141-1-git-send-email-peter.ujfalusi@ti.com> References: <1448612982-28141-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 In order to switch the driver to use the new simpler dmaengine API the device mapping for the dma instances needs to be added and also the DMA resources should be named. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-davinci/devices-da8xx.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 28c90bc372bd..e7e042dd7603 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -233,12 +233,28 @@ static const struct platform_device_info da850_edma1_device __initconst = { .size_data = sizeof(da850_edma1_pdata), }; +static char *da8xx_edma0_devices[] = { + "davinci-mcasp.0", + "davinci-mcasp.1", + "davinci-mcasp.2", + "da830-mmc.0", + "spi_davinci.0", + "spi_davinci.1", +}; + +static char *da850_edma1_devices[] = { + "da830-mmc.1", +}; + int __init da830_register_edma(struct edma_rsv_info *rsv) { struct platform_device *edma_pdev; da8xx_edma0_pdata.rsv = rsv; + da8xx_edma0_pdata.devnames = da8xx_edma0_devices; + da8xx_edma0_pdata.devcnt = ARRAY_SIZE(da8xx_edma0_devices); + edma_pdev = platform_device_register_full(&da8xx_edma0_device); return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0; } @@ -252,11 +268,18 @@ int __init da850_register_edma(struct edma_rsv_info *rsv[2]) da850_edma1_pdata.rsv = rsv[1]; } + da8xx_edma0_pdata.devnames = da8xx_edma0_devices; + da8xx_edma0_pdata.devcnt = ARRAY_SIZE(da8xx_edma0_devices); + edma_pdev = platform_device_register_full(&da8xx_edma0_device); if (IS_ERR(edma_pdev)) { pr_warn("%s: Failed to register eDMA0\n", __func__); return PTR_ERR(edma_pdev); } + + da850_edma1_pdata.devnames = da850_edma1_devices; + da850_edma1_pdata.devcnt = ARRAY_SIZE(da850_edma1_devices); + edma_pdev = platform_device_register_full(&da850_edma1_device); return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0; } @@ -706,11 +729,13 @@ static struct resource da8xx_mmcsd0_resources[] = { .flags = IORESOURCE_IRQ, }, { /* DMA RX */ + .name = "rx", .start = DA8XX_DMA_MMCSD0_RX, .end = DA8XX_DMA_MMCSD0_RX, .flags = IORESOURCE_DMA, }, { /* DMA TX */ + .name = "tx", .start = DA8XX_DMA_MMCSD0_TX, .end = DA8XX_DMA_MMCSD0_TX, .flags = IORESOURCE_DMA, @@ -743,11 +768,13 @@ static struct resource da850_mmcsd1_resources[] = { .flags = IORESOURCE_IRQ, }, { /* DMA RX */ + .name = "rx", .start = DA850_DMA_MMCSD1_RX, .end = DA850_DMA_MMCSD1_RX, .flags = IORESOURCE_DMA, }, { /* DMA TX */ + .name = "tx", .start = DA850_DMA_MMCSD1_TX, .end = DA850_DMA_MMCSD1_TX, .flags = IORESOURCE_DMA, @@ -939,11 +966,13 @@ static struct resource da8xx_spi0_resources[] = { .flags = IORESOURCE_IRQ, }, [2] = { + .name = "rx", .start = DA8XX_DMA_SPI0_RX, .end = DA8XX_DMA_SPI0_RX, .flags = IORESOURCE_DMA, }, [3] = { + .name = "tx", .start = DA8XX_DMA_SPI0_TX, .end = DA8XX_DMA_SPI0_TX, .flags = IORESOURCE_DMA, @@ -962,11 +991,13 @@ static struct resource da8xx_spi1_resources[] = { .flags = IORESOURCE_IRQ, }, [2] = { + .name = "rx", .start = DA8XX_DMA_SPI1_RX, .end = DA8XX_DMA_SPI1_RX, .flags = IORESOURCE_DMA, }, [3] = { + .name = "tx", .start = DA8XX_DMA_SPI1_TX, .end = DA8XX_DMA_SPI1_TX, .flags = IORESOURCE_DMA,