From patchwork Sun Jul 21 06:58:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 2830898 Return-Path: X-Original-To: patchwork-davinci@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 63A099F4D4 for ; Sun, 21 Jul 2013 07:00:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87EF720168 for ; Sun, 21 Jul 2013 07:00:44 +0000 (UTC) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 832302013C for ; Sun, 21 Jul 2013 07:00:43 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6L6xJn5003636; Sun, 21 Jul 2013 01:59:19 -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 r6L6xJJ9002335; Sun, 21 Jul 2013 01:59:19 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Sun, 21 Jul 2013 01:59:19 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6L6xJMh001857; Sun, 21 Jul 2013 01:59:19 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 14A3F8062E; Sun, 21 Jul 2013 01:59:19 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv90.itg.ti.com (dlelxv90.itg.ti.com [172.17.2.17]) by linux.omap.com (Postfix) with ESMTP id 9545380627 for ; Sun, 21 Jul 2013 01:58:25 -0500 (CDT) 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 r6L6wPJv032366; Sun, 21 Jul 2013 01:58:25 -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; Sun, 21 Jul 2013 01:58:25 -0500 Received: from joel-laptop.itg.ti.com (h56-25.vpn.ti.com [172.24.56.25]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6L6wHex011458; Sun, 21 Jul 2013 01:58:24 -0500 From: Joel Fernandes To: Tony Lindgren , Sekhar Nori , Santosh Shilimkar , Sricharan R , Rajendra Nayak , Lokesh Vutla , Matt Porter , Grant Likely , Rob Herring , Vinod Koul , Dan Williams , Mark Brown , Benoit Cousson , Russell King , Arnd Bergmann , Balaji TK , Gururaja Hebbar , Chris Ball , Jason Kridner Subject: [RFC 3/5] ARM: edma: Add function to manually trigger an EDMA channel Date: Sun, 21 Jul 2013 01:58:16 -0500 Message-ID: <1374389896-32584-1-git-send-email-joelf@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 CC: Linux DaVinci Kernel List , Joel Fernandes , Linux MMC List , Linux Kernel Mailing List , Linux OMAP List , Linux ARM Kernel List X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Manual trigger for events missed as a result of splitting a scatter gather list and DMA'ing it in batches. Add a helper function to trigger a channel incase any such events are missed. Signed-off-by: Joel Fernandes --- arch/arm/common/edma.c | 21 +++++++++++++++++++++ include/linux/platform_data/edma.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 3567ba1..205f5da 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c @@ -1236,6 +1236,27 @@ void edma_resume(unsigned channel) } EXPORT_SYMBOL(edma_resume); +int edma_manual_trigger(unsigned channel) +{ + unsigned ctlr; + int j; + unsigned int mask; + + ctlr = EDMA_CTLR(channel); + channel = EDMA_CHAN_SLOT(channel); + mask = BIT(channel & 0x1f); + + j = channel >> 5; + + /* EDMA channels without event association */ + edma_shadow0_write_array(ctlr, SH_ESR, j, mask); + + pr_debug("EDMA: ESR%d %08x\n", j, + edma_shadow0_read_array(ctlr, SH_ESR, j)); + return 0; +} +EXPORT_SYMBOL(edma_manual_trigger); + /** * edma_start - start dma on a channel * @channel: channel being activated diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h index 57300fd..0e11eca 100644 --- a/include/linux/platform_data/edma.h +++ b/include/linux/platform_data/edma.h @@ -180,4 +180,6 @@ struct edma_soc_info { const s16 (*xbar_chans)[2]; }; +int edma_manual_trigger(unsigned); + #endif