+ correct-keymapping-on-powerbook-built-in-usb-iso-keyboards.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     correct keymapping on Powerbook built-in USB ISO keyboards
has been added to the -mm tree.  Its filename is
     correct-keymapping-on-powerbook-built-in-usb-iso-keyboards.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: correct keymapping on Powerbook built-in USB ISO keyboards
From: Olaf Hering <olh@xxxxxxx>

similar to the version in adbhid_input_register(): The '<>' key and the
'^°' key on a german keyboard is swapped.  Provide correct keys to
userland, external USB keyboards will not work correctly when the
'badmap'/'goodmap' workarounds from xkeyboard-config are used.

It is expected that distributions drop the badmap/goodmap part from
keycodes/macintosh in the xkeyboard-config package.

This is probably 2.6.18.x material, if major distros settle on 2.6.18.

Signed-off-by: Olaf Hering <olh@xxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Cc: Dmitry Torokhov <dtor@xxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/usb/input/hid-core.c  |    4 ++--
 drivers/usb/input/hid-input.c |   17 +++++++++++++++++
 drivers/usb/input/hid.h       |    1 +
 3 files changed, 20 insertions(+), 2 deletions(-)

diff -puN drivers/usb/input/hid-core.c~correct-keymapping-on-powerbook-built-in-usb-iso-keyboards drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c~correct-keymapping-on-powerbook-built-in-usb-iso-keyboards
+++ a/drivers/usb/input/hid-core.c
@@ -1800,10 +1800,10 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
 	{ USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },
 	{ USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },
-	{ USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN },
+	{ USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
 	{ USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN },
 	{ USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN },
-	{ USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN },
+	{ USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
 	{ USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN },
 	{ USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
 	{ USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
diff -puN drivers/usb/input/hid-input.c~correct-keymapping-on-powerbook-built-in-usb-iso-keyboards drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c~correct-keymapping-on-powerbook-built-in-usb-iso-keyboards
+++ a/drivers/usb/input/hid-input.c
@@ -121,6 +121,12 @@ static struct hidinput_key_translation p
 	{ }
 };
 
+static struct hidinput_key_translation powerbook_iso_keyboard[] = {
+	{ KEY_GRAVE,    KEY_102ND },
+	{ KEY_102ND,    KEY_GRAVE },
+	{ }
+};
+
 static int usbhid_pb_fnmode = 1;
 module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
 MODULE_PARM_DESC(pb_fnmode,
@@ -195,6 +201,14 @@ static int hidinput_pb_event(struct hid_
 		}
 	}
 
+	if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) {
+		trans = find_translation(powerbook_iso_keyboard, usage->code);
+		if (trans) {
+			input_event(input, usage->type, trans->to, value);
+			return 1;
+		}
+	}
+
 	return 0;
 }
 
@@ -210,6 +224,9 @@ static void hidinput_pb_setup(struct inp
 
 	for (trans = powerbook_numlock_keys; trans->from; trans++)
 		set_bit(trans->to, input->keybit);
+
+	for (trans = powerbook_iso_keyboard; trans->from; trans++)
+		set_bit(trans->to, input->keybit);
 }
 #else
 static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
diff -puN drivers/usb/input/hid.h~correct-keymapping-on-powerbook-built-in-usb-iso-keyboards drivers/usb/input/hid.h
--- a/drivers/usb/input/hid.h~correct-keymapping-on-powerbook-built-in-usb-iso-keyboards
+++ a/drivers/usb/input/hid.h
@@ -261,6 +261,7 @@ struct hid_item {
 #define HID_QUIRK_POWERBOOK_FN_ON		0x00002000
 #define HID_QUIRK_INVERT_HWHEEL			0x00004000
 #define HID_QUIRK_BAD_RELATIVE_KEYS		0x00008000
+#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD	0x00010000
 
 /*
  * This is the global environment of the parser. This information is
_

Patches currently in -mm which might be from olh@xxxxxxx are

correct-keymapping-on-powerbook-built-in-usb-iso-keyboards.patch
correct-misc_register-return-code-handling-in-several-drivers.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux