summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/dvfs.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/dvfs.c b/arch/arm/mach-tegra/dvfs.c
index f53b20151cdb..f189710c15bb 100644
--- a/arch/arm/mach-tegra/dvfs.c
+++ b/arch/arm/mach-tegra/dvfs.c
@@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/suspend.h>
#include <linux/delay.h>
+#include <linux/reboot.h>
#include <asm/clkdev.h>
@@ -394,6 +395,23 @@ static struct notifier_block tegra_dvfs_nb = {
.notifier_call = tegra_dvfs_pm_notify,
};
+static int tegra_dvfs_reboot_notify(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ switch (event) {
+ case SYS_RESTART:
+ case SYS_HALT:
+ case SYS_POWER_OFF:
+ tegra_dvfs_suspend();
+ return NOTIFY_OK;
+ }
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block tegra_dvfs_reboot_nb = {
+ .notifier_call = tegra_dvfs_reboot_notify,
+};
+
/* must be called with dvfs lock held */
static void __tegra_dvfs_rail_disable(struct dvfs_rail *rail)
{
@@ -472,6 +490,7 @@ int __init tegra_dvfs_late_init(void)
mutex_unlock(&dvfs_lock);
register_pm_notifier(&tegra_dvfs_nb);
+ register_reboot_notifier(&tegra_dvfs_reboot_nb);
return 0;
}