From: Soren Brinkmann <soren.brinkmann@xilinx.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
Michal Simek <michal.simek@xilinx.com>,
<linux-arm-kernel@lists.infradead.org>,
"Soren Brinkmann" <soren.brinkmann@xilinx.com>,
John Linn <linnj@xilinx.com>
Subject: [PATCH] gpio: zynq: Implement irq_(request|release)_resources
Date: Fri, 23 Oct 2015 06:36:21 -0700 [thread overview]
Message-ID: <1445607381-7794-1-git-send-email-soren.brinkmann@xilinx.com> (raw)
The driver uses runtime PM to leverage low power techniques. For
use-cases using GPIO as interrupt the device needs to be in an
appropriate state.
Reported-by: John Linn <linnj@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Tested-by: John Linn <linnj@xilinx.com>
---
drivers/gpio/gpio-zynq.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 8abeacac5885..0d1669416112 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -471,6 +471,22 @@ static int zynq_gpio_set_wake(struct irq_data *data, unsigned int on)
return 0;
}
+int zynq_gpio_irq_request_resources(struct irq_data *data)
+{
+ struct zynq_gpio *gpio = irq_data_get_irq_chip_data(data);
+ struct device *dev = gpio->chip.dev;
+
+ return pm_runtime_get_sync(dev);
+}
+
+void zynq_gpio_irq_release_resources(struct irq_data *data)
+{
+ struct zynq_gpio *gpio = irq_data_get_irq_chip_data(data);
+ struct device *dev = gpio->chip.dev;
+
+ pm_runtime_put(dev);
+}
+
/* irq chip descriptor */
static struct irq_chip zynq_gpio_level_irqchip = {
.name = DRIVER_NAME,
@@ -480,6 +496,8 @@ static struct irq_chip zynq_gpio_level_irqchip = {
.irq_unmask = zynq_gpio_irq_unmask,
.irq_set_type = zynq_gpio_set_irq_type,
.irq_set_wake = zynq_gpio_set_wake,
+ .irq_request_resources = zynq_gpio_irq_request_resources,
+ .irq_release_resources = zynq_gpio_irq_release_resources,
.flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED |
IRQCHIP_MASK_ON_SUSPEND,
};
@@ -492,6 +510,8 @@ static struct irq_chip zynq_gpio_edge_irqchip = {
.irq_unmask = zynq_gpio_irq_unmask,
.irq_set_type = zynq_gpio_set_irq_type,
.irq_set_wake = zynq_gpio_set_wake,
+ .irq_request_resources = zynq_gpio_irq_request_resources,
+ .irq_release_resources = zynq_gpio_irq_release_resources,
.flags = IRQCHIP_MASK_ON_SUSPEND,
};
--
2.6.2.3.ga463a5b
next reply other threads:[~2015-10-23 13:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 13:36 Soren Brinkmann [this message]
2015-10-27 15:53 ` Linus Walleij
2015-10-27 16:18 ` Grygorii Strashko
2015-10-27 16:23 ` Linus Walleij
2015-10-27 17:54 ` Grygorii Strashko
2015-10-28 15:20 ` Linus Walleij
2015-10-27 16:37 ` Lars-Peter Clausen
2015-10-29 16:47 ` Sören Brinkmann
2015-10-30 10:05 ` Thomas Gleixner
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=1445607381-7794-1-git-send-email-soren.brinkmann@xilinx.com \
--to=soren.brinkmann@xilinx.com \
--cc=gnurou@gmail.com \
--cc=linnj@xilinx.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.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®