From patchwork Mon Jul 29 13:29:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 2835000 Return-Path: X-Original-To: patchwork-linux-mmc@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 E19BDC0319 for ; Mon, 29 Jul 2013 13:33:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9B002020E for ; Mon, 29 Jul 2013 13:33:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82EAD2021C for ; Mon, 29 Jul 2013 13:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753715Ab3G2Nay (ORCPT ); Mon, 29 Jul 2013 09:30:54 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:41125 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753652Ab3G2Nav (ORCPT ); Mon, 29 Jul 2013 09:30:51 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6TDUDre011126; Mon, 29 Jul 2013 08:30:13 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6TDUDFY007674; Mon, 29 Jul 2013 08:30:13 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Mon, 29 Jul 2013 08:30:12 -0500 Received: from joel-laptop.itg.ti.com (h0-79.vpn.ti.com [172.24.0.79]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6TDTuP1008221; Mon, 29 Jul 2013 08:30:11 -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 , Olof Johansson , Balaji TK , Gururaja Hebbar , Chris Ball , Jason Kridner CC: Linux OMAP List , Linux ARM Kernel List , Linux DaVinci Kernel List , Linux Kernel Mailing List , Linux MMC List , Joel Fernandes Subject: [PATCH 3/9] ARM: edma: Add function to manually trigger an EDMA channel Date: Mon, 29 Jul 2013 08:29:49 -0500 Message-ID: <1375104595-16018-4-git-send-email-joelf@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1375104595-16018-1-git-send-email-joelf@ti.com> References: <1375104595-16018-1-git-send-email-joelf@ti.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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..10995b2 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