hid-asus.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * HID driver for Asus notebook built-in keyboard.
  3. * Fixes small logical maximum to match usage maximum.
  4. *
  5. * Currently supported devices are:
  6. * EeeBook X205TA
  7. * VivoBook E200HA
  8. *
  9. * Copyright (c) 2016 Yusuke Fujimaki <usk.fujimaki@gmail.com>
  10. *
  11. * This module based on hid-ortek by
  12. * Copyright (c) 2010 Johnathon Harris <jmharris@gmail.com>
  13. * Copyright (c) 2011 Jiri Kosina
  14. */
  15. /*
  16. * This program is free software; you can redistribute it and/or modify it
  17. * under the terms of the GNU General Public License as published by the Free
  18. * Software Foundation; either version 2 of the License, or (at your option)
  19. * any later version.
  20. */
  21. #include <linux/device.h>
  22. #include <linux/hid.h>
  23. #include <linux/module.h>
  24. #include "hid-ids.h"
  25. static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  26. unsigned int *rsize)
  27. {
  28. if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x65) {
  29. hid_info(hdev, "Fixing up Asus notebook report descriptor\n");
  30. rdesc[55] = 0xdd;
  31. }
  32. return rdesc;
  33. }
  34. static const struct hid_device_id asus_devices[] = {
  35. { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD) },
  36. { }
  37. };
  38. MODULE_DEVICE_TABLE(hid, asus_devices);
  39. static struct hid_driver asus_driver = {
  40. .name = "asus",
  41. .id_table = asus_devices,
  42. .report_fixup = asus_report_fixup
  43. };
  44. module_hid_driver(asus_driver);
  45. MODULE_LICENSE("GPL");