From 64b386ea16112564e0b93473e2c347125effb6b2 Mon Sep 17 00:00:00 2001 From: Richard Nauber Date: Mon, 28 Jun 2010 18:54:25 +0200 Subject: HID: add proper support 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 Signed-off-by: Richard Nauber [jkosina@suse.cz: fix build error] Signed-off-by: Jiri Kosina --- drivers/hid/hid-elecom.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 drivers/hid/hid-elecom.c (limited to 'drivers/hid/hid-elecom.c') diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c new file mode 100644 index 000000000000..7a40878f46b4 --- /dev/null +++ b/drivers/hid/hid-elecom.c @@ -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 + */ + +/* + * 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 +#include +#include + +#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"); -- cgit v1.2.3