From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>
Cc: linux-sh@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Linus Walleij <linus.walleij@linaro.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
linux-gpio@vger.kernel.org
Subject: [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support
Date: Mon, 14 Apr 2014 20:33:13 +0200 [thread overview]
Message-ID: <1397500397-12607-3-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1397500397-12607-1-git-send-email-geert@linux-m68k.org>
From: Geert Uytterhoeven <geert+renesas@glider.be>
This is just enough to automatically enable the functional clock, if
present. Clock management during suspend/resume is still to be added.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: linux-gpio@vger.kernel.org
---
v2:
- Use pm_runtime_put() instead of pm_runtime_put_sync()
---
drivers/gpio/gpio-rcar.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 03c91482432c..bfcfeeefcf78 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -26,6 +26,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
@@ -377,6 +378,9 @@ static int gpio_rcar_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, p);
+ pm_runtime_enable(dev);
+ pm_runtime_get_sync(dev);
+
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
@@ -460,6 +464,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
err1:
irq_domain_remove(p->irq_domain);
err0:
+ pm_runtime_put(dev);
+ pm_runtime_disable(dev);
return ret;
}
@@ -473,6 +479,8 @@ static int gpio_rcar_remove(struct platform_device *pdev)
return ret;
irq_domain_remove(p->irq_domain);
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
return 0;
}
--
1.7.9.5
next prev parent reply other threads:[~2014-04-14 18:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1397500397-12607-1-git-send-email-geert@linux-m68k.org>
2014-04-14 18:33 ` [PATCH v2 1/6] gpio: rcar: Add optional functional clock to bindings Geert Uytterhoeven
2014-04-15 15:56 ` Laurent Pinchart
2014-04-22 21:34 ` Linus Walleij
2014-04-14 18:33 ` Geert Uytterhoeven [this message]
2014-04-16 11:26 ` [PATCH v2 2/6] gpio: rcar: Add minimal runtime PM support Laurent Pinchart
2014-04-23 7:03 ` Linus Walleij
2014-04-23 7:13 ` Geert Uytterhoeven
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=1397500397-12607-3-git-send-email-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.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).