hid-input-quirks.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * HID-input usage mapping quirks
  3. *
  4. * This is used to handle HID-input mappings for devices violating
  5. * HUT 1.12 specification.
  6. *
  7. * Copyright (c) 2007-2008 Jiri Kosina
  8. */
  9. /*
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the Free
  12. * Software Foundation; either version 2 of the License
  13. */
  14. #include <linux/input.h>
  15. #include <linux/hid.h>
  16. static const struct hid_input_blacklist {
  17. __u16 idVendor;
  18. __u16 idProduct;
  19. int (*quirk)(struct hid_usage *, struct hid_input *, unsigned long **,
  20. int *);
  21. } hid_input_blacklist[] = {
  22. { 0, 0, NULL }
  23. };
  24. int hidinput_mapping_quirks(struct hid_usage *usage,
  25. struct hid_input *hi, unsigned long **bit, int *max)
  26. {
  27. struct hid_device *device = input_get_drvdata(hi->input);
  28. int i = 0;
  29. while (hid_input_blacklist[i].quirk) {
  30. if (hid_input_blacklist[i].idVendor == device->vendor &&
  31. hid_input_blacklist[i].idProduct == device->product)
  32. return hid_input_blacklist[i].quirk(usage, hi, bit,
  33. max);
  34. i++;
  35. }
  36. return 0;
  37. }
  38. int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
  39. {
  40. return 0;
  41. }