linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Neeli <srinivas.neeli@xilinx.com>
To: linus.walleij@linaro.org, bgolaszewski@baylibre.com,
	michal.simek@xilinx.com, shubhrajyoti.datta@xilinx.com,
	sgoud@xilinx.com
Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, git@xilinx.com
Subject: [PATCH V4 5/7] gpio: zynq: Disable the irq if it is not a wakeup source
Date: Wed, 17 Jun 2020 17:07:25 +0530	[thread overview]
Message-ID: <1592393847-1415-6-git-send-email-srinivas.neeli@xilinx.com> (raw)
In-Reply-To: <1592393847-1415-1-git-send-email-srinivas.neeli@xilinx.com>

From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

If gpio is not set to wake disable the interrupt. ATF set all slaves with
enabled interrupts as wakeup sources and if gpio is used in r5 then it
wakes up linux.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/gpio/gpio-zynq.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 9ac69144a0eb..b6261a3aec55 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -735,6 +735,9 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev)
 	struct zynq_gpio *gpio = dev_get_drvdata(dev);
 	struct irq_data *data = irq_get_irq_data(gpio->irq);
 
+	if (!device_may_wakeup(dev))
+		disable_irq(gpio->irq);
+
 	if (!irqd_is_wakeup_set(data)) {
 		zynq_gpio_save_context(gpio);
 		return pm_runtime_force_suspend(dev);
@@ -749,6 +752,9 @@ static int __maybe_unused zynq_gpio_resume(struct device *dev)
 	struct irq_data *data = irq_get_irq_data(gpio->irq);
 	int ret;
 
+	if (!device_may_wakeup(dev))
+		enable_irq(gpio->irq);
+
 	if (!irqd_is_wakeup_set(data)) {
 		ret = pm_runtime_force_resume(dev);
 		zynq_gpio_restore_context(gpio);
@@ -956,6 +962,8 @@ static int zynq_gpio_probe(struct platform_device *pdev)
 		goto err_pm_put;
 	}
 
+	irq_set_status_flags(gpio->irq, IRQ_DISABLE_UNLAZY);
+	device_init_wakeup(&pdev->dev, 1);
 	pm_runtime_put(&pdev->dev);
 
 	return 0;
-- 
2.7.4


  parent reply	other threads:[~2020-06-17 11:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 11:37 [PATCH V4 0/7] gpio: zynq: Update on gpio-zynq driver Srinivas Neeli
2020-06-17 11:37 ` [PATCH V4 1/7] gpio: zynq: protect direction in/out with a spinlock Srinivas Neeli
2020-06-17 11:37 ` [PATCH V4 2/7] dt-bindings: gpio: Add binding for Versal gpio Srinivas Neeli
2020-06-17 11:37 ` [PATCH V4 3/7] devicetree-binding: Add pmc gpio node Srinivas Neeli
2020-06-24 10:18   ` Bartosz Golaszewski
2020-06-17 11:37 ` [PATCH V4 4/7] gpio: zynq: Add Versal support Srinivas Neeli
2020-06-17 11:37 ` Srinivas Neeli [this message]
2020-06-17 11:37 ` [PATCH V4 6/7] gpio: zynq: Add pmc gpio support Srinivas Neeli
2020-06-17 11:37 ` [PATCH V4 7/7] gpio: zynq: Remove error prints in EPROBE_DEFER Srinivas Neeli
2020-06-24 10:18 ` [PATCH V4 0/7] gpio: zynq: Update on gpio-zynq driver Bartosz Golaszewski

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=1592393847-1415-6-git-send-email-srinivas.neeli@xilinx.com \
    --to=srinivas.neeli@xilinx.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=git@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 \
    --cc=sgoud@xilinx.com \
    --cc=shubhrajyoti.datta@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;
as well as URLs for NNTP newsgroup(s).