From: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
To: dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: vinod.koul@intel.com, robh+dt@kernel.org, mark.rutland@arm.com,
michal.simek@xilinx.com, soren.brinkmann@xilinx.com,
appana.durga.rao@xilinx.com, anuragku@xilinx.com,
dan.j.williams@intel.com, laurent.pinchart@ideasonboard.com,
CARLOS.PALMINHA@synopsys.com,
Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Subject: [PATCH 2/2] xilinx_dma: Add reset support
Date: Wed, 14 Dec 2016 17:18:24 +0000 [thread overview]
Message-ID: <4220c66c29d83bec1ded798ee383b5460c162cfc.1481735244.git.roliveir@synopsys.com> (raw)
In-Reply-To: <cover.1481735244.git.roliveir@synopsys.com>
In-Reply-To: <cover.1481735244.git.roliveir@synopsys.com>
Add a DT property to control an optional external reset line
Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
---
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 <linux/slab.h>
#include <linux/clk.h>
#include <linux/io-64-nonatomic-lo-hi.h>
+#include <linux/reset.h>
#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)
--
2.10.2
next prev parent reply other threads:[~2016-12-14 17:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 17:18 [PATCH 0/2] xilinx_dma: Add external reset control Ramiro Oliveira
2016-12-14 17:18 ` [PATCH 1/2] xilinx_dma: Edit device tree bindings documentation Ramiro Oliveira
2016-12-14 19:56 ` Laurent Pinchart
2016-12-14 17:18 ` Ramiro Oliveira [this message]
2016-12-14 20:16 ` [PATCH 2/2] xilinx_dma: Add reset support Laurent Pinchart
2016-12-15 11:26 ` Ramiro Oliveira
2016-12-15 13:56 ` Laurent Pinchart
2016-12-23 10:26 ` Philipp Zabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4220c66c29d83bec1ded798ee383b5460c162cfc.1481735244.git.roliveir@synopsys.com \
--to=ramiro.oliveira@synopsys.com \
--cc=CARLOS.PALMINHA@synopsys.com \
--cc=anuragku@xilinx.com \
--cc=appana.durga.rao@xilinx.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michal.simek@xilinx.com \
--cc=robh+dt@kernel.org \
--cc=soren.brinkmann@xilinx.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®