From patchwork Thu Apr 18 08:02:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 2457741 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C7905DF2E5 for ; Thu, 18 Apr 2013 08:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966004Ab3DRICp (ORCPT ); Thu, 18 Apr 2013 04:02:45 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:34758 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965925Ab3DRICn (ORCPT ); Thu, 18 Apr 2013 04:02:43 -0400 Received: by mail-we0-f182.google.com with SMTP id m1so1978586wea.13 for ; Thu, 18 Apr 2013 01:02:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent:x-gm-message-state; bh=EBlLNA1OVpBBn/7N3GveW7/GU6TKOcf29TB37mRD+Jc=; b=SNQmcYR4ZIW/o5bH66idSS+p9jdSVHHuzuYntgWUps9513PiOxFLf2OHY+AREDxq7r eijQt4cSkChVlZTxEv0Ao7Gig46eAGWCMApA000JwZj8sXiEguc5QmgTTCrBqlZpAMpm 1TKwUWTMxd+WZHTyul7rH/gnc6hJIwWUTMiPnKTJrRP4x2SzclzW/GlgyyiavLflsaPW W3nzRrbbCmtIRNjT6iE3fZQTkPonmMGGdvBaKS095P2081TZft3+PUqmZckGe/sbR3Hc qFQ53qqY5aUfQIfewBkTED3sf3TmG0eVPy8IvK5UpuMDYzwq/cp8Kqrs6WScAIGwVRy8 rNag== X-Received: by 10.180.72.165 with SMTP id e5mr31246859wiv.7.1366272162323; Thu, 18 Apr 2013 01:02:42 -0700 (PDT) Received: from gmail.com (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id o3sm14398348wia.2.2013.04.18.01.02.40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Apr 2013 01:02:41 -0700 (PDT) Date: Thu, 18 Apr 2013 09:02:38 +0100 From: Lee Jones To: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linus.walleij@stericsson.com, Russell King , Chris Ball , linux-mmc@vger.kernel.org Subject: Re: [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT Message-ID: <20130418080238.GB3137@gmail.com> References: <1366205534-25079-1-git-send-email-lee.jones@linaro.org> <201304171550.56037.arnd@arndb.de> <20130417150437.GA3137@gmail.com> <201304171731.56292.arnd@arndb.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201304171731.56292.arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkltAY23gXak/tYjTUZVwObUx+V1ijjtG/0VUscFdCfwxS7dOHCwQJnImudHJdD/U/mxsyw Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org > I think you can further simplify this, given that in the DT case we always > allocate a zeroed mmci_platform_data for host->plat, so !plat cannot happen > when we get here. Okay, third time lucky. :) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 372e921..3260ab4 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -298,14 +298,16 @@ static void mmci_init_sg(struct mmci_host *host, struct mmc_data *data) * no custom DMA interfaces are supported. */ #ifdef CONFIG_DMA_ENGINE -static void mmci_dma_setup(struct mmci_host *host) +static void mmci_dma_setup(struct amba_device *dev, + struct mmci_host *host) { + struct device_node *np = dev->dev.of_node; struct mmci_platform_data *plat = host->plat; const char *rxname, *txname; dma_cap_mask_t mask; - if (!plat || !plat->dma_filter) { - dev_info(mmc_dev(host->mmc), "no DMA platform data\n"); + if (!(plat->dma_filter || np)) { + dev_info(mmc_dev(host->mmc), "no DMA platform data or DT\n"); return; } @@ -321,19 +323,21 @@ static void mmci_dma_setup(struct mmci_host *host) * attempt to use it bidirectionally, however if it is * is specified but cannot be located, DMA will be disabled. */ - if (plat->dma_rx_param) { - host->dma_rx_channel = dma_request_channel(mask, - plat->dma_filter, - plat->dma_rx_param); + if (plat->dma_rx_param || np) { + host->dma_rx_channel = dma_request_slave_channel_compat(mask, + plat->dma_filter, + plat->dma_rx_param, + &dev->dev, "rx"); /* E.g if no DMA hardware is present */ if (!host->dma_rx_channel) dev_err(mmc_dev(host->mmc), "no RX DMA channel\n"); } - if (plat->dma_tx_param) { - host->dma_tx_channel = dma_request_channel(mask, - plat->dma_filter, - plat->dma_tx_param); + if (plat->dma_tx_param || np) { + host->dma_tx_channel = dma_request_slave_channel_compat(mask, + plat->dma_filter, + plat->dma_tx_param, + &dev->dev, "tx"); if (!host->dma_tx_channel) dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n"); } else { @@ -1538,7 +1542,7 @@ static int mmci_probe(struct amba_device *dev, amba_rev(dev), (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]); - mmci_dma_setup(host); + mmci_dma_setup(dev, host); pm_runtime_set_autosuspend_delay(&dev->dev, 50); pm_runtime_use_autosuspend(&dev->dev);