Revert "PM: earlysuspend: Add console switch when user requested sleep state changes."
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:58:05 +0000 (22:58 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:58:05 +0000 (22:58 +0800)
This reverts commit 849d91c2b34843ed8c96dd6123c050f6ab8ba34a.

kernel/power/Kconfig
kernel/power/Makefile
kernel/power/consoleearlysuspend.c [deleted file]

index 3b3910f11825013c74e10a827d31c51e00cc04ce..2f3157f0c4a68ee838085b4f0a08f7a74eb73d7c 100644 (file)
@@ -160,23 +160,6 @@ config EARLYSUSPEND
          Call early suspend handlers when the user requested sleep state
          changes.
 
-choice
-       prompt "User-space screen access"
-       default CONSOLE_EARLYSUSPEND
-       depends on HAS_EARLYSUSPEND
-
-       config NO_USER_SPACE_SCREEN_ACCESS_CONTROL
-               bool "None"
-
-       config CONSOLE_EARLYSUSPEND
-               bool "Console switch on early-suspend"
-               depends on HAS_EARLYSUSPEND && VT
-               ---help---
-                 Register early suspend handler to perform a console switch to
-                 when user-space should stop drawing to the screen and a switch
-                 back when it should resume.
-endchoice
-
 config HIBERNATION
        bool "Hibernation (aka 'suspend to disk')"
        depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
index 9f946b668d67d575d2f82773ae95d37127eef678..96f7865ef5e136fcba0bed79b6cd268b8ca31d07 100644 (file)
@@ -13,6 +13,5 @@ obj-$(CONFIG_HIBERNATION_NVS) += hibernate_nvs.o
 obj-$(CONFIG_WAKELOCK)         += wakelock.o
 obj-$(CONFIG_USER_WAKELOCK)    += userwakelock.o
 obj-$(CONFIG_EARLYSUSPEND)     += earlysuspend.o
-obj-$(CONFIG_CONSOLE_EARLYSUSPEND)     += consoleearlysuspend.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)      += poweroff.o
diff --git a/kernel/power/consoleearlysuspend.c b/kernel/power/consoleearlysuspend.c
deleted file mode 100644 (file)
index a8befb4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* kernel/power/consoleearlysuspend.c
- *
- * Copyright (C) 2005-2008 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
- */
-
-#include <linux/console.h>
-#include <linux/earlysuspend.h>
-#include <linux/kbd_kern.h>
-#include <linux/module.h>
-#include <linux/vt_kern.h>
-#include <linux/wait.h>
-
-#define EARLY_SUSPEND_CONSOLE  (MAX_NR_CONSOLES-1)
-
-static int orig_fgconsole;
-static void console_early_suspend(struct early_suspend *h)
-{
-       acquire_console_sem();
-       orig_fgconsole = fg_console;
-       if (vc_allocate(EARLY_SUSPEND_CONSOLE))
-               goto err;
-       if (set_console(EARLY_SUSPEND_CONSOLE))
-               goto err;
-       release_console_sem();
-
-       if (vt_waitactive(EARLY_SUSPEND_CONSOLE))
-               pr_warning("console_early_suspend: Can't switch VCs.\n");
-       return;
-err:
-       pr_warning("console_early_suspend: Can't set console\n");
-       release_console_sem();
-}
-
-static void console_late_resume(struct early_suspend *h)
-{
-       int ret;
-       acquire_console_sem();
-       ret = set_console(orig_fgconsole);
-       release_console_sem();
-       if (ret) {
-               pr_warning("console_late_resume: Can't set console.\n");
-               return;
-       }
-
-       if (vt_waitactive(orig_fgconsole))
-               pr_warning("console_late_resume: Can't switch VCs.\n");
-}
-
-static struct early_suspend console_early_suspend_desc = {
-       .level = EARLY_SUSPEND_LEVEL_STOP_DRAWING,
-       .suspend = console_early_suspend,
-       .resume = console_late_resume,
-};
-
-static int __init console_early_suspend_init(void)
-{
-       register_early_suspend(&console_early_suspend_desc);
-       return 0;
-}
-
-static void  __exit console_early_suspend_exit(void)
-{
-       unregister_early_suspend(&console_early_suspend_desc);
-}
-
-module_init(console_early_suspend_init);
-module_exit(console_early_suspend_exit);
-