From patchwork Thu Sep 20 14:43:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1485781 Return-Path: X-Original-To: patchwork-linux-omap@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 1FEA7DF2D2 for ; Thu, 20 Sep 2012 14:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755890Ab2ITOme (ORCPT ); Thu, 20 Sep 2012 10:42:34 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:51869 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755872Ab2ITOma (ORCPT ); Thu, 20 Sep 2012 10:42:30 -0400 Received: by mail-iy0-f174.google.com with SMTP id k25so1691219iah.19 for ; Thu, 20 Sep 2012 07:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=WIgIyeI3WIbMRpEYKw4CEUNLmoxHuYsou0GiCA2Ta5k=; b=qSD9hZyMPJFGRAUW8Vinjw7WZw5BAAagCVuPNlsDLFrqLwTQz4zeXsFmuwLCzgoH2N mw1YokBZegrDdm/6sycWAe0A1VgcVh8J3i7bDVmVOJSDUZouHjOwq7Ch30FUHExIQSaI c/bNWa3L242F/Q8IaGw4VZRvA9ecvNWPJbtuiwPi8BOIZHnlm4rMWRTbRnehkX0bs9iY rPvEqmZEtDr7BuhvgcRSbjpDZolzEyHJzVLGCugqKncXf5Tr+aZKlL423seJ/78tM5iJ jB6ZPg/N8IIfWm9nVaLqFRhkQbjd6bXTxN46IA9YBwyeXn8IpbWbAY3aX59lgLG3Serz stCA== Received: by 10.43.133.196 with SMTP id hz4mr1557293icc.52.1348152149963; Thu, 20 Sep 2012 07:42:29 -0700 (PDT) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id p5sm15288242igm.13.2012.09.20.07.42.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 07:42:29 -0700 (PDT) From: Matt Porter To: Tony Lindgren , Sekhar Nori , Grant Likely , Mark Brown , Benoit Cousson , Russell King , Vinod Koul , Rob Landley , Chris Ball Cc: Devicetree Discuss , Linux OMAP List , Linux ARM Kernel List , Linux DaVinci Kernel List , Linux Kernel Mailing List , Linux Documentation List , Linux MMC List , Linux SPI Devel List , Arnd Bergmann , Dan Williams , Rob Herring Subject: [RFC PATCH 07/13] mmc: omap_hsmmc: dma_request_slave_channel() support for DT platforms Date: Thu, 20 Sep 2012 10:43:40 -0400 Message-Id: <1348152226-13588-8-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348152226-13588-1-git-send-email-mporter@ti.com> References: <1348152226-13588-1-git-send-email-mporter@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org For platforms with DT populated, use dma_request_slave_channel() to acquire the DMA channel. For !DT platforms, we fall back to explicitly passing the omap_dma_filter_fn() to dma_request_channel(). Once all platforms boot from DT, the dma_request_channel() path can be dropped. Signed-off-by: Matt Porter --- drivers/mmc/host/omap_hsmmc.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3a09f93..c82d0ab 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1923,14 +1923,26 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req); + if (pdev->dev.of_node) + host->rx_chan = + dma_request_slave_channel(&pdev->dev, "rx"); + else + host->rx_chan = dma_request_channel(mask, + omap_dma_filter_fn, + &rx_req); if (!host->rx_chan) { dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); ret = -ENXIO; goto err_irq; } - host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req); + if (pdev->dev.of_node) + host->tx_chan = + dma_request_slave_channel(&pdev->dev, "tx"); + else + host->tx_chan = dma_request_channel(mask, + omap_dma_filter_fn, + &tx_req); if (!host->tx_chan) { dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); ret = -ENXIO;