Skip to contentSkip to conversation

thinkpad_acpi: Add mappings for F9 - F12 hotkeys on X240 / T440 / T540

PATCH Superseded Hans de Goede 3 participants 6 messages Apr 9, 2014 – Apr 10, 2014 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

v2 cover thinkpad_acpi: Add mappings for F9 - F12 hotkeys on X240 / T440 / T540

Hi,

This patch seems to have fallen through the cracks, so here is a resend.

While at it I've also updated the comment / commit msg to reflect that these new keys can not just be found on the T440 but also on the X240 and T540, hence the v2.

Regards,

Hans

#1 lore raw

PATCH v2 1/1 thinkpad_acpi: Add mappings for F9 - F12 hotkeys on X240 / T440 / T540

The T440s user guide says that when Fn-lock is not active, the *40s' F9 - F12 keys should be mapped to: control-panel, search, show-all-windows and Computer.

These keys generate the sofar unused 28 - 31 hotkey scancodes.

For the first 2 this nicely matches the icons on the keys, for the latter 2 the icons are somewhat creative, which is why I ended up looking them up in the user manual.

---
 drivers/platform/x86/thinkpad_acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +3 -1
index defb6af..8789a26 100644
@@ -3167,8 +3167,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
 		KEY_MICMUTE,	/* 0x1a: Mic mute (since ?400 or so) */
 
 		/* (assignments unknown, please report if found) */
-		KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
 		KEY_UNKNOWN,
+
+		/* Extra keys in use since the X240 / T440 / T540 */
+		KEY_CONFIG, KEY_SEARCH, KEY_SCALE, KEY_COMPUTER,
 		},
 	};
 
Signature · 1 line
1.9.0
#2 lore raw
In reply to Hans de Goede
Quoted 1 line · Hans de Goede

This patch seems to have fallen through the cracks, so here is a resend.

Sort of. There was a doubt about one of the keycodes.

BTW, how does this interacts with the adaptative keyboard in the X1C and friends? Is it valid for them as well?

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
#3 lore raw
Quoted 4 lines · Henrique de Moraes Holschuh
Quoted 1 line · Hans de Goede

This patch seems to have fallen through the cracks, so here is a resend.

Sort of. There was a doubt about one of the keycodes.

I think I'm ok with the keycode.

Signature · 1 line
Matthew Garrett | [email protected]
#4 lore raw
Quoted 7 lines · Matthew Garrett
Quoted 4 lines · Henrique de Moraes Holschuh
Quoted 1 line · Hans de Goede

This patch seems to have fallen through the cracks, so here is a resend.

Sort of. There was a doubt about one of the keycodes.

I think I'm ok with the keycode.

Ok. Now, provided that it doesn't clash with the other thinkpads (in which case we'd just add selective keymaps), we can merge.

Heck, we can fix that later too, it doesn't count as an ABI break, these keymaps are _already_ configurable from userspace _and_ usually reconfigured by userspace, the driver just tries to provide sane defaults. So...

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
#5 lore raw

Hi,

Quoted 11 lines · Henrique de Moraes Holschuh
Quoted 7 lines · Matthew Garrett
Quoted 4 lines · Henrique de Moraes Holschuh
Quoted 1 line · Hans de Goede

This patch seems to have fallen through the cracks, so here is a resend.

Sort of. There was a doubt about one of the keycodes.

I think I'm ok with the keycode.

Ok. Now, provided that it doesn't clash with the other thinkpads (in which case we'd just add selective keymaps), we can merge.

It does not clash with the new Carbon X1 2nd generation stuff, see:
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=8f5f86abc6593b6d600712435e2f24a7a098b951

Basically the new stuff uses hotkey codes >= TPACPI_HOTKEY_MAP_LEN, where as my patch adds mappings for codes < TPACPI_HOTKEY_MAP_LEN.

(Where TPACPI_HOTKEY_MAP_LEN == 32)

Quoted 5 lines

Heck, we can fix that later too, it doesn't count as an ABI break, these keymaps are _already_ configurable from userspace _and_ usually reconfigured by userspace, the driver just tries to provide sane defaults. So...

Thanks & Regards,

Hans