blob: 6e3848a8d8dd1416a0091ce0e7d263325dd8910b [file] [log] [blame]
Richard Nauber64b386e2010-06-28 18:54:25 +02001/*
2 * HID driver for Elecom BM084 (bluetooth mouse).
3 * Removes a non-existing horizontal wheel from
4 * the HID descriptor.
5 * (This module is based on "hid-ortek".)
6 *
7 * Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
13 * Software Foundation; either version 2 of the License, or (at your option)
14 * any later version.
15 */
16
17#include <linux/device.h>
18#include <linux/hid.h>
19#include <linux/module.h>
20
21#include "hid-ids.h"
22
Nikolai Kondrashov73e40082010-08-06 23:03:06 +040023static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
24 unsigned int *rsize)
Richard Nauber64b386e2010-06-28 18:54:25 +020025{
Nikolai Kondrashov73e40082010-08-06 23:03:06 +040026 if (*rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
Joe Perches4291ee32010-12-09 19:29:03 -080027 hid_info(hdev, "Fixing up Elecom BM084 report descriptor\n");
Richard Nauber64b386e2010-06-28 18:54:25 +020028 rdesc[47] = 0x00;
29 }
Jiri Slaby636a89d2015-10-11 16:18:22 +020030 return rdesc;
Richard Nauber64b386e2010-06-28 18:54:25 +020031}
32
33static const struct hid_device_id elecom_devices[] = {
34 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
35 { }
36};
37MODULE_DEVICE_TABLE(hid, elecom_devices);
38
39static struct hid_driver elecom_driver = {
40 .name = "elecom",
41 .id_table = elecom_devices,
42 .report_fixup = elecom_report_fixup
43};
H Hartley Sweetenf4254582012-12-17 15:28:26 -070044module_hid_driver(elecom_driver);
Richard Nauber64b386e2010-06-28 18:54:25 +020045
Richard Nauber64b386e2010-06-28 18:54:25 +020046MODULE_LICENSE("GPL");