Skip to content

Commit

Permalink
gpio: rcar: Add minimal runtime PM support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Linus Walleij committed Apr 28, 2014
1 parent 9288eca commit df0c6c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpio/gpio-rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit df0c6c8

Please sign in to comment.