From d09addc8391c4132ffeb911551d6b3d24171c1fb Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 23 Dec 2011 01:24:34 +0100 Subject: [PATCH] --- yaml --- r: 280427 b: refs/heads/master c: a8cf27bee7adc40d91956cf1b9e44d7001f93aba h: refs/heads/master i: 280425: 4bd91a11e72956e0df34b7f0deb0cc929d9944f4 280423: 35c0e7f5860ddf15f05b52374b6ab573d07e83f6 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-shmobile/pm-sh7372.c | 29 +++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 8fda4273f40f..6b8728e67dd5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9ee27ffbe303ce18e7336115f1d443e9911eba53 +refs/heads/master: a8cf27bee7adc40d91956cf1b9e44d7001f93aba diff --git a/trunk/arch/arm/mach-shmobile/pm-sh7372.c b/trunk/arch/arm/mach-shmobile/pm-sh7372.c index 7fda2301c9b2..77b8fc12fc2f 100644 --- a/trunk/arch/arm/mach-shmobile/pm-sh7372.c +++ b/trunk/arch/arm/mach-shmobile/pm-sh7372.c @@ -239,7 +239,6 @@ struct sh7372_pm_domain sh7372_d4 = { struct sh7372_pm_domain sh7372_a4r = { .genpd.name = "A4R", .bit_shift = 5, - .gov = &pm_domain_always_on_gov, .suspend = sh7372_a4r_suspend, .resume = sh7372_intcs_resume, }; @@ -535,9 +534,37 @@ static int sh7372_enter_suspend(suspend_state_t suspend_state) return 0; } +/** + * sh7372_pm_notifier_fn - SH7372 PM notifier routine. + * @notifier: Unused. + * @pm_event: Event being handled. + * @unused: Unused. + */ +static int sh7372_pm_notifier_fn(struct notifier_block *notifier, + unsigned long pm_event, void *unused) +{ + switch (pm_event) { + case PM_SUSPEND_PREPARE: + /* + * This is necessary, because the A4R domain has to be "on" + * when suspend_device_irqs() and resume_device_irqs() are + * executed during system suspend and resume, respectively, so + * that those functions don't crash while accessing the INTCS. + */ + pm_genpd_poweron(&sh7372_a4r.genpd); + break; + case PM_POST_SUSPEND: + pm_genpd_poweroff_unused(); + break; + } + + return NOTIFY_DONE; +} + static void sh7372_suspend_init(void) { shmobile_suspend_ops.enter = sh7372_enter_suspend; + pm_notifier(sh7372_pm_notifier_fn, 0); } #else static void sh7372_suspend_init(void) {}