From patchwork Wed Sep 11 18:01:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 2874151 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 535A9BF43F for ; Wed, 11 Sep 2013 18:29:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 894A2202EC for ; Wed, 11 Sep 2013 18:29:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A57D202B4 for ; Wed, 11 Sep 2013 18:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755481Ab3IKS3Z (ORCPT ); Wed, 11 Sep 2013 14:29:25 -0400 Received: from bitmer.com ([213.157.87.50]:45647 "EHLO bitmer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754840Ab3IKS3X (ORCPT ); Wed, 11 Sep 2013 14:29:23 -0400 Received: from host-94-101-4-66.igua.fi ([94.101.4.66] helo=puukko.homenet-68) by bitmer.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1VJog6-0001MK-AH; Wed, 11 Sep 2013 20:58:10 +0300 From: Jarkko Nikula To: linux-mmc@vger.kernel.org Cc: Chris Ball , Aaro Koskinen , Jarkko Nikula Subject: [PATCH 6/6] mmc: omap: Get DMA request numbers via platform resource Date: Wed, 11 Sep 2013 21:01:57 +0300 Message-Id: <1378922517-3968-6-git-send-email-jarkko.nikula@bitmer.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378922517-3968-1-git-send-email-jarkko.nikula@bitmer.com> References: <1378922517-3968-1-git-send-email-jarkko.nikula@bitmer.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 There is no need to define MMC DMA TX and RX request numbers locally for OMAP1xxx and OMAP24xx and assign them non-portable way since they already come via platform resources. See commits 6c432f7 ("ARM: OMAP1: Pass dma request lines in platform data to MMC driver") b955eef ("ARM: OMAP2: Use hwmod to initialize mmc for 2420") Note that mmc_omap_probe doesn't change failure mechanism in case if it fails get DMA request number or DMA channel. In that case it just falls back to PIO transfer for TX and/or RX. Signed-off-by: Jarkko Nikula --- Aaro: Sorry to bother you but I know you have OMAP1xxx based boards and I apreciate if you can give a quick test :-) I have tested this set on OMAP2420 based Nokia N810. --- drivers/mmc/host/omap.c | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index ce455da..5f9e472 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -90,17 +90,6 @@ #define OMAP_MMC_CMDTYPE_AC 2 #define OMAP_MMC_CMDTYPE_ADTC 3 -#define OMAP_DMA_MMC_TX 21 -#define OMAP_DMA_MMC_RX 22 -#define OMAP_DMA_MMC2_TX 54 -#define OMAP_DMA_MMC2_RX 55 - -#define OMAP24XX_DMA_MMC2_TX 47 -#define OMAP24XX_DMA_MMC2_RX 48 -#define OMAP24XX_DMA_MMC1_TX 61 -#define OMAP24XX_DMA_MMC1_RX 62 - - #define DRIVER_NAME "mmci-omap" /* Specifies how often in millisecs to poll for card status changes @@ -1326,7 +1315,6 @@ static int mmc_omap_probe(struct platform_device *pdev) struct mmc_omap_host *host = NULL; struct resource *res; dma_cap_mask_t mask; - unsigned sig; int i, ret = 0; int irq; @@ -1392,22 +1380,21 @@ static int mmc_omap_probe(struct platform_device *pdev) host->dma_tx_burst = -1; host->dma_rx_burst = -1; - if (mmc_omap2()) - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; - else - sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; - host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); + if (res) + host->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, + &res->start); if (!host->dma_tx) - dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", - sig); - if (mmc_omap2()) - sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; - else - sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; - host->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + dev_warn(host->dev, + "unable to obtain TX DMA. Falling back to PIO\n"); + + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); + if (res) + host->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, + &res->start); if (!host->dma_rx) - dev_warn(host->dev, "unable to obtain RX DMA engine channel %u\n", - sig); + dev_warn(host->dev, + "unable to obtain RX DMA. Falling back to PIO\n"); ret = request_irq(host->irq, mmc_omap_irq, 0, DRIVER_NAME, host); if (ret)