From patchwork Wed Apr 24 10:58:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16371 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CED3523918 for ; Wed, 24 Apr 2013 10:59:43 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id p7sf2556623qcq.6 for ; Wed, 24 Apr 2013 03:58:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=XIGiXPZt6ooMQx8OCJMkkOdIN2fyDmXxR1leyzuVQPY=; b=CwFYLfOu+rbuxWR+xhX8PG+W4yRDxUYP/MYmIIbK8Lt6rcMF7UqkJvg8k7BdM5hYiS cciI27gRi7JicCU2kPKJXWc7mlb4uSs7t+zgNdYQxdayDCiwnqf6dHn0E+TvDvq6hEi4 9awaG90PO4cexaeyevLitLYTeJRhD9hmgf2HU88jdsHCP9ECtZuMwr5AmeMZsbqAUHJz GdnXijjczKjHgjb0TM83oS4W3QcqcHP72oA0elshdwWXBn5tbyl8LtiR9RO0KtZ/FHrL cxbkZKwy/kFDU63TVljg86EVrTl81fBu0rUkH8hPlNFYsaxgnm6E0DFMcuODmEWwxVjy 0zYQ== X-Received: by 10.224.75.137 with SMTP id y9mr1994584qaj.3.1366801132785; Wed, 24 Apr 2013 03:58:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.41 with SMTP id 9ls885283qez.41.gmail; Wed, 24 Apr 2013 03:58:52 -0700 (PDT) X-Received: by 10.52.96.138 with SMTP id ds10mr21145208vdb.3.1366801132653; Wed, 24 Apr 2013 03:58:52 -0700 (PDT) Received: from mail-vb0-x22c.google.com (mail-vb0-x22c.google.com [2607:f8b0:400c:c02::22c]) by mx.google.com with ESMTPS id m4si1044271vcg.21.2013.04.24.03.58.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 03:58:52 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22c; Received: by mail-vb0-f44.google.com with SMTP id e12so1520100vbg.17 for ; Wed, 24 Apr 2013 03:58:52 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr21206327vdj.75.1366801132525; Wed, 24 Apr 2013 03:58:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp167409veb; Wed, 24 Apr 2013 03:58:51 -0700 (PDT) X-Received: by 10.194.81.71 with SMTP id y7mr67417522wjx.19.1366801131107; Wed, 24 Apr 2013 03:58:51 -0700 (PDT) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [2a00:1450:400c:c05::22b]) by mx.google.com with ESMTPS id cf6si683079wjb.239.2013.04.24.03.58.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 03:58:51 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22b is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22b; Received: by mail-wi0-f171.google.com with SMTP id l13so7272282wie.16 for ; Wed, 24 Apr 2013 03:58:50 -0700 (PDT) X-Received: by 10.194.222.100 with SMTP id ql4mr23672095wjc.59.1366801130413; Wed, 24 Apr 2013 03:58:50 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id g4sm3289782wib.11.2013.04.24.03.58.48 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 03:58:49 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones , Russell King , Chris Ball , linux-mmc@vger.kernel.org Subject: [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT Date: Wed, 24 Apr 2013 11:58:42 +0100 Message-Id: <1366801122-13302-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlgvY0r6dtROkYYcyTsgyBGIZBbLNAixMzr5F7wtVeKJ5HVahX72xERuKvZOsLWockar4mo X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently, if DMA information isn't passed from platform data, then DMA will not be used. This patch allows DMA information obtained though Device Tree to be used as well. Cc: Russell King Cc: Chris Ball Cc: linux-mmc@vger.kernel.org Signed-off-by: Lee Jones --- drivers/mmc/host/mmci.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 372e921..ecd256b 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -304,10 +304,8 @@ static void mmci_dma_setup(struct mmci_host *host) 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"); - return; - } + host->dma_rx_channel = dma_request_slave_channel(dev, "rx"); + host->dma_tx_channel = dma_request_slave_channel(dev, "tx"); /* initialize pre request cookie */ host->next_data.cookie = 1; @@ -316,30 +314,33 @@ static void mmci_dma_setup(struct mmci_host *host) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - /* - * If only an RX channel is specified, the driver will - * 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, + if (plat && plat->dma_filter) { + if (!host->dma_rx_channel && plat->dma_rx_param) { + host->dma_rx_channel = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param); - /* E.g if no DMA hardware is present */ - if (!host->dma_rx_channel) - dev_err(mmc_dev(host->mmc), "no RX DMA channel\n"); - } + /* 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, + if (!host->dma_tx_channel && plat->dma_tx_param) { + host->dma_tx_channel = dma_request_channel(mask, plat->dma_filter, plat->dma_tx_param); - if (!host->dma_tx_channel) - dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n"); - } else { - host->dma_tx_channel = host->dma_rx_channel; + if (!host->dma_tx_channel) + dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n"); + } } + /* + * If only an RX channel is specified, the driver will + * attempt to use it bidirectionally, however if it is + * is specified but cannot be located, DMA will be disabled. + */ + if (host->dma_rx_channel && !host->dma_tx_channel) + host->dma_tx_channel = host->dma_rx_channel; + if (host->dma_rx_channel) rxname = dma_chan_name(host->dma_rx_channel); else