Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932114AbdCFMSv (ORCPT ); Mon, 6 Mar 2017 07:18:51 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:42083 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753282AbdCFMSm (ORCPT ); Mon, 6 Mar 2017 07:18:42 -0500 From: Ramiro Oliveira To: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: CARLOS.PALMINHA@synopsys.com, Ramiro Oliveira , Dan Williams , Kedareswara rao Appana , Laurent Pinchart , Mark Rutland , Michal Simek , Rob Herring , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Vinod Koul 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: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1908 Lines: 69 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) -- 2.11.0