From: Vitor Soares <vitor.soares@synopsys.com>
To: linux-kernel@vger.kernel.org
Cc: Vitor Soares <vitor.soares@synopsys.com>,
Eugeniy Paltsev <eugeniy.Paltsev@synopsys.com>,
Alexey Brodkin <alexey.brodkin@synopsys.com>,
Joao Pinto <joao.pinto@synopsys.com>,
Jose Abreu <jose.abreu@synopsys.com>,
Luis Oliveira <luis.oliveira@synopsys.com>,
Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
Nelson Costa <nelson.costa@synopsys.com>,
Pedro Sousa <pedrom.sousa@synopsys.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: [PATCH] reset: axs10x: Implement assert and deassert callbacks
Date: Mon, 8 Apr 2019 12:31:23 +0200 [thread overview]
Message-ID: <33ed7b90da8439aecb3544c3ff7dcfb511e03b8e.1554457026.git.vitor.soares@synopsys.com> (raw)
Some custom IP-block connected to ARC AXS10x board need assert and
deassert functions to control reset signal of selected peripherals.
This patch improve AXS10x reset driver by adding assert and deassert
callbacks.
Signed-off-by: Vitor Soares <vitor.soares@synopsys.com>
Cc: Eugeniy Paltsev <eugeniy.Paltsev@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Jose Abreu <jose.abreu@synopsys.com>
Cc: Luis Oliveira <lolivei@synopsys.com>
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Cc: Nelson Costa <nelson.costa@synopsys.com>
Cc: Pedro Sousa <pedrom.sousa@synopsys.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/reset/reset-axs10x.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/reset/reset-axs10x.c b/drivers/reset/reset-axs10x.c
index a854ef41..12dac8b 100644
--- a/drivers/reset/reset-axs10x.c
+++ b/drivers/reset/reset-axs10x.c
@@ -37,8 +37,36 @@ static int axs10x_reset_reset(struct reset_controller_dev *rcdev,
return 0;
}
+static int axs10x_reset_assert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct axs10x_rst *rst = to_axs10x_rst(rcdev);
+ unsigned long flags;
+
+ spin_lock_irqsave(&rst->lock, flags);
+ writel(readl(rst->regs_rst) & ~BIT(id), rst->regs_rst);
+ spin_unlock_irqrestore(&rst->lock, flags);
+
+ return 0;
+}
+
+static int axs10x_reset_deassert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct axs10x_rst *rst = to_axs10x_rst(rcdev);
+ unsigned long flags;
+
+ spin_lock_irqsave(&rst->lock, flags);
+ writel(readl(rst->regs_rst) | BIT(id), rst->regs_rst);
+ spin_unlock_irqrestore(&rst->lock, flags);
+
+ return 0;
+}
+
static const struct reset_control_ops axs10x_reset_ops = {
- .reset = axs10x_reset_reset,
+ .reset = axs10x_reset_reset,
+ .assert = axs10x_reset_assert,
+ .deassert = axs10x_reset_deassert,
};
static int axs10x_reset_probe(struct platform_device *pdev)
--
2.7.4
next reply other threads:[~2019-04-08 10:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-08 10:31 Vitor Soares [this message]
2019-04-08 11:23 ` Jose Abreu
2019-04-12 13:26 ` Eugeniy Paltsev
2019-04-08 11:40 ` Eugeniy Paltsev
2019-04-08 13:25 ` Vitor Soares
2019-04-12 13:22 ` Eugeniy Paltsev
2019-04-12 14:42 ` Vitor Soares
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=33ed7b90da8439aecb3544c3ff7dcfb511e03b8e.1554457026.git.vitor.soares@synopsys.com \
--to=vitor.soares@synopsys.com \
--cc=alexey.brodkin@synopsys.com \
--cc=eugeniy.Paltsev@synopsys.com \
--cc=gustavo.pimentel@synopsys.com \
--cc=joao.pinto@synopsys.com \
--cc=jose.abreu@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luis.oliveira@synopsys.com \
--cc=nelson.costa@synopsys.com \
--cc=p.zabel@pengutronix.de \
--cc=pedrom.sousa@synopsys.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®