]> asedeno.scripts.mit.edu Git - linux.git/commit
gpio: rcar: Fine-grained Runtime PM support
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 8 Dec 2016 17:32:28 +0000 (18:32 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 28 Dec 2016 00:33:02 +0000 (01:33 +0100)
commit2d65472bcb3f2e1f305529655bb06054dc9e2804
treeb0896cfc211bcd3feff24c9dfe9bccecd0500778
parent47bd38a31adcd5b92f5e11919a101a310305dbb1
gpio: rcar: Fine-grained Runtime PM support

Currently gpio modules are runtime-resumed at probe time. This means the
gpio module will be active all the time (except during system suspend,
if not configured as a wake-up source).

While an R-Car Gen2 gpio module retains pins configured for output at
the requested level while put in standby mode, gpio register cannot be
accessed while suspended.  Unfortunately pm_runtime_get_sync() cannot be
called from all contexts where gpio register access is needed. Hence
move the Runtime PM handling from probe/remove time to gpio request/free
time, which is probably the best we can do.

On r8a7791/koelsch, gpio modules 0, 1, 3, and 4 are now suspended during
normal use (gpio2 is used for LEDs and regulators, gpio5 for keys, gpio6
for SD-Card CD & WP, gpio7 for keys and regulators).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[Niklas: s/gpio_to_priv(chip)/gpiochip_get_data(chip)/]
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-rcar.c