]> err.no Git - linux-2.6/commitdiff
Input: atkbd - fix HP 2133 not sending release event for video switch
authorJiri Kosina <jkosina@suse.cz>
Thu, 26 Jun 2008 14:46:38 +0000 (10:46 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 30 Jun 2008 13:37:40 +0000 (09:37 -0400)
Video switch key on HP 2133 doesn't send release event, so we
have to create workaround similar to what we do for Dell Latitude,
i.e. perform DMI match for the system and generate 'false' release
event ourselves, so that userspace doesn't think that the key is
stuck forever.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/atkbd.c

index c27537be82ae435a042f7288574c1476d3b2b481..b1ce10f50bcfcf7a14eca2c8c4cd9606efaecd90 100644 (file)
@@ -850,6 +850,23 @@ static void atkbd_latitude_keymap_fixup(struct atkbd *atkbd)
                                  atkbd->force_release_mask);
 }
 
+/*
+ * Perform fixup for HP system that doesn't generate release
+ * for its video switch
+ */
+static void atkbd_hp_keymap_fixup(struct atkbd *atkbd)
+{
+       const unsigned int forced_release_keys[] = {
+               0x94,
+       };
+       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
@@ -1452,6 +1469,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
                .callback = atkbd_setup_fixup,
                .driver_data = atkbd_latitude_keymap_fixup,
        },
+       {
+               .ident = "HP 2133",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"),
+               },
+               .callback = atkbd_setup_fixup,
+               .driver_data = atkbd_hp_keymap_fixup,
+       },
        { }
 };