All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@nokia.com>
To: "Hunter Adrian (Nokia-D/Helsinki)" <adrian.hunter@nokia.com>
Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>,
	"Lavinen Jarkko (Nokia-D/Helsinki)" <jarkko.lavinen@nokia.com>,
	Grazvydas Ignotas <notasas@gmail.com>,
	David Brownell <david-b@pacbell.net>,
	linux-omap Mailing List <linux-omap@vger.kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 9/10] OMAP: HSMMC: Fix MMC3 dma
Date: Fri, 13 Mar 2009 12:16:11 +0200	[thread overview]
Message-ID: <49BA326B.8030305@nokia.com> (raw)
In-Reply-To: <20090312162353.19421.55941.sendpatchset@ahunter-laptop>

>From 6cdb22ab764bf852097674c26d521d3e8a1e5581 Mon Sep 17 00:00:00 2001
From: Grazvydas Ignotas <notasas@gmail.com>
Date: Sat, 3 Jan 2009 10:36:13 +0000
Subject: [PATCH] OMAP: HSMMC: Fix MMC3 dma

Data transfers on third OMAP3 MMC controller don't work
because DMA line numbers are only defined for MMC1 and MMC2.
Fix that and store line numbers in mmc_omap_host structure
to reduce code size.
Tested on OMAP3 pandora board.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---



This time with Grazvydas Ignotas email address fixed.



 drivers/mmc/host/omap_hsmmc.c |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 0e47073..91381f4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -100,6 +100,7 @@
  */
 #define OMAP_MMC1_DEVID		0
 #define OMAP_MMC2_DEVID		1
+#define OMAP_MMC3_DEVID		2
 
 #define MMC_TIMEOUT_MS		20
 #define OMAP_MMC_MASTER_CLOCK	96000000
@@ -147,6 +148,7 @@ struct mmc_omap_host {
 	int			irq;
 	int			carddetect;
 	int			use_dma, dma_ch;
+	int			dma_line_tx, dma_line_rx;
 	int			slot_id;
 	int			dbclk_enabled;
 	int			response_busy;
@@ -652,17 +654,10 @@ static int mmc_omap_get_dma_sync_dev(struct mmc_omap_host *host,
 {
 	int sync_dev;
 
-	if (data->flags & MMC_DATA_WRITE) {
-		if (host->id == OMAP_MMC1_DEVID)
-			sync_dev = OMAP24XX_DMA_MMC1_TX;
-		else
-			sync_dev = OMAP24XX_DMA_MMC2_TX;
-	} else {
-		if (host->id == OMAP_MMC1_DEVID)
-			sync_dev = OMAP24XX_DMA_MMC1_RX;
-		else
-			sync_dev = OMAP24XX_DMA_MMC2_RX;
-	}
+	if (data->flags & MMC_DATA_WRITE)
+		sync_dev = host->dma_line_tx;
+	else
+		sync_dev = host->dma_line_rx;
 	return sync_dev;
 }
 
@@ -1134,6 +1129,25 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
 
 	omap_hsmmc_init(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;
+	default:
+		dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
+		goto err_irq;
+	}
+
 	/* Request IRQ for MMC operations */
 	ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED,
 			mmc_hostname(mmc), host);
-- 
1.5.6.3


  reply	other threads:[~2009-03-13 10:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 16:22 [PATCH 0/10] omap_hsmmc patches Adrian Hunter
2009-03-12 16:22 ` [PATCH 1/10] OMAP: HSMMC: Do dma cleanup also with data CRC errors Adrian Hunter
2009-03-12 16:23 ` [PATCH 2/10] OMAP: HSMMC: Fix response type for busy after response Adrian Hunter
2009-03-12 16:23 ` [PATCH 3/10] OMAP: HSMMC: Implement scatter-gather emulation Adrian Hunter
2009-03-12 16:23 ` [PATCH 4/10] OMAP: HSMMC: Add 8-bit bus width mode support Adrian Hunter
2009-03-12 16:23 ` [PATCH 5/10] OMAP: HSMMC: Allow cover switch to cause rescan Adrian Hunter
2009-03-12 16:23 ` [PATCH 6/10] OMAP: HSMMC: Do not prefix slot name Adrian Hunter
2009-03-12 16:23 ` [PATCH 7/10] OMAP: HSMMC: Disable SDBP at suspend Adrian Hunter
2009-03-12 16:23 ` [PATCH 8/10] OMAP: HSMMC: Make driver support dynamic idle Adrian Hunter
2009-03-22 14:30   ` Pierre Ossman
2009-03-22 14:30     ` Pierre Ossman
2009-03-12 16:23 ` [PATCH 9/10] OMAP: HSMMC: Fix MMC3 dma Adrian Hunter
2009-03-13 10:16   ` Adrian Hunter [this message]
2009-03-12 16:24 ` [PATCH 10/10] OMAP: HSMMC: Wait for SDBP Adrian Hunter
2009-03-22 14:31 ` [PATCH 0/10] omap_hsmmc patches Pierre Ossman
2009-03-22 14:31   ` Pierre Ossman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49BA326B.8030305@nokia.com \
    --to=adrian.hunter@nokia.com \
    --cc=david-b@pacbell.net \
    --cc=drzeus-mmc@drzeus.cx \
    --cc=jarkko.lavinen@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=notasas@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.