* [PATCH 2/2 v2] pinctrl/nomadik: adopt pinctrl sleep mode management
@ 2012-12-14 20:21 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-12-14 20:21 UTC (permalink / raw)
To: linux-arm-kernel
From: Julien Delacou <julien.delacou@stericsson.com>
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Use the new interface from the local "core.h" file
---
drivers/pinctrl/pinctrl-nomadik.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index 0ceef59..1ecb3ea 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -35,6 +35,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
@@ -2096,6 +2097,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 __devinit nmk_pinctrl_probe(struct platform_device *pdev)
{
const struct platform_device_id *platid = platform_get_device_id(pdev);
@@ -2204,6 +2227,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)
--
1.7.11.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2 v2] pinctrl/nomadik: adopt pinctrl sleep mode management
@ 2012-12-14 20:21 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-12-14 20:21 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel
Cc: Stephen Warren, Anmar Oueja, Julien Delacou, Linus Walleij
From: Julien Delacou <julien.delacou@stericsson.com>
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Use the new interface from the local "core.h" file
---
drivers/pinctrl/pinctrl-nomadik.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index 0ceef59..1ecb3ea 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -35,6 +35,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
@@ -2096,6 +2097,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 __devinit nmk_pinctrl_probe(struct platform_device *pdev)
{
const struct platform_device_id *platid = platform_get_device_id(pdev);
@@ -2204,6 +2227,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)
--
1.7.11.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2 v2] pinctrl/nomadik: adopt pinctrl sleep mode management
2012-12-14 20:21 ` Linus Walleij
@ 2012-12-14 22:52 ` Stephen Warren
-1 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2012-12-14 22:52 UTC (permalink / raw)
To: linux-arm-kernel
On 12/14/2012 01:21 PM, Linus Walleij wrote:
> This fix makes pinctrl-nomadik able to handle
> suspend/resume events and change hogged pins states
> accordingly.
Reviewed-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2 v2] pinctrl/nomadik: adopt pinctrl sleep mode management
@ 2012-12-14 22:52 ` Stephen Warren
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2012-12-14 22:52 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
Julien Delacou, Linus Walleij
On 12/14/2012 01:21 PM, Linus Walleij wrote:
> This fix makes pinctrl-nomadik able to handle
> suspend/resume events and change hogged pins states
> accordingly.
Reviewed-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-14 22:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-14 20:21 [PATCH 2/2 v2] pinctrl/nomadik: adopt pinctrl sleep mode management Linus Walleij
2012-12-14 20:21 ` Linus Walleij
2012-12-14 22:52 ` Stephen Warren
2012-12-14 22:52 ` Stephen Warren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.