[PATCH] Patch for kernel-module "hid-apple.ko" to allow disabling hard-coded ISO-layout by using a module option

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

 



This patch adds a new option named "iso_layout" to the driver
"hid-apple.ko", to allow disabling of the hard-coded ISO-layout. 

Disabling the hard-coded layout solves the problem that the
kernel-module only works perfectly for the english/american version of
the Apple aluminum keyboard. Other versions have swapped keys, e.g. the
"<"-key  is swapped with "^"-key on the german keyboard. There is a very
long bug-entry on Launchpad to this problem:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/214786

The patch applies cleanly with various kernel versions (.29 to 33rc2).


Signed-off-by: Stefan Glasenhardt <stefan@xxxxxxxxxxxxxxx>
---

--- linux-2.6/drivers/hid/hid-apple.c.orig	2010-01-05 22:49:20 +0100
+++ linux-2.6/drivers/hid/hid-apple.c	2010-01-05 22:58:36 +0100
@@ -40,6 +40,11 @@ module_param(fnmode, uint, 0644);
 MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, "
 		"[1] = fkeyslast, 2 = fkeysfirst)");
 
+static unsigned int iso_layout = 1;
+module_param(iso_layout, uint, 0644);
+MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. "
+		"(0 = disabled, [1] = enabled)");
+
 struct apple_sc {
 	unsigned long quirks;
 	unsigned int fn_on;
@@ -199,11 +204,13 @@ static int hidinput_apple_event(struct h
 		}
 	}
 
-	if (asc->quirks & APPLE_ISO_KEYBOARD) {
-		trans = apple_find_translation(apple_iso_keyboard, usage->code);
-		if (trans) {
-			input_event(input, usage->type, trans->to, value);
-			return 1;
+        if (iso_layout) {
+		if (asc->quirks & APPLE_ISO_KEYBOARD) {
+			trans = apple_find_translation(apple_iso_keyboard, usage->code);
+			if (trans) {
+				input_event(input, usage->type, trans->to, value);
+				return 1;
+			}
 		}
 	}
 

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux