Skip to content

Commit

Permalink
gpio/gpio-pl061: No need of thaw and poweroff routines for hibernate
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Viresh Kumar authored and Grant Likely committed Feb 16, 2012
1 parent 864533c commit 6e33ace
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpio/gpio-pl061.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,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[] = {
Expand Down

0 comments on commit 6e33ace

Please sign in to comment.