linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg@redhat.com>
To: Richard Hughes <hughsient@gmail.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	linux-acpi <linux-acpi@vger.kernel.org>,
	Peter Hutterer <peter.hutterer@redhat.com>,
	linux-input <linux-input@vger.kernel.org>,
	Matthias Clasen <mclasen@redhat.com>
Subject: Re: suspend / hibernate nomenclature
Date: Sat, 7 Mar 2009 20:39:46 +0000	[thread overview]
Message-ID: <20090307203946.GA9942@srcf.ucam.org> (raw)
In-Reply-To: <15e53e180903071225h47bcdbaj83986b50f06135c3@mail.gmail.com>

On Sat, Mar 07, 2009 at 08:25:27PM +0000, Richard Hughes wrote:

> Xorg and evdev already does the right thing, we have XF86Hibernate
> now. All I have to do is patch HAL to check the kernel version and
> then everything in userspace we care about should just work. We have
> to sort out the insane mappings sooner or later, and what I've put in
> linux-next seems to be the right way of dong this, rather than the way
> things used to be (suspend -> hibernate, sleep->suspend,
> standby->sleep). I'm fed up of debugging why sleep buttons don't work
> right in userspace when the kernel isn't sure what button to emit.

We don't have to at all - as far as I've been able to tell, the kernel 
is utterly consistent in its current usage. The only drivers that emit 
KEY_SLEEP are either embedded-specific (where it's clearly suspend to 
RAM and not hibernate), the ACPI driver (where usage in other operating 
systems is consistent with it being suspent to RAM) and the panasonic 
and thinkpad drivers which use it consistently. If there's any 
confusion, it's over the fact that KEY_SUSPEND is is used for suspend to 
RAM in a (smaller) number of places.

I'd suggest reverting these current patches and doing something like the 
following and then changing any drivers where it's worth clarifying 
things. This has exactly the same effect with the advantage that no 
userspace needs to be changed.

diff --git a/include/linux/input.h b/include/linux/input.h
index 1249a0c..90abe27 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_SUSPEND_TO_RAM	142	/* SC System Sleep */
 #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_HIBERNATE		205
 #define KEY_CLOSE		206	/* AC Close */
 #define KEY_PLAY		207
 #define KEY_FASTFORWARD		208
@@ -377,6 +377,10 @@ struct input_absinfo {
 
 /* Range 248 - 255 is reserved for special needs of AT keyboard driver */
 
+/* Deprecated - use KEY_SUSPEND_TO_RAM and KEY_HIBERNATE instead */
+#define KEY_SLEEP		KEY_SUSPEND_TO_RAM
+#define KEY_SUSPEND		KEY_HIBERNATE
+
 #define BTN_MISC		0x100
 #define BTN_0			0x100
 #define BTN_1			0x101

-- 
Matthew Garrett | mjg59@srcf.ucam.org

  reply	other threads:[~2009-03-07 20:39 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02 11:13 suspend / hibernate nomenclature Richard Hughes
2009-03-02 11:24 ` Henrique de Moraes Holschuh
2009-03-02 12:11   ` Richard Hughes
2009-03-03 17:20     ` [patch] add KEY_HIBERNATE and clarify the uses of KEY_SUSPEND and KEY_SLEEP Richard Hughes
2009-03-03 19:53       ` Rafael J. Wysocki
2009-03-04  8:42         ` Dmitry Torokhov
2009-03-04 10:54   ` [PATCH] thinkpad-acpi: use correct key names for sleep states in driver Richard Hughes
2009-03-04 10:58     ` [PATCH] panasonic-laptop: " Richard Hughes
2009-03-04 23:58       ` Harald Welte
2009-03-05  9:09         ` Richard Hughes
2009-03-04 11:09     ` [PATCH] DVB-USB: correct the comment about KEY_SLEEP Richard Hughes
2009-03-10 10:31       ` Antti Palosaari
2009-03-04 12:04     ` [PATCH] thinkpad-acpi: use correct key names for sleep states in driver Henrique de Moraes Holschuh
2009-08-18 20:02       ` Yves-Alexis Perez
2009-08-18 20:10         ` Matthew Garrett
2009-08-18 20:27           ` Yves-Alexis Perez
2009-08-18 20:45             ` Matthew Garrett
2009-08-22 18:02               ` Henrique de Moraes Holschuh
2009-08-19  9:18             ` Ali Abdallah
2009-08-26 11:36           ` Yves-Alexis Perez
2009-08-26 13:43             ` Matthew Garrett
2009-08-26 17:52               ` Yves-Alexis Perez
2009-08-26 22:51                 ` Henrique de Moraes Holschuh
2009-08-27  6:18                   ` Dmitry Torokhov
2009-08-28  0:34                     ` Henrique de Moraes Holschuh
2009-03-07  8:37 ` suspend / hibernate nomenclature Andrey Borzenkov
2009-03-07 15:48 ` Matthew Garrett
2009-03-07 16:41   ` Henrique de Moraes Holschuh
2009-03-07 16:48     ` Matthew Garrett
2009-03-07 17:17       ` Henrique de Moraes Holschuh
2009-03-07 20:25       ` Richard Hughes
2009-03-07 20:39         ` Matthew Garrett [this message]
2009-03-08  8:45           ` Richard Hughes
2009-03-08 14:41             ` Matthew Garrett
2009-03-08 20:56               ` Rafael J. Wysocki
2009-03-08 23:07                 ` Dmitry Torokhov
2009-03-08 23:19                   ` Matthew Garrett
2009-03-09 13:52                     ` Ville Syrjälä
2009-03-09 14:00                       ` Matthew Garrett
2009-03-09 15:10                         ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090307203946.GA9942@srcf.ucam.org \
    --to=mjg@redhat.com \
    --cc=hmh@hmh.eng.br \
    --cc=hughsient@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mclasen@redhat.com \
    --cc=peter.hutterer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).