summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2014-04-14 20:33:13 +0200
committerLinus Walleij <linus.walleij@linaro.org>2014-04-28 12:35:10 -0700
commitdf0c6c80232f2ad442dcf79a3a420eb8ac624e42 (patch)
tree7f38b612750ac5271c29396be4eb58917fbd1c30 /drivers/gpio
parent9288ecad7522e9d4fa34c3cb3ac8f762aa6b8f7c (diff)
downloadop-kernel-dev-df0c6c80232f2ad442dcf79a3a420eb8ac624e42.zip
op-kernel-dev-df0c6c80232f2ad442dcf79a3a420eb8ac624e42.tar.gz
gpio: rcar: Add minimal runtime PM support
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: linux-gpio@vger.kernel.org Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-rcar.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 03c9148..bfcfeee 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;
}
OpenPOWER on IntegriCloud