From cd997b022260b15c7b9a419ec11cdc1c90ccdaa8 Mon Sep 17 00:00:00 2001 From: Bo Yan Date: Mon, 2 May 2011 15:00:26 -0700 Subject: ARM: tegra: restore voltage to nominal when reboot At the time of reboot, all rails need to be set to nominal to ensure the success of subsequent boot bug 821969 bug 797082 http://git-master/r/#change,42117 (cherry picked from commit 34a922bbf6cad91dd4f5129a1c7ad96f475f34fe) Change-Id: I5044109866a032dc89d7cd0b83938ecd4b3f360a Signed-off-by: Varun Wadekar Reviewed-on: http://git-master/r/42297 Reviewed-by: Bharat Nihalani --- arch/arm/mach-tegra/dvfs.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 #include #include +#include #include @@ -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; } -- cgit v1.2.3