From patchwork Mon Mar 6 12:17:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramiro Oliveira X-Patchwork-Id: 9605941 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 4AD196046A for ; Mon, 6 Mar 2017 12:19:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44BAB28285 for ; Mon, 6 Mar 2017 12:19:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 384AE28394; Mon, 6 Mar 2017 12:19:47 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B2A7628285 for ; Mon, 6 Mar 2017 12:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uMtef4WcXrSHfbvD7ca9eSli68Q/Ug05/IDmr8/yLks=; b=rHajvtcO3Q5ByoWdiv/+9hd72z G6zXGjTKfjPI652JRXnHrVYpEwWc/qFxDvyfWTlJUtxKzrS1Gxx5RN6iFww9ajLOkDJpFajoJ1SGQ 60MISiP5WDXa6YD5Ap0BHrDE4LjnC20VJ5yYK6nnnZhQWGRiUqEnplSmqoOexG40MOWDFGsjkDzGH 3VZpT5loFirQFNLW1PXaE2NtHn0zRUmnDc/iWGIRbQlN5y1y+mazYAbcO4oQ1cGeKyojRgabJbIa0 sgNeqxVrnjSAwagU6vocxkB6PiGfQVvN6nkvUuu1elFBsYk3uWnawCc90ZP+KVqZa9dzFkqWG94ov RbaUeIAw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ckrc9-0004HQ-RV; Mon, 06 Mar 2017 12:19:45 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ckrbF-0003ix-Ms for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2017 12:18:51 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id AE07110C14F6; Mon, 6 Mar 2017 04:18:30 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 84F37F91; Mon, 6 Mar 2017 04:18:30 -0800 (PST) Received: from arc-dev.internal.synopsys.com (roliveir-e7470.internal.synopsys.com [10.107.25.136]) by mailhost.synopsys.com (Postfix) with ESMTP id 94B2BF29; Mon, 6 Mar 2017 04:18:27 -0800 (PST) From: Ramiro Oliveira To: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/2] dma: xilinx: Add reset support Date: Mon, 6 Mar 2017 12:17:39 +0000 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170306_041849_758045_6EF99A6C X-CRM114-Status: GOOD ( 13.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Ramiro Oliveira , Vinod Koul , CARLOS.PALMINHA@synopsys.com, Michal Simek , Rob Herring , Laurent Pinchart , Kedareswara rao Appana , Dan Williams , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= 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 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 5c9f11b623ca..589cbb611bc8 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -32,20 +32,21 @@ */ #include -#include +#include #include +#include #include #include +#include #include #include #include #include #include -#include #include +#include +#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,20 @@ 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_shared(&pdev->dev, NULL); + if (IS_ERR(xdev->rst)) { + err = PTR_ERR(xdev->rst); + if (err == -EPROBE_DEFER) + return err; + xdev->rst = NULL; + } else { + err = reset_control_deassert(xdev->rst); + if (err) { + dev_err(xdev->dev, "error deasserting 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)