PM: earlysuspend: Add console switch when user requested sleep state changes.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index b0a195b..625d653 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -59,6 +59,23 @@
 	  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 HIBERNATE_CALLBACKS
 	bool