[PATCH] force key-release events for Samsung p560 and r560 laptops in atkbd.c

From: Gordon
Date: Mon Jun 15 2009 - 05:13:30 EST


Hi all,
certain FN keys on the Samsung P560 and R560 laptops do not produce
"unknown key pressed" events in dmesg. But if I use setkeycodes to
make them known the keyboard gets 'stuck'. These keys seem to not send
keyrelease events.

Attached is a patch for the SAMSUNG P560 laptop, the DMI match just
needs to be modified to work for the R560 model as well. keycodes are
afaik (a colleague has the R560) the same for both. I modified an
existing patch for the NC10 from bugzilla as it is basically the same
problem.

Thread:
http://bugzilla.kernel.org/show_bug.cgi?id=12021

and here is my bug report:
https://bugs.launchpad.net/ubuntu/+source/hal-info/+bug/338182

I hope someone can include this patch into newer releases of the kernel :)

with best regards,
Gordon Köfner
--- linux-2.6.28-old/drivers/input/keyboard/atkbd.c 2008-12-13 23:52:26.000000000 +0000
+++ linux-2.6.28/drivers/input/keyboard/atkbd.c 2008-12-14 18:16:23.000000000 +0000
@@ -884,6 +884,21 @@ static void atkbd_inventec_keymap_fixup(
}

/*
+ * Samsung P560 with Fn+F? key release not working
+ */
+static void atkbd_samsung_keymap_fixup(struct atkbd *atkbd)
+{
+ const unsigned int forced_release_keys[] = {
+ 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb1, 0xb3, 0xf7
+ };
+ int i;
+ if (atkbd->set == 2)
+ for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
+ __set_bit(forced_release_keys[i],
+ atkbd->force_release_mask);
+}
+
+/*
* atkbd_set_keycode_table() initializes keyboard's keycode table
* according to the selected scancode set
*/
@@ -1493,6 +1508,15 @@ static struct dmi_system_id atkbd_dmi_qu
.callback = atkbd_setup_fixup,
.driver_data = atkbd_inventec_keymap_fixup,
},
+ {
+ .ident = "Samsung P560",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P560"),
+ },
+ .callback = atkbd_setup_fixup,
+ .driver_data = atkbd_samsung_keymap_fixup,
+ },
{ }
};