Skip to contentSkip to conversation

HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).

PATCH Superseded Richard Nauber 1 participant 1 message Jun 18, 2010 HID

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).

HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).

This patch removes the annoying feature of Elecoms BM084 to constantly scroll to the right.
The device can be found at:
http://www.dealextreme.com/details.dx/sku.15402

---
 drivers/hid/Kconfig      |    6 +++++
 drivers/hid/Makefile     |    1 +
 drivers/hid/hid-elecom.c |   57
++++++++++++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-ids.h    |    3 ++
 4 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hid/hid-elecom.c
drivers/hid/Kconfig +6 -0
index 132278f..0eac193 100644
@@ -148,6 +148,12 @@ config HID_EGALAX
 	---help---
 	Support for the eGalax dual-touch panel.
 
+config HID_ELECOM
+	tristate "ELECOM"
+	depends on USB_HID
+	---help---
+	Support for the ELECOM BM084 (bluetooth mouse).
+
 config HID_EZKEY
 	tristate "Ezkey" if EMBEDDED
 	depends on USB_HID
drivers/hid/Makefile +1 -0
index 987fa06..2ec042f 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
 obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
 obj-$(CONFIG_HID_DRAGONRISE)	+= hid-drff.o
 obj-$(CONFIG_HID_EGALAX)	+= hid-egalax.o
+obj-$(CONFIG_HID_ELECOM)	+= hid-elecom.o
 obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
 obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
 obj-$(CONFIG_HID_KENSINGTON)	+= hid-kensington.o
drivers/hid/hid-elecom.c new file +12 -0
new file mode 100644
index 0000000..7a40878
@@ -0,0 +1,57 @@
+/*
+ *  HID driver for Elecom BM084 (bluetooth mouse).
+ *  Removes a non-existing horizontal wheel from
+ *  the HID descriptor.
+ *  (This module is based on "hid-ortek".)
+ *
+ *  Copyright (c) 2010 Richard Nauber <[email protected]>
+ */
+
+/*
+ * 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"
+
+static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+ unsigned int rsize)
+{
+ if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
+ dev_info(&hdev->dev, "Fixing up Elecom BM084 "
+ "report descriptor.\n");
+ rdesc[47] = 0x00;
+ }
+}
+
+static const struct hid_device_id elecom_devices[] = {
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
+ { }
+};
+MODULE_DEVICE_TABLE(hid, elecom_devices);
+
+static struct hid_driver elecom_driver = {
+ .name = "elecom",
+ .id_table = elecom_devices,
+ .report_fixup = elecom_report_fixup
+};
+
+static int __init elecom_init(void)
+{
+ return hid_register_driver(&elecom_driver);
+}
+
+static void __exit elecom_exit(void)
+{
+ hid_unregister_driver(&elecom_driver);
+}
+
+module_init(elecom_init);
+module_exit(elecom_exit);
+MODULE_LICENSE("GPL");

drivers/hid/hid-ids.h +3 -0
index 6af77ed..55cecb7 100644
@@ -186,6 +186,9 @@
 #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH	0x480d
 
+#define USB_VENDOR_ID_ELECOM		0x056e
+#define USB_DEVICE_ID_ELECOM_BM084	0x0061
+
 #define USB_VENDOR_ID_ELO		0x04E7
 #define USB_DEVICE_ID_ELO_TS2700	0x0020
 
Signature · 1 line
1.7.0.4