123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- #include <linux/device.h>
- #include <linux/hid.h>
- #include <linux/module.h>
- #include "hid-ids.h"
- static const __u8 sm_0059_rdesc[] = {
- 0x05, 0x0c,
- 0x09, 0x01,
- 0xa1, 0x01,
- 0x85, 0x01,
- 0x19, 0x00,
- 0x2a, 0x3c, 0x02,
- 0x15, 0x00,
- 0x26, 0x3c, 0x02,
- 0x95, 0x01,
- 0x75, 0x10,
- 0x81, 0x00,
- 0xc0,
- 0x05, 0x01,
- 0x09, 0x80,
- 0xa1, 0x01,
- 0x85, 0x02,
- 0x19, 0x81,
- 0x29, 0x83,
- 0x25, 0x01,
- 0x75, 0x01,
- 0x95, 0x03,
- 0x81, 0x02,
- 0x95, 0x05,
- 0x81, 0x01,
- 0xc0,
- 0x06, 0x00, 0xff,
- 0x09, 0x01,
- 0xa1, 0x01,
- 0x85, 0x03,
- 0x1a, 0xf1, 0x00,
- 0x2a, 0xf8, 0x00,
- 0x15, 0x00,
- 0x25, 0x01,
- 0x75, 0x01,
- 0x95, 0x08,
- 0x81, 0x02,
- 0xc0,
- 0x05, 0x01,
- 0x09, 0x06,
- 0xa1, 0x01,
- 0x85, 0x04,
- 0x05, 0x07,
- 0x19, 0xe0,
- 0x29, 0xe7,
- 0x15, 0x00,
- 0x25, 0x01,
- 0x75, 0x01,
- 0x95, 0x08,
- 0x81, 0x00,
- 0x95, 0x30,
- 0x75, 0x01,
- 0x15, 0x00,
- 0x25, 0x01,
- 0x05, 0x07,
- 0x19, 0x00,
- 0x29, 0x2f,
- 0x81, 0x02,
- 0xc0,
- 0x05, 0x01,
- 0x09, 0x06,
- 0xa1, 0x01,
- 0x85, 0x05,
- 0x95, 0x38,
- 0x75, 0x01,
- 0x15, 0x00,
- 0x25, 0x01,
- 0x05, 0x07,
- 0x19, 0x30,
- 0x29, 0x67,
- 0x81, 0x02,
- 0xc0,
- 0x05, 0x01,
- 0x09, 0x06,
- 0xa1, 0x01,
- 0x85, 0x06,
- 0x95, 0x38,
- 0x75, 0x01,
- 0x15, 0x00,
- 0x25, 0x01,
- 0x05, 0x07,
- 0x19, 0x68,
- 0x29, 0x9f,
- 0x81, 0x02,
- 0xc0,
- };
- static __u8 *sm_report_fixup(struct hid_device *hdev, __u8 *rdesc,
- unsigned int *rsize)
- {
- if (*rsize == sizeof(sm_0059_rdesc) &&
- !memcmp(sm_0059_rdesc, rdesc, *rsize)) {
- hid_info(hdev, "Fixing up SiGma Micro report descriptor\n");
- rdesc[99] = 0x02;
- }
- return rdesc;
- }
- static const struct hid_device_id sm_devices[] = {
- { HID_USB_DEVICE(USB_VENDOR_ID_SIGMA_MICRO,
- USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD2) },
- { }
- };
- MODULE_DEVICE_TABLE(hid, sm_devices);
- static struct hid_driver sm_driver = {
- .name = "sigmamicro",
- .id_table = sm_devices,
- .report_fixup = sm_report_fixup,
- };
- module_hid_driver(sm_driver);
- MODULE_AUTHOR("Kinglong Mee <kinglongmee@gmail.com>");
- MODULE_AUTHOR("Desmond Lim <peckishrine@gmail.com>");
- MODULE_DESCRIPTION("SiGma Micro HID driver");
- MODULE_LICENSE("GPL");
|