#include #include #define USB_VENDOR_ID_GOOGLE 0x18d1 #define USB_DEVICE_ID_CHROMECAST_REMOTE 0x9450 static const __u8 *cc_remote_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { if (*rsize == 0x39 && rdesc[0x32] == 0x95 && rdesc[0x33] == 0x02 && rdesc[0x34] == 0x75 && rdesc[0x35] == 0x08) { hid_info(hdev, "fixing Chromecast Remote descriptor\n"); rdesc[0x33] = 0x01; } return rdesc; } static const struct hid_device_id cc_remote_devices[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_CHROMECAST_REMOTE) }, { } }; MODULE_DEVICE_TABLE(hid, cc_remote_devices); static struct hid_driver cc_remote_driver = { .name = "chromecast_remote", .id_table = cc_remote_devices, .report_fixup = cc_remote_report_fixup, }; module_hid_driver(cc_remote_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Chromecast Remote HID descriptor fixup");