diff mbox

[1/3] Add support for more dell-wmi hotkeys

Message ID 20090429171508.GA717@srcf.ucam.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Matthew Garrett April 29, 2009, 5:15 p.m. UTC
This is the version I'm planning on applying - look ok? I've skipped the 
OSD stuff, since right now we're not going to do anything terribly 
useful with them. I'd prefer some consensus on where we're going with 
these notifications.

commit d0cc3d9de1b8e97a7176ddc7efe48239896100c1
Author: Matthew Garrett <mjg@redhat.com>
Date:   Wed Apr 29 18:07:30 2009 +0100

    From: Mario Limonciello <mario_limonciello@dell.com>
    
    dell-wmi: Add additional keyboard events
    
    Upcoming Dell hardware will send more keyboard events via WMI. Add support
    for them.
    
    Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>

Comments

Mario Limonciello April 29, 2009, 6:20 p.m. UTC | #1
Hi Matthew:

Matthew Garrett wrote:
> This is the version I'm planning on applying - look ok? I've skipped the 
> OSD stuff, since right now we're not going to do anything terribly 
> useful with them. I'd prefer some consensus on where we're going with 
> these notifications.
>
> commit d0cc3d9de1b8e97a7176ddc7efe48239896100c1
> Author: Matthew Garrett <mjg@redhat.com>
> Date:   Wed Apr 29 18:07:30 2009 +0100
>
>     From: Mario Limonciello <mario_limonciello@dell.com>
>     
>     dell-wmi: Add additional keyboard events
>     
>     Upcoming Dell hardware will send more keyboard events via WMI. Add support
>     for them.
>     
>     Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
>
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 81d7179..847f486 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -48,8 +48,49 @@ struct key_entry {
>  
>  enum { KE_KEY, KE_SW, KE_END };
>  
> +/*
> + * There are some additional events sent as scancodes, but these are
> + * not currently terribly relevant to Linux. They are:
> + * 
> + * 0xe020: Mute
> + * 0xe02e: Volume down
> + * 0xe030: Volume up
> + * 0xe00c: Keyboard illumination toggle
> + * 0xe033: Keyboard illumination up
> + * 0xe034: Keyboard illumination down
> + * 0xe00d: BIOS error detected
> + * 0xe013: Ambient light sensor toggle
> + * 0xe03a: Caps lock
> + * 0xe045: Num lock
> + * 0xe046: Scroll lock
> + *
> + * All of these are either notifications (rather than requests for change) or
> + * are also sent via the keyboard controller
> + */
> +
>  static struct key_entry dell_wmi_keymap[] = {
>  	{KE_KEY, 0xe045, KEY_PROG1},
> +        {KE_KEY, 0xe009, KEY_EJECTCD},
> +
> +	/* These also contain the brightness level at offset 6 */
> +	{KE_KEY, 0xe006, KEY_BRIGHTNESSUP},
> +	{KE_KEY, 0xe005, KEY_BRIGHTNESSDOWN},
> +
> +	/* The next device is at offset 6, the active devices are at
> +	   offset 8 and the attached devices at offset 10 */
> +	{KE_KEY, 0xe00b, KEY_DISPLAYTOGGLE},
> +
> +	/* This is actually for all radios. Although physically a
> +	 * switch, the notification does not provide an indication of
> +	 * state and so it should be reported as a key */
> +	{KE_KEY, 0xe008, KEY_WLAN},
> +
> +	/* Wifi Catcher */
> +	{KE_KEY, 0xe011, KEY_PROG2},
> +
> +	/* Battery health status button */
> +	{KE_KEY, 0xe007, KEY_BATTERY},
> +
>  	{KE_END, 0}
>  };
>   
Yeah, that patch looks good.  I personally still think it would  be 
better to "catch" the WMI events for those OSD type keys and do nothing
rather than litter them in dmesg, but this is sane for now otherwise.
Matthew Garrett April 29, 2009, 6:29 p.m. UTC | #2
Oh, hmm, that's true. I'll rework it with that in mind.
Mario Limonciello May 4, 2009, 4:38 p.m. UTC | #3
Hi Matthew:

Matthew Garrett wrote:
> Oh, hmm, that's true. I'll rework it with that in mind.
>   
Any updates on the rework?  What's wrong the approach I proposed before
to just tie them to a dummy key type until something better is available?
Matthew Garrett May 10, 2009, 2:23 a.m. UTC | #4
Sorry, I'm on vacation at the moment - I'll be back on the 18th, so 
should catch up with this then.
Mario Limonciello May 13, 2009, 5:50 p.m. UTC | #5
Hi Matthew:

Matthew Garrett wrote:
> This is the version I'm planning on applying - look ok? I've skipped the 
> OSD stuff, since right now we're not going to do anything terribly 
> useful with them. I'd prefer some consensus on where we're going with 
> these notifications.
>
> commit d0cc3d9de1b8e97a7176ddc7efe48239896100c1
> Author: Matthew Garrett <mjg@redhat.com>
> Date:   Wed Apr 29 18:07:30 2009 +0100
>
>     From: Mario Limonciello <mario_limonciello@dell.com>
>     
>     dell-wmi: Add additional keyboard events
>     
>     Upcoming Dell hardware will send more keyboard events via WMI. Add support
>     for them.
>     
>     Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
>
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 81d7179..847f486 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -48,8 +48,49 @@ struct key_entry {
>  
>  enum { KE_KEY, KE_SW, KE_END };
>  
> +/*
> + * There are some additional events sent as scancodes, but these are
> + * not currently terribly relevant to Linux. They are:
> + * 
> + * 0xe020: Mute
> + * 0xe02e: Volume down
> + * 0xe030: Volume up
> + * 0xe00c: Keyboard illumination toggle
> + * 0xe033: Keyboard illumination up
> + * 0xe034: Keyboard illumination down
> + * 0xe00d: BIOS error detected
> + * 0xe013: Ambient light sensor toggle
> + * 0xe03a: Caps lock
> + * 0xe045: Num lock
> + * 0xe046: Scroll lock
> + *
> + * All of these are either notifications (rather than requests for change) or
> + * are also sent via the keyboard controller
> + */
> +
>  static struct key_entry dell_wmi_keymap[] = {
>  	{KE_KEY, 0xe045, KEY_PROG1},
> +        {KE_KEY, 0xe009, KEY_EJECTCD},
> +
> +	/* These also contain the brightness level at offset 6 */
> +	{KE_KEY, 0xe006, KEY_BRIGHTNESSUP},
> +	{KE_KEY, 0xe005, KEY_BRIGHTNESSDOWN},
> +
> +	/* The next device is at offset 6, the active devices are at
> +	   offset 8 and the attached devices at offset 10 */
> +	{KE_KEY, 0xe00b, KEY_DISPLAYTOGGLE},
> +
> +	/* This is actually for all radios. Although physically a
> +	 * switch, the notification does not provide an indication of
> +	 * state and so it should be reported as a key */
> +	{KE_KEY, 0xe008, KEY_WLAN},
> +
> +	/* Wifi Catcher */
> +	{KE_KEY, 0xe011, KEY_PROG2},
> +
> +	/* Battery health status button */
> +	{KE_KEY, 0xe007, KEY_BATTERY},
> +
>  	{KE_END, 0}
>  };
>   
Two additional comments:

1) Rather  than KEY_DISPLAYTOGGLE, it would make more sense to use
KEY_SWITCHVIDEOMODE.

2) There is another scancode that should be tied to KEY_SWITCHVIDEOMODE,
0xe09b.  Machines will support one or the other, but not both.

Regards
diff mbox

Patch

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 81d7179..847f486 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -48,8 +48,49 @@  struct key_entry {
 
 enum { KE_KEY, KE_SW, KE_END };
 
+/*
+ * There are some additional events sent as scancodes, but these are
+ * not currently terribly relevant to Linux. They are:
+ * 
+ * 0xe020: Mute
+ * 0xe02e: Volume down
+ * 0xe030: Volume up
+ * 0xe00c: Keyboard illumination toggle
+ * 0xe033: Keyboard illumination up
+ * 0xe034: Keyboard illumination down
+ * 0xe00d: BIOS error detected
+ * 0xe013: Ambient light sensor toggle
+ * 0xe03a: Caps lock
+ * 0xe045: Num lock
+ * 0xe046: Scroll lock
+ *
+ * All of these are either notifications (rather than requests for change) or
+ * are also sent via the keyboard controller
+ */
+
 static struct key_entry dell_wmi_keymap[] = {
 	{KE_KEY, 0xe045, KEY_PROG1},
+        {KE_KEY, 0xe009, KEY_EJECTCD},
+
+	/* These also contain the brightness level at offset 6 */
+	{KE_KEY, 0xe006, KEY_BRIGHTNESSUP},
+	{KE_KEY, 0xe005, KEY_BRIGHTNESSDOWN},
+
+	/* The next device is at offset 6, the active devices are at
+	   offset 8 and the attached devices at offset 10 */
+	{KE_KEY, 0xe00b, KEY_DISPLAYTOGGLE},
+
+	/* This is actually for all radios. Although physically a
+	 * switch, the notification does not provide an indication of
+	 * state and so it should be reported as a key */
+	{KE_KEY, 0xe008, KEY_WLAN},
+
+	/* Wifi Catcher */
+	{KE_KEY, 0xe011, KEY_PROG2},
+
+	/* Battery health status button */
+	{KE_KEY, 0xe007, KEY_BATTERY},
+
 	{KE_END, 0}
 };