[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>
Thu, 28 Oct 2010 01:15:49 +0000 (18:15 -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 aef50319852c5a7d1a82cb7a20e15c0aa604a5a4..34b0e7e8fe7b3cf831bf9efde420427c169c1b78 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>
@@ -476,6 +478,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);
@@ -645,6 +652,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,