From patchwork Tue May 11 08:32:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhvapathi Sriram X-Patchwork-Id: 98662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4B9VgiZ004763 for ; Tue, 11 May 2010 09:31:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757501Ab0EKJbl (ORCPT ); Tue, 11 May 2010 05:31:41 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:36816 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459Ab0EKJbl (ORCPT ); Tue, 11 May 2010 05:31:41 -0400 Received: from dflp53.itg.ti.com ([128.247.5.6]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o4B9VePc018186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 11 May 2010 04:31:40 -0500 Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id o4B9VcE1001848 for ; Tue, 11 May 2010 04:31:39 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id 3D87638872 for ; Tue, 11 May 2010 14:58:04 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id o4B9NHSV019681; Tue, 11 May 2010 14:53:17 +0530 From: Madhvapathi Sriram To: linux-omap@vger.kernel.org Cc: madhu.cr@ti.com, Madhvapathi Sriram Subject: [PATCH 1/1] omap-hsmmc.c: re-organize dma line population Date: Tue, 11 May 2010 14:02:13 +0530 Message-Id: <1273566733-22572-1-git-send-email-sriram.m@ti.com> X-Mailer: git-send-email 1.5.6 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 11 May 2010 09:31:42 +0000 (UTC) diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 95677d1..a62b148 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -30,6 +30,7 @@ #include #include #include +#include #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) @@ -232,7 +233,7 @@ static inline void omap_init_mcpdm(void) {} #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) -#define OMAP_MMC_NR_RES 2 +#define OMAP_MMC_NR_RES 4 /* * Register MMC devices. Called from mach-omap1 and mach-omap2 device init. @@ -255,6 +256,52 @@ int __init omap_mmc_add(const char *name, int id, unsigned long base, res[0].flags = IORESOURCE_MEM; res[1].start = res[1].end = irq; res[1].flags = IORESOURCE_IRQ; + /* Populate DMA lines based on the instance used. Rx first,Tx next*/ + switch (id) { + case 0: + res[2].start = OMAP24XX_DMA_MMC1_RX; + res[2].end = OMAP24XX_DMA_MMC1_RX; + res[2].flags = IORESOURCE_DMA; + res[3].start = OMAP24XX_DMA_MMC1_TX; + res[3].end = OMAP24XX_DMA_MMC1_TX; + res[3].flags = IORESOURCE_DMA; + break; + case 1: + res[2].start = OMAP24XX_DMA_MMC2_RX; + res[2].end = OMAP24XX_DMA_MMC2_RX; + res[2].flags = IORESOURCE_DMA; + res[3].start = OMAP24XX_DMA_MMC2_TX; + res[3].end = OMAP24XX_DMA_MMC2_TX; + res[3].flags = IORESOURCE_DMA; + break; + case 2: + res[2].start = OMAP34XX_DMA_MMC3_RX; + res[2].end = OMAP34XX_DMA_MMC3_RX; + res[2].flags = IORESOURCE_DMA; + res[3].start = OMAP34XX_DMA_MMC3_TX; + res[3].end = OMAP34XX_DMA_MMC3_TX; + res[3].flags = IORESOURCE_DMA; + break; + case 3: + res[2].start = OMAP44XX_DMA_MMC4_RX; + res[2].end = OMAP44XX_DMA_MMC4_RX; + res[2].flags = IORESOURCE_DMA; + res[3].start = OMAP44XX_DMA_MMC4_TX; + res[3].end = OMAP44XX_DMA_MMC4_TX; + res[3].flags = IORESOURCE_DMA; + break; + case 4: + res[2].start = OMAP44XX_DMA_MMC5_RX; + res[2].end = OMAP44XX_DMA_MMC5_RX; + res[2].flags = IORESOURCE_DMA; + res[3].start = OMAP44XX_DMA_MMC5_TX; + res[3].end = OMAP44XX_DMA_MMC5_TX; + res[3].flags = IORESOURCE_DMA; + break; + default: + ret = -ENODEV; + goto fail; + } ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); if (ret == 0) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index e9caf69..61d30ab 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2096,32 +2096,15 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) omap_hsmmc_conf_bus_power(host); - /* Select DMA lines */ - switch (host->id) { - case OMAP_MMC1_DEVID: - host->dma_line_tx = OMAP24XX_DMA_MMC1_TX; - host->dma_line_rx = OMAP24XX_DMA_MMC1_RX; - break; - case OMAP_MMC2_DEVID: - host->dma_line_tx = OMAP24XX_DMA_MMC2_TX; - host->dma_line_rx = OMAP24XX_DMA_MMC2_RX; - break; - case OMAP_MMC3_DEVID: - host->dma_line_tx = OMAP34XX_DMA_MMC3_TX; - host->dma_line_rx = OMAP34XX_DMA_MMC3_RX; - break; - case OMAP_MMC4_DEVID: - host->dma_line_tx = OMAP44XX_DMA_MMC4_TX; - host->dma_line_rx = OMAP44XX_DMA_MMC4_RX; - break; - case OMAP_MMC5_DEVID: - host->dma_line_tx = OMAP44XX_DMA_MMC5_TX; - host->dma_line_rx = OMAP44XX_DMA_MMC5_RX; - break; - default: - dev_err(mmc_dev(host->mmc), "Invalid MMC id\n"); - goto err_irq; - } + res = platform_get_resource(pdev, IORESOURCE_DMA, 0); + if (!res) + goto err1; + host->dma_line_rx = res->start; + + res = platform_get_resource(pdev, IORESOURCE_DMA, 1); + if (!res) + goto err1; + host->dma_line_tx = res->start; /* Request IRQ for MMC operations */ ret = request_irq(host->irq, omap_hsmmc_irq, IRQF_DISABLED,