diff options
author | Julien Delacou <julien.delacou@stericsson.com> | 2012-12-11 09:17:47 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-01-11 21:49:20 +0100 |
commit | 8d99b32d7b9fb542c5efb00a8ec3b96e77be86fd (patch) | |
tree | 22bcddd8d17595dde8cb3deb537b40648ae5ca4d /drivers/pinctrl/pinctrl-nomadik.c | |
parent | 840a47ba43a2aefbd9834924228549879ee3cb49 (diff) | |
download | linux-8d99b32d7b9fb542c5efb00a8ec3b96e77be86fd.tar.gz linux-8d99b32d7b9fb542c5efb00a8ec3b96e77be86fd.tar.bz2 linux-8d99b32d7b9fb542c5efb00a8ec3b96e77be86fd.zip |
pinctrl/nomadik: adopt pinctrl sleep mode management
This fix makes pinctrl-nomadik able to handle
suspend/resume events and change hogged pins states
accordingly.
Signed-off-by: Julien Delacou <julien.delacou@stericsson.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 1bb16ffb4e41..5d8a0066ab60 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -34,6 +34,7 @@ #include <asm/mach/irq.h> #include <mach/irqs.h> #include "pinctrl-nomadik.h" +#include "core.h" /* * The GPIO module in the Nomadik family of Systems-on-Chip is an @@ -1852,6 +1853,28 @@ static const struct of_device_id nmk_pinctrl_match[] = { {}, }; +static int nmk_pinctrl_suspend(struct platform_device *pdev, pm_message_t state) +{ + struct nmk_pinctrl *npct; + + npct = platform_get_drvdata(pdev); + if (!npct) + return -EINVAL; + + return pinctrl_force_sleep(npct->pctl); +} + +static int nmk_pinctrl_resume(struct platform_device *pdev) +{ + struct nmk_pinctrl *npct; + + npct = platform_get_drvdata(pdev); + if (!npct) + return -EINVAL; + + return pinctrl_force_default(npct->pctl); +} + static int nmk_pinctrl_probe(struct platform_device *pdev) { const struct platform_device_id *platid = platform_get_device_id(pdev); @@ -1963,6 +1986,10 @@ static struct platform_driver nmk_pinctrl_driver = { }, .probe = nmk_pinctrl_probe, .id_table = nmk_pinctrl_id, +#ifdef CONFIG_PM + .suspend = nmk_pinctrl_suspend, + .resume = nmk_pinctrl_resume, +#endif }; static int __init nmk_gpio_init(void) |