From patchwork Wed Dec 14 17:18:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramiro Oliveira X-Patchwork-Id: 9474427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 277176021C for ; Wed, 14 Dec 2016 17:21:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14CD828740 for ; Wed, 14 Dec 2016 17:21:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0965928742; Wed, 14 Dec 2016 17:21:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9764028740 for ; Wed, 14 Dec 2016 17:21:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHDDh-00074V-2V; Wed, 14 Dec 2016 17:19:57 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHDD5-0006wr-AU for linux-arm-kernel@lists.infradead.org; Wed, 14 Dec 2016 17:19:20 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 894B624E0522; Wed, 14 Dec 2016 09:19:01 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 6B4442C5; Wed, 14 Dec 2016 09:19:01 -0800 (PST) Received: from arc-dev.internal.synopsys.com (roliveir-e7470.internal.synopsys.com [10.107.25.125]) by mailhost.synopsys.com (Postfix) with ESMTP id 4DE882B7; Wed, 14 Dec 2016 09:18:58 -0800 (PST) From: Ramiro Oliveira To: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] xilinx_dma: Add reset support Date: Wed, 14 Dec 2016 17:18:24 +0000 Message-Id: <4220c66c29d83bec1ded798ee383b5460c162cfc.1481735244.git.roliveir@synopsys.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161214_091919_462117_AD56A7AC X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Ramiro Oliveira , vinod.koul@intel.com, anuragku@xilinx.com, michal.simek@xilinx.com, CARLOS.PALMINHA@synopsys.com, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com, appana.durga.rao@xilinx.com, dan.j.williams@intel.com, soren.brinkmann@xilinx.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a DT property to control an optional external reset line Signed-off-by: Ramiro Oliveira --- drivers/dma/xilinx/xilinx_dma.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 5c9f11b..b845224 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -46,6 +46,7 @@ #include #include #include +#include #include "../dmaengine.h" @@ -409,6 +410,7 @@ struct xilinx_dma_device { struct clk *rxs_clk; u32 nr_channels; u32 chan_id; + struct reset_control *rst; }; /* Macros */ @@ -2543,6 +2545,27 @@ static int xilinx_dma_probe(struct platform_device *pdev) if (IS_ERR(xdev->regs)) return PTR_ERR(xdev->regs); + xdev->rst = devm_reset_control_get_optional(&pdev->dev, "reset"); + if (IS_ERR(xdev->rst)) { + err = PTR_ERR(xdev->rst); + switch (err) { + case -ENOENT: + case -ENOTSUPP: + xdev->rst = NULL; + break; + default: + dev_err(xdev->dev, "error getting reset %d\n", err); + return err; + } + } else { + err = reset_control_deassert(xdev->rst); + if (err) { + dev_err(xdev->dev, "failed to deassert reset: %d\n", + err); + return err; + } + } + /* Retrieve the DMA engine properties from the device tree */ xdev->has_sg = of_property_read_bool(node, "xlnx,include-sg"); if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA)