2010-06-29 00:54:25 +08:00
|
|
|
/*
|
|
|
|
* 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 <Richard.Nauber@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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"
|
|
|
|
|
2010-08-07 03:03:06 +08:00
|
|
|
static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
|
|
|
unsigned int *rsize)
|
2010-06-29 00:54:25 +08:00
|
|
|
{
|
2010-08-07 03:03:06 +08:00
|
|
|
if (*rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
|
2010-12-10 11:29:03 +08:00
|
|
|
hid_info(hdev, "Fixing up Elecom BM084 report descriptor\n");
|
2010-06-29 00:54:25 +08:00
|
|
|
rdesc[47] = 0x00;
|
|
|
|
}
|
2015-10-11 22:18:22 +08:00
|
|
|
return rdesc;
|
2010-06-29 00:54:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
};
|
2012-12-18 06:28:26 +08:00
|
|
|
module_hid_driver(elecom_driver);
|
2010-06-29 00:54:25 +08:00
|
|
|
|
|
|
|
MODULE_LICENSE("GPL");
|