[ARM] tegra: Setup regulators for suspend
authorGreg Meiste <w30289@motorola.com>
Wed, 8 Sep 2010 18:38:36 +0000 (13:38 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:51:14 +0000 (16:51 -0700)
The regulator framework may need to change certain regulators when
entering suspend.

Change-Id: I584e92b3c32cbd1a63325831822e2704a3dd2774
Signed-off-by: Greg Meiste <w30289@motorola.com>
arch/arm/mach-tegra/suspend.c

index b46d1bfff9b52fa972f32e7422da3335bccc6e3d..3bff6448f48d320e9ed86bfb24e5d6eaf8be8bdb 100644 (file)
@@ -37,6 +37,8 @@
 #include <linux/seq_file.h>
 #include <linux/uaccess.h>
 
+#include <linux/regulator/machine.h>
+
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/hardware/gic.h>
@@ -385,6 +387,11 @@ static void tegra_suspend_dram(bool do_lp0)
        wmb();
 }
 
+static int tegra_suspend_begin(suspend_state_t state)
+{
+       return regulator_suspend_prepare(state);
+}
+
 static int tegra_suspend_prepare_late(void)
 {
        disable_irq(INT_SYS_STATS_MON);
@@ -537,6 +544,7 @@ static int tegra_suspend_enter(suspend_state_t state)
 
 static struct platform_suspend_ops tegra_suspend_ops = {
        .valid          = suspend_valid_only_mem,
+       .begin          = tegra_suspend_begin,
        .prepare_late   = tegra_suspend_prepare_late,
        .wake           = tegra_suspend_wake,
        .enter          = tegra_suspend_enter,