From patchwork Sun Sep 20 19:10:58 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: 7226511 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 CDB48BEEC1 for ; Sun, 20 Sep 2015 19:11:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 047D72085A for ; Sun, 20 Sep 2015 19:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 230CC2068F for ; Sun, 20 Sep 2015 19:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755394AbbITTLO (ORCPT ); Sun, 20 Sep 2015 15:11:14 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:37265 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755468AbbITTLN (ORCPT ); Sun, 20 Sep 2015 15:11:13 -0400 Received: by wicfx3 with SMTP id fx3so85832260wic.0; Sun, 20 Sep 2015 12:11:12 -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=PsULjrsO5f9Z5UDgResBJf1004fpR2Eq7bEGTtVTmmk=; b=jPC+J1CDgywA3MeGAKuGMb7uTmTII9/eKnOAUcmEhfdDjyPWHd53mBpQTo2qZneggs hK3S/igY32CE1KyGeHx9q59TjAf0OVgioxGz+X4ggsjsQqf1MdFAd3H2HDVRLNpEpQn0 ERjkLjn1J+dx2Oif55TIVujUk+EpJiMenbiDYjXfDDdPKVEBobCTrs8ql8wPi6L3WM0R /xERPQbgDdcLWzoHdLpUv2kx4UQVyUgeY3SI5rpek2vc0EIDvkDmDYbrXfw0GeEglAVk EZGuCW1yAA+YcHeFuZT0uId/LW+Z3g4hVX9LmlzvbpgU8jAVHcLboeZFnuIRA/IV3adM C0CA== X-Received: by 10.180.105.196 with SMTP id go4mr8756392wib.36.1442776272165; Sun, 20 Sep 2015 12:11:12 -0700 (PDT) Received: from ubuntu-VirtualBox.fritz.box (p4FDCDB66.dip0.t-ipconnect.de. [79.220.219.102]) by smtp.googlemail.com with ESMTPSA id fz1sm9644738wic.8.2015.09.20.12.11.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Sep 2015 12:11:11 -0700 (PDT) From: hamzahfrq.sub@gmail.com To: laurent.pinchart@ideasonboard.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, linux-sh@vger.kernel.org, Muhammad Hamza Farooq Subject: [RESEND PATCH 2/6] dma: rcar-dma: Added dma_pause operation to rcar_dma driver Date: Sun, 20 Sep 2015 21:10:58 +0200 Message-Id: <1442776262-2503-3-git-send-email-hamzahfrq.sub@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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 b5b5e89..c3753e1 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;