From patchwork Tue Jul 23 16:43:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 2832088 Return-Path: X-Original-To: patchwork-linux-arm@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 653E4C0319 for ; Tue, 23 Jul 2013 16:44:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 681792025C for ; Tue, 23 Jul 2013 16:44:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28E4120262 for ; Tue, 23 Jul 2013 16:44:18 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1fh9-0006k2-Nq; Tue, 23 Jul 2013 16:44:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1fh7-0000vJ-Bd; Tue, 23 Jul 2013 16:44:13 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1fh4-0000uY-Ns for linux-arm-kernel@lists.infradead.org; Tue, 23 Jul 2013 16:44:11 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6NGhTNe028691; Tue, 23 Jul 2013 11:43:29 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6NGhTR1029608; Tue, 23 Jul 2013 11:43:29 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Tue, 23 Jul 2013 11:43:29 -0500 Received: from joel-laptop.am.dhcp.ti.com (joel-laptop.am.dhcp.ti.com [10.247.24.76]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6NGhPme005547; Tue, 23 Jul 2013 11:43:29 -0500 From: Joel Fernandes To: Vinod Koul , Dan Williams Subject: [PATCH] dma: edma: add device_slave_caps() support Date: Tue, 23 Jul 2013 11:43:24 -0500 Message-ID: <1374597804-3961-1-git-send-email-joelf@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130723_124410_855294_483CA417 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -6.9 (------) Cc: Balaji TK , Arnd Bergmann , Tony Lindgren , Linux MMC List , Rajendra Nayak , Sekhar Nori , Koen Kooi , Rob Herring , Linux Kernel Mailing List , Lokesh Vutla , Jason Kridner , Santosh Shilimkar , Joel Fernandes , Linux OMAP List , Linux ARM Kernel List , Matt Porter X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Implement device_slave_caps(). EDMA has a limited number of slots. Slave drivers such as omap_hsmmc will query the driver to make sure they don't pass in more than these many scatter segments. Signed-off-by: Joel Fernandes --- Vinod, or Dan- If this patch looks ok, can you please merge in for -rc cycle? This patch is required to fix MMC support on AM33xx. This patch is blocking 3 other patches which fix various MMC things. Thanks! Notes: (1) this approach is temporary and only for -rc cycle to fix MMC on AM335x. It will be replace by the RFC series in future kernels: http://www.spinics.net/lists/arm-kernel/msg260094.html (2) Patch depends Vinod's patch at: http://permalink.gmane.org/gmane.linux.kernel/1525112 drivers/dma/edma.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 7222cbe..81d5429 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -517,6 +517,14 @@ static void edma_issue_pending(struct dma_chan *chan) spin_unlock_irqrestore(&echan->vchan.lock, flags); } +static inline int edma_slave_caps(struct dma_chan *chan, + struct dma_slave_caps *caps) +{ + caps->max_sg_nr = MAX_NR_SG; + + return 0; +} + static size_t edma_desc_size(struct edma_desc *edesc) { int i; @@ -594,6 +602,7 @@ static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, dma->device_issue_pending = edma_issue_pending; dma->device_tx_status = edma_tx_status; dma->device_control = edma_control; + dma->device_slave_caps = edma_slave_caps; dma->dev = dev; INIT_LIST_HEAD(&dma->channels);