hid-aureal.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * HID driver for Aureal Cy se W-01RN USB_V3.1 devices
  4. *
  5. * Copyright (c) 2010 Franco Catrin <[email protected]>
  6. * Copyright (c) 2010 Ben Cropley <[email protected]>
  7. *
  8. * Based on HID sunplus driver by
  9. * Copyright (c) 1999 Andreas Gal
  10. * Copyright (c) 2000-2005 Vojtech Pavlik <[email protected]>
  11. * Copyright (c) 2005 Michael Haboustak <[email protected]> for Concept2, Inc
  12. * Copyright (c) 2006-2007 Jiri Kosina
  13. * Copyright (c) 2008 Jiri Slaby
  14. */
  15. #include <linux/device.h>
  16. #include <linux/hid.h>
  17. #include <linux/module.h>
  18. #include "hid-ids.h"
  19. static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  20. unsigned int *rsize)
  21. {
  22. if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
  23. dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 report descriptor.\n");
  24. rdesc[53] = 0x65;
  25. }
  26. return rdesc;
  27. }
  28. static const struct hid_device_id aureal_devices[] = {
  29. { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
  30. { }
  31. };
  32. MODULE_DEVICE_TABLE(hid, aureal_devices);
  33. static struct hid_driver aureal_driver = {
  34. .name = "aureal",
  35. .id_table = aureal_devices,
  36. .report_fixup = aureal_report_fixup,
  37. };
  38. module_hid_driver(aureal_driver);
  39. MODULE_LICENSE("GPL");