diff options
author | Bo Yan <byan@nvidia.com> | 2011-05-02 15:00:26 -0700 |
---|---|---|
committer | Manish Tuteja <mtuteja@nvidia.com> | 2011-07-22 03:52:52 -0700 |
commit | b1ae780a6c47022838974471cad922ffbf41e094 (patch) | |
tree | e3624391bc4427440435e476d1f95f89f5ffd447 | |
parent | 32fc4be47d820683b4b65e5548c61a3ac5ac9521 (diff) |
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
Reviewed-on: http://git-master/r/30086
(cherry picked from commit 2218f77d722bdd7a6830cfccb0e7f310b7bca48c)
Change-Id: Ic853ab47e9a42ae6b549b5549af0b118ec9e00d1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/42117
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/dvfs.c | 19 |
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; } |