From patchwork Sat Nov 16 15:53:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 3192891 Return-Path: X-Original-To: patchwork-linux-mmc@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 1E2599F3AE for ; Sat, 16 Nov 2013 15:53:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CF27207B7 for ; Sat, 16 Nov 2013 15:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CB2F2074B for ; Sat, 16 Nov 2013 15:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292Ab3KPPxp (ORCPT ); Sat, 16 Nov 2013 10:53:45 -0500 Received: from bitmer.com ([213.157.87.50]:47031 "EHLO bitmer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108Ab3KPPxn (ORCPT ); Sat, 16 Nov 2013 10:53:43 -0500 Received: from host-94-101-4-66.igua.fi ([94.101.4.66] helo=localhost.localdomain) by bitmer.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1VhiBo-0005zd-OA; Sat, 16 Nov 2013 17:53:40 +0200 From: Jarkko Nikula To: linux-mmc@vger.kernel.org Cc: Chris Ball , Jarkko Nikula Subject: [RESEND 7/8] mmc: omap: Get DMA request numbers via platform resource Date: Sat, 16 Nov 2013 17:53:13 +0200 Message-Id: <1384617194-22126-7-git-send-email-jarkko.nikula@bitmer.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1384617194-22126-1-git-send-email-jarkko.nikula@bitmer.com> References: <1381080978-29127-1-git-send-email-jarkko.nikula@bitmer.com> <1384617194-22126-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=-6.9 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 --- 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 c975051..24235f1 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 @@ -1327,7 +1316,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; @@ -1393,22 +1381,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)