public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] gpio/gpio-pl061: No need of thaw and poweroff routines for hibernate
@ 2012-01-11  9:55 Viresh Kumar
  2012-02-16 10:58 ` Viresh Kumar
  2012-02-16 13:38 ` Grant Likely
  0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-01-11  9:55 UTC (permalink / raw)
  To: linux-arm-kernel

pl061 uses same routines for suspend/freeze/poweroff and resume/thaw/restore.
We are only saving and restoring register values on these routines.

During hibernation, in freeze() we take a snapshot of gpio registers. In thaw()
we don't actually need to restore these registers, as power was never shut down
till now. Similarly, in poweroff() we don't need to take snapshot of these
registers again, as it was done during freeze() and by now the image is already
saved on disk.

This patch passes poweroff() and thaw() routines as NULL to avoid this extra
work done.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/gpio/gpio-pl061.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 84ba1dd..45b884b 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -430,7 +430,12 @@ static int pl061_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(pl061_dev_pm_ops, pl061_suspend, pl061_resume);
+static const struct dev_pm_ops pl061_dev_pm_ops = {
+	.suspend = pl061_suspend,
+	.resume = pl061_resume,
+	.freeze = pl061_suspend,
+	.restore = pl061_resume,
+};
 #endif
 
 static struct amba_id pl061_ids[] = {
-- 
1.7.8.110.g4cb5d

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-16 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11  9:55 [PATCH] gpio/gpio-pl061: No need of thaw and poweroff routines for hibernate Viresh Kumar
2012-02-16 10:58 ` Viresh Kumar
2012-02-16 13:38 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox