Skip to contentSkip to conversation

toshiba_acpi.c: Add key_entry for a lone FN keypress

PATCH Applied Jon Dowland 4 participants 8 messages Oct 23, 2010 – Nov 24, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toshiba_acpi.c: Add key_entry for a lone FN keypress

A lone FN key press on a Toshiba Portégé R700 without another key in conjunction results in an ACPI event and a spurious error message on the console.

Add a key entry to map this event to a KEY_UNKNOWN keypress silences this message.

----

drivers/platform/x86/toshiba_acpi.c +1 -0
index a388bd6..954443e 100644
@@ -142,6 +142,7 @@ static struct key_entry toshiba_acpi_keymap[]  = {
 	{KE_KEY, 0x141, KEY_BRIGHTNESSUP},
 	{KE_KEY, 0x142, KEY_WLAN},
 	{KE_KEY, 0x143, KEY_PROG1},
+	{KE_KEY, 0x17f, KEY_UNKNOWN}, /* FN key by itself */
 	{KE_KEY, 0xb05, KEY_PROG2},
 	{KE_KEY, 0xb06, KEY_WWW},
 	{KE_KEY, 0xb07, KEY_MAIL},
#1 lore raw
Quoted 7 lines · Jon Dowland

A lone FN key press on a Toshiba Portégé R700 without another key in conjunction results in an ACPI event and a spurious error message on the console.

Add a key entry to map this event to a KEY_UNKNOWN keypress silences this message.

Well, if FN key can generate separate events then we should report KEY_FN, not KEY_UNKNOWN.

Thanks.

Signature · 1 line
Dmitry
maintainer
#2 lore raw

Hi,

It actually generates on key press/release with different key codes, 0x17f and 0x100 respectively. So I think that both should be added.

Quoted 21 lines · Dmitry Torokhov
Quoted 7 lines · Jon Dowland

A lone FN key press on a Toshiba Portégé R700 without another key in conjunction results in an ACPI event and a spurious error message on the console.

Add a key entry to map this event to a KEY_UNKNOWN keypress silences this message.

Well, if FN key can generate separate events then we should report KEY_FN, not KEY_UNKNOWN.

Thanks.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 1 line
-- El mundo apesta y vosotros apestais tambien --
#3 lore raw
Quoted 2 lines · Azael Avalos

It actually generates on key press/release with different key codes, 0x17f and 0x100 respectively. So I think that both should be added.

Presently the driver ignores key release events and only deals with key presses. It also filters out a 0x100 value specifically in the event handler. Do you mean something like this (untested)?

toshiba_acpi.c renamed from toshiba_acpi.c~ +2 -2
@@ -123,6 +123,7 @@
 MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
 
 static const struct key_entry toshiba_acpi_keymap[] __initconst = {
+	{ KE_KEY, 0x100, { KEY_FN } }, /* up */
 	{ KE_KEY, 0x101, { KEY_MUTE } },
 	{ KE_KEY, 0x102, { KEY_ZOOMOUT } },
 	{ KE_KEY, 0x103, { KEY_ZOOMIN } },
@@ -135,6 +136,7 @@
 	{ KE_KEY, 0x141, { KEY_BRIGHTNESSUP } },
 	{ KE_KEY, 0x142, { KEY_WLAN } },
 	{ KE_KEY, 0x143, { KEY_PROG1 } },
+	{ KE_KEY, 0x17f, { KEY_FN } }, /* down */
 	{ KE_KEY, 0xb05, { KEY_PROG2 } },
 	{ KE_KEY, 0xb06, { KEY_WWW } },
 	{ KE_KEY, 0xb07, { KEY_MAIL } },
@@ -854,8 +856,6 @@
 	do {
 		hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result);
 		if (hci_result == HCI_SUCCESS) {
-			if (value == 0x100)
-				continue;
 			/* act on key press; ignore key release */
 			if (value & 0x80)
 				continue;
#4 lore raw
In reply to Dmitry Torokhov
Quoted 2 lines · Dmitry Torokhov

Well, if FN key can generate separate events then we should report KEY_FN, not KEY_UNKNOWN.

Good point, thanks. I missed that when I went shopping for an appropriate KEY_*.

Adjusted patch to apply on top of current HEAD.

A lone FN key press on a Toshiba Portégé R700 without another key in conjunction results in an ACPI event and a spurious error message on the console.

Add a key entry to map this event to a KEY_UNKNOWN keypress silences this message.

----

drivers/platform/x86/toshiba_acpi.c +1 -0
@@ -135,6 +135,7 @@
 	{ KE_KEY, 0x141, { KEY_BRIGHTNESSUP } },
 	{ KE_KEY, 0x142, { KEY_WLAN } },
 	{ KE_KEY, 0x143, { KEY_PROG1 } },
+	{ KE_KEY, 0x17f, { KEY_FN } },
 	{ KE_KEY, 0xb05, { KEY_PROG2 } },
 	{ KE_KEY, 0xb06, { KEY_WWW } },
 	{ KE_KEY, 0xb07, { KEY_MAIL } },
#5 lore raw
Quoted 7 lines · Jon Dowland
Quoted 2 lines · Dmitry Torokhov

Well, if FN key can generate separate events then we should report KEY_FN, not KEY_UNKNOWN.

Good point, thanks. I missed that when I went shopping for an appropriate KEY_*.

Quoted 7 lines

Adjusted patch to apply on top of current HEAD.

A lone FN key press on a Toshiba Portégé R700 without another key in conjunction results in an ACPI event and a spurious error message on the console.

Add a key entry to map this event to a KEY_UNKNOWN keypress silences

                                         ^^^^^^

Better fix commit log message as well. Otherwise:

(or whatever tag Matthew might want to change it).

Quoted 15 lines

this message.

----

drivers/platform/x86/toshiba_acpi.c +1 -0
@@ -135,6 +135,7 @@
 	{ KE_KEY, 0x141, { KEY_BRIGHTNESSUP } },
 	{ KE_KEY, 0x142, { KEY_WLAN } },
 	{ KE_KEY, 0x143, { KEY_PROG1 } },
+	{ KE_KEY, 0x17f, { KEY_FN } },
 	{ KE_KEY, 0xb05, { KEY_PROG2 } },
 	{ KE_KEY, 0xb06, { KEY_WWW } },
 	{ KE_KEY, 0xb07, { KEY_MAIL } },
Signature · 1 line
Dmitry
#6 lore raw
Quoted 6 lines · Dmitry Torokhov
Quoted 1 line

Add a key entry to map this event to a KEY_UNKNOWN keypress silences

                                         ^^^^^^

Better fix commit log message as well. Otherwise:

Thanks.

----

A lone FN key press on a Toshiba Portégé R700 without another key in conjunction results in an ACPI event and a spurious error message on the console.

Add a key entry to map this event to a KEY_FN keypress. This prevents the console message.

drivers/platform/x86/toshiba_acpi.c +1 -0
index 06f304f..e10747a 100644
@@ -135,6 +135,7 @@ static const struct key_entry toshiba_acpi_keymap[] __initconst = {
 	{ KE_KEY, 0x141, { KEY_BRIGHTNESSUP } },
 	{ KE_KEY, 0x142, { KEY_WLAN } },
 	{ KE_KEY, 0x143, { KEY_PROG1 } },
+	{ KE_KEY, 0x17f, { KEY_FN } },                                          
 	{ KE_KEY, 0xb05, { KEY_PROG2 } },
 	{ KE_KEY, 0xb06, { KEY_WWW } },
 	{ KE_KEY, 0xb07, { KEY_MAIL } },