From patchwork Tue Sep 29 20:44:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hamzahfrq.sub@gmail.com X-Patchwork-Id: 7289981 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 881EBBEEA4 for ; Tue, 29 Sep 2015 20:45:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62DBD20125 for ; Tue, 29 Sep 2015 20:45:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DC4D2063F for ; Tue, 29 Sep 2015 20:45:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754230AbbI2Upl (ORCPT ); Tue, 29 Sep 2015 16:45:41 -0400 Received: from mail-wi0-f195.google.com ([209.85.212.195]:34494 "EHLO mail-wi0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754207AbbI2UpK (ORCPT ); Tue, 29 Sep 2015 16:45:10 -0400 Received: by wiku15 with SMTP id u15so4937025wik.1; Tue, 29 Sep 2015 13:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=QShLZCXPyXEd5jb7s4uDHfRvXgrDOTAkTCjqQrThzvE=; b=eRvjZfyjcIt8aK/M9O5Q84iMzrwtMtdIvTSzpzcdsSdLNs3pa5XrGiDjjk8cv/Qj08 Up1nIRIsgcI6lA35keUZmfreOaNq0igUJSKJefzwnZ2BFKeTNkASaAoMFJdi+fN57hLx 82gYrD645IXV1JPOgDof4g6Ykv5zaRw94sung57zbZxyG2ktOD2KcJ1Fa7CiIhF2TCJu YutO3+MgpBuMHhCLSCN5sdDc/AbpvN4mnmk4E+W2GxulIVF2Ny7y18gR/LTRnYvko/hI uP3bzaG4zGUdel3tL3yO1ybY+Ise/xaubJRDHOfNrTBulsvftu4DHzFve3hCHoQrM+Tv 3Phw== X-Received: by 10.180.187.240 with SMTP id fv16mr640741wic.57.1443559508698; Tue, 29 Sep 2015 13:45:08 -0700 (PDT) Received: from ubuntu-VirtualBox.fritz.box (p5B02D56B.dip0.t-ipconnect.de. [91.2.213.107]) by smtp.googlemail.com with ESMTPSA id c2sm25721838wiy.11.2015.09.29.13.45.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Sep 2015 13:45:08 -0700 (PDT) From: hamzahfrq.sub@gmail.com Cc: dmaengine@vger.kernel.org, j@bitron.ch, joe@perches.com, kuninori.morimoto.gx@renesas.com, broonie@kernel.org, geert+renesas@glider.be, vinod.koul@intel.com, laurent.pinchart+renesas@ideasonboard.com, linux-sh@vger.kernel.org, jacob@teenageengineering.com, Muhammad Hamza Farooq Subject: [PATCH v3 2/6] dma: rcar-dma: Added dma_pause operation to rcar_dma driver Date: Tue, 29 Sep 2015 22:44:44 +0200 Message-Id: <1443559488-2416-3-git-send-email-hamzahfrq.sub@gmail.com> X-Mailer: git-send-email 1.7.9.5 To: unlisted-recipients:; (no To-header on input) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Muhammad Hamza Farooq Signed-off-by: Muhammad Hamza Farooq --- drivers/dma/sh/rcar-dmac.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2b28291..c7cd4ed 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -774,6 +774,26 @@ static void rcar_dmac_chan_reinit(struct rcar_dmac_chan *chan) } } +static int rcar_dmac_chan_pause(struct dma_chan *chan) +{ + u32 chcr; + int ret; + unsigned long flags; + struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); + + spin_lock_irqsave(&rchan->lock, flags); + + chcr = rcar_dmac_chan_read(rchan, RCAR_DMACHCR); + chcr &= ~RCAR_DMACHCR_DE; + rcar_dmac_chan_write(rchan, RCAR_DMACHCR, chcr); + ret = rcar_dmac_wait_stop(rchan); + + spin_unlock_irqrestore(&rchan->lock, flags); + + WARN_ON(ret < 0); + return ret; +} + static void rcar_dmac_stop(struct rcar_dmac *dmac) { rcar_dmac_write(dmac, RCAR_DMAOR, 0); @@ -1740,6 +1760,7 @@ static int rcar_dmac_probe(struct platform_device *pdev) engine->device_prep_slave_sg = rcar_dmac_prep_slave_sg; engine->device_prep_dma_cyclic = rcar_dmac_prep_dma_cyclic; engine->device_config = rcar_dmac_device_config; + engine->device_pause = rcar_dmac_chan_pause; engine->device_terminate_all = rcar_dmac_chan_terminate_all; engine->device_tx_status = rcar_dmac_tx_status; engine->device_issue_pending = rcar_dmac_issue_pending;