Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133326
b: refs/heads/master
c: a83c0b7
h: refs/heads/master
v: v3
  • Loading branch information
Francesco VIRLINZI authored and Paul Mundt committed Mar 16, 2009
1 parent cd10496 commit 2ba92d4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 039a718ebb37298de87801288673859ac40b6fc4
refs/heads/master: a83c0b739f3ad1887704cfa9f1ee5ee208cf1532
38 changes: 38 additions & 0 deletions trunk/arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sysdev.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/bitops.h>
Expand Down Expand Up @@ -402,3 +404,39 @@ static int __init pmb_debugfs_init(void)
return 0;
}
postcore_initcall(pmb_debugfs_init);

#ifdef CONFIG_PM
static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state)
{
static pm_message_t prev_state;

/* Restore the PMB after a resume from hibernation */
if (state.event == PM_EVENT_ON &&
prev_state.event == PM_EVENT_FREEZE) {
struct pmb_entry *pmbe;
spin_lock_irq(&pmb_list_lock);
for (pmbe = pmb_list; pmbe; pmbe = pmbe->next)
set_pmb_entry(pmbe);
spin_unlock_irq(&pmb_list_lock);
}
prev_state = state;
return 0;
}

static int pmb_sysdev_resume(struct sys_device *dev)
{
return pmb_sysdev_suspend(dev, PMSG_ON);
}

static struct sysdev_driver pmb_sysdev_driver = {
.suspend = pmb_sysdev_suspend,
.resume = pmb_sysdev_resume,
};

static int __init pmb_sysdev_init(void)
{
return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver);
}

subsys_initcall(pmb_sysdev_init);
#endif

0 comments on commit 2ba92d4

Please sign in to comment.