aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid/hid-kye.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 15:25:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 15:25:44 -0700
commit5fba0925fd6b67d94181055b7222e3d934b4efee (patch)
tree167c0e259ec94f426674d3f79563c3e556cda845 /drivers/hid/hid-kye.c
parent811158b147a503fbdf9773224004ffd32002d1fe (diff)
parent621de593081524da2f0f7b060f5951b4155eb4a2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: remove compat stuff HID: constify arrays of struct apple_key_translation HID: add support for Kye/Genius Ergo 525V HID: Support Apple mini aluminum keyboard HID: support for Kensington slimblade device HID: DragonRise game controller force feedback driver HID: add support for another version of 0e8f:0003 device in hid-pl HID: fix race between usb_register_dev() and hiddev_open() HID: bring back possibility to specify vid/pid ignore on module load HID: make HID_DEBUG defaults consistent HID: autosuspend -- fix lockup of hid on reset HID: hid_reset_resume() needs to be defined only when CONFIG_PM is set HID: fix USB HID devices after STD with autosuspend HID: do not try to compile PM code with CONFIG_PM unset HID: autosuspend support for USB HID
Diffstat (limited to 'drivers/hid/hid-kye.c')
-rw-r--r--drivers/hid/hid-kye.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c
new file mode 100644
index 00000000000..72ee3fec56d
--- /dev/null
+++ b/drivers/hid/hid-kye.c
@@ -0,0 +1,69 @@
+/*
+ * HID driver for Kye/Genius devices not fully compliant with HID standard
+ *
+ * Copyright (c) 2009 Jiri Kosina
+ * Copyright (c) 2009 Tomas Hanak
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+
+#include "hid-ids.h"
+
+/* the fixups that need to be done:
+ * - change led usage page to button for extra buttons
+ * - report size 8 count 1 must be size 1 count 8 for button bitfield
+ * - change the button usage range to 4-7 for the extra buttons
+ */
+static void kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+ unsigned int rsize)
+{
+ if (rsize >= 74 &&
+ rdesc[61] == 0x05 && rdesc[62] == 0x08 &&
+ rdesc[63] == 0x19 && rdesc[64] == 0x08 &&
+ rdesc[65] == 0x29 && rdesc[66] == 0x0f &&
+ rdesc[71] == 0x75 && rdesc[72] == 0x08 &&
+ rdesc[73] == 0x95 && rdesc[74] == 0x01) {
+ dev_info(&hdev->dev, "fixing up Kye/Genius Ergo Mouse report "
+ "descriptor\n");
+ rdesc[62] = 0x09;
+ rdesc[64] = 0x04;
+ rdesc[66] = 0x07;
+ rdesc[72] = 0x01;
+ rdesc[74] = 0x08;
+ }
+}
+
+static const struct hid_device_id kye_devices[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
+ { }
+};
+MODULE_DEVICE_TABLE(hid, kye_devices);
+
+static struct hid_driver kye_driver = {
+ .name = "kye",
+ .id_table = kye_devices,
+ .report_fixup = kye_report_fixup,
+};
+
+static int kye_init(void)
+{
+ return hid_register_driver(&kye_driver);
+}
+
+static void kye_exit(void)
+{
+ hid_unregister_driver(&kye_driver);
+}
+
+module_init(kye_init);
+module_exit(kye_exit);
+MODULE_LICENSE("GPL");