hid-roccat-arvo.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef __HID_ROCCAT_ARVO_H
  3. #define __HID_ROCCAT_ARVO_H
  4. /*
  5. * Copyright (c) 2011 Stefan Achatz <[email protected]>
  6. */
  7. /*
  8. */
  9. #include <linux/types.h>
  10. struct arvo_mode_key { /* 2 bytes */
  11. uint8_t command; /* ARVO_COMMAND_MODE_KEY */
  12. uint8_t state;
  13. } __packed;
  14. struct arvo_button {
  15. uint8_t unknown[24];
  16. } __packed;
  17. struct arvo_info {
  18. uint8_t unknown[8];
  19. } __packed;
  20. struct arvo_key_mask { /* 2 bytes */
  21. uint8_t command; /* ARVO_COMMAND_KEY_MASK */
  22. uint8_t key_mask;
  23. } __packed;
  24. /* selected profile is persistent */
  25. struct arvo_actual_profile { /* 2 bytes */
  26. uint8_t command; /* ARVO_COMMAND_ACTUAL_PROFILE */
  27. uint8_t actual_profile;
  28. } __packed;
  29. enum arvo_commands {
  30. ARVO_COMMAND_MODE_KEY = 0x3,
  31. ARVO_COMMAND_BUTTON = 0x4,
  32. ARVO_COMMAND_INFO = 0x5,
  33. ARVO_COMMAND_KEY_MASK = 0x6,
  34. ARVO_COMMAND_ACTUAL_PROFILE = 0x7,
  35. };
  36. struct arvo_special_report {
  37. uint8_t unknown1; /* always 0x01 */
  38. uint8_t event;
  39. uint8_t unknown2; /* always 0x70 */
  40. } __packed;
  41. enum arvo_special_report_events {
  42. ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS = 0x10,
  43. ARVO_SPECIAL_REPORT_EVENT_ACTION_RELEASE = 0x0,
  44. };
  45. enum arvo_special_report_event_masks {
  46. ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION = 0xf0,
  47. ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON = 0x0f,
  48. };
  49. struct arvo_roccat_report {
  50. uint8_t profile;
  51. uint8_t button;
  52. uint8_t action;
  53. } __packed;
  54. enum arvo_roccat_report_action {
  55. ARVO_ROCCAT_REPORT_ACTION_RELEASE = 0,
  56. ARVO_ROCCAT_REPORT_ACTION_PRESS = 1,
  57. };
  58. struct arvo_device {
  59. int roccat_claimed;
  60. int chrdev_minor;
  61. struct mutex arvo_lock;
  62. int actual_profile;
  63. };
  64. #endif