diff mbox

add KEY_HIBERNATE and clarify the uses of KEY_SUSPEND and KEY_SLEEP

Message ID 1236100818.3900.36.camel@hughsie-work.lan (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Richard Hughes March 3, 2009, 5:20 p.m. UTC
I've attached a patch that adds KEY_HIBERNATE and clarifies the uses of
KEY_SUSPEND and KEY_SLEEP.

Please consider. Thanks.

Richard Hughes

Comments

Rafael Wysocki March 3, 2009, 7:53 p.m. UTC | #1
On Tuesday 03 March 2009, Richard Hughes wrote:
> I've attached a patch that adds KEY_HIBERNATE and clarifies the uses of
> KEY_SUSPEND and KEY_SLEEP.
> 
> Please consider. Thanks.

FWIW, I agree with the naming.

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov March 4, 2009, 8:42 a.m. UTC | #2
On Tue, Mar 03, 2009 at 08:53:04PM +0100, Rafael J. Wysocki wrote:
> On Tuesday 03 March 2009, Richard Hughes wrote:
> > I've attached a patch that adds KEY_HIBERNATE and clarifies the uses of
> > KEY_SUSPEND and KEY_SLEEP.
> > 
> > Please consider. Thanks.
> 
> FWIW, I agree with the naming.
> 

Applied to next, thank you Richard.
diff mbox

Patch

From bc161c6e4253d94dee3b1c42dfcf32a0120921a1 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Tue, 3 Mar 2009 17:16:49 +0000
Subject: [PATCH] INPUT: add KEY_HIBERNATE and clarify the uses of KEY_SUSPEND and KEY_SLEEP

Add a new key define that is used for sleeping to disk.

In userspace we've agreed with the following nomenclature:
 - standby = sleep CPU and devices (not really used any more)
 - suspend = sleep to memory (quite fast)
 - hibernate = sleep to disk (slow)

We've already converted Xorg, HAL, and most of userspace to use the same names.
Adding a new key should reduce the confusion where:

KEY_SUSPEND was mapped to XF86Standby, XF86Hibernate or XF86Sleep
KEY_SLEEP was mapped to XF86Hibernate or XF86Standby

With this patch, the sleep keys can be labeled consistently all the way
through the stack. Other patches to device drivers are to follow.

Signed-off-by: Richard Hughes <hughsient@gmail.com>
---
 include/linux/input.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index 1249a0c..f5dee33 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -263,7 +263,7 @@  struct input_absinfo {
 #define KEY_MENU		139	/* Menu (show menu) */
 #define KEY_CALC		140	/* AL Calculator */
 #define KEY_SETUP		141
-#define KEY_SLEEP		142	/* SC System Sleep */
+#define KEY_SLEEP		142	/* SC System Sleep (either RAM or disk) */
 #define KEY_WAKEUP		143	/* System Wake Up */
 #define KEY_FILE		144	/* AL Local Machine Browser */
 #define KEY_SENDFILE		145
@@ -324,7 +324,7 @@  struct input_absinfo {
 #define KEY_PROG3		202
 #define KEY_PROG4		203
 #define KEY_DASHBOARD		204	/* AL Dashboard */
-#define KEY_SUSPEND		205
+#define KEY_SUSPEND		205	/* Sleep state, typically to RAM */
 #define KEY_CLOSE		206	/* AC Close */
 #define KEY_PLAY		207
 #define KEY_FASTFORWARD		208
@@ -375,6 +375,8 @@  struct input_absinfo {
 
 #define KEY_WIMAX		246
 
+#define KEY_HIBERNATE		247	/* Sleep state, typically to disk */
+
 /* Range 248 - 255 is reserved for special needs of AT keyboard driver */
 
 #define BTN_MISC		0x100
-- 
1.6.1.3