summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-14 04:44:20 +0200
committerGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-14 04:44:20 +0200
commit285113eb1fc922c8ac05517d54ea76bfb61f5e74 (patch)
treec73f67d0b4ad792debaab9ffd584b07f80c8f759 /arch/arm
parent4bbea3a2cc22051dbda9233f0cd8faaa03233363 (diff)
parent02f5429572377937d4847f03941bde4f8315955e (diff)
Merge change I408ffd43 into android-tegra-2.6.29
* changes: tegra power: registering suspend/resume operations with kernel
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/Makefile3
-rw-r--r--arch/arm/mach-tegra/init_common.c9
-rw-r--r--arch/arm/mach-tegra/suspend_ops.c81
3 files changed, 93 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 075d18a45193..88296db9a1f6 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -16,6 +16,9 @@ obj-y += irq_gpio.o
obj-y += timer.o
obj-y += tegra_sysmap.o
+# Tegra suspend operation
+obj-$(CONFIG_PM) += suspend_ops.o
+
# Export symbols used by loadable modules
obj-y += tegra_exports.o
diff --git a/arch/arm/mach-tegra/init_common.c b/arch/arm/mach-tegra/init_common.c
index fa87882fc45e..32746e5e4d50 100644
--- a/arch/arm/mach-tegra/init_common.c
+++ b/arch/arm/mach-tegra/init_common.c
@@ -46,6 +46,11 @@ const char *tegra_partition_list = NULL;
char *tegra_boot_device = NULL;
NvRmGpioHandle s_hGpioGlobal = NULL;
+#ifdef CONFIG_PM
+/* FIXME : Uncomment this for actual suspend/resume
+extern void tegra_set_suspend_ops(void); */
+#endif
+
/*
* The format for the partition list command line parameter is
* tagrapart=<linux_name>:<start_sector>:<length_in_sectors>:<sector_size>,...
@@ -801,5 +806,9 @@ void __init tegra_common_init(void)
tegra_register_uart();
tegra_register_sdio();
tegra_register_usb();
+#ifdef CONFIG_PM
+ /* FIXME : Uncomment this for actual suspend/resume
+ tegra_set_suspend_ops(); */
+#endif
}
diff --git a/arch/arm/mach-tegra/suspend_ops.c b/arch/arm/mach-tegra/suspend_ops.c
new file mode 100644
index 000000000000..0aef7afe151e
--- /dev/null
+++ b/arch/arm/mach-tegra/suspend_ops.c
@@ -0,0 +1,81 @@
+/*
+ * arch/arm/mach-tegra/suspend_ops.c
+ *
+ * Suspend Operation API implementation
+ *
+ * Copyright (c) 2010, NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <linux/suspend.h>
+#include "nvcommon.h"
+
+int tegra_state_valid(suspend_state_t state)
+{
+ printk("%s CALLED\n", __func__);
+ if (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX)
+ return 1;
+ return 0;
+}
+
+int tegra_state_begin(suspend_state_t state)
+{
+ printk("%s CALLED with state = %d\n", __func__, state);
+ return 0;
+}
+
+int tegra_state_prepare(void)
+{
+ printk("%s CALLED \n", __func__);
+ return 0;
+}
+
+int tegra_state_enter(suspend_state_t state)
+{
+ printk("%s CALLED with state = %d\n", __func__, state);
+ return 0;
+}
+
+void tegra_state_finish(void)
+{
+ printk("%s CALLED \n", __func__);
+}
+
+void tegra_state_end(void)
+{
+ printk("%s CALLED \n", __func__);
+}
+
+void tegra_state_recover(void)
+{
+ printk("%s CALLED \n", __func__);
+}
+
+static struct platform_suspend_ops tegra_suspend_ops =
+{
+ .valid = tegra_state_valid,
+ .begin = tegra_state_begin,
+ .prepare = tegra_state_prepare,
+ .enter = tegra_state_enter,
+ .finish = tegra_state_finish,
+ .end = tegra_state_end,
+ .recover = tegra_state_recover
+};
+
+void tegra_set_suspend_ops()
+{
+ suspend_set_ops(&tegra_suspend_ops);
+}