hid-roccat-arvo.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef __HID_ROCCAT_ARVO_H
  2. #define __HID_ROCCAT_ARVO_H
  3. /*
  4. * Copyright (c) 2011 Stefan Achatz <erazor_de@users.sourceforge.net>
  5. */
  6. /*
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. */
  12. #include <linux/types.h>
  13. struct arvo_mode_key { /* 2 bytes */
  14. uint8_t command; /* ARVO_COMMAND_MODE_KEY */
  15. uint8_t state;
  16. } __packed;
  17. struct arvo_button {
  18. uint8_t unknown[24];
  19. } __packed;
  20. struct arvo_info {
  21. uint8_t unknown[8];
  22. } __packed;
  23. struct arvo_key_mask { /* 2 bytes */
  24. uint8_t command; /* ARVO_COMMAND_KEY_MASK */
  25. uint8_t key_mask;
  26. } __packed;
  27. /* selected profile is persistent */
  28. struct arvo_actual_profile { /* 2 bytes */
  29. uint8_t command; /* ARVO_COMMAND_ACTUAL_PROFILE */
  30. uint8_t actual_profile;
  31. } __packed;
  32. enum arvo_commands {
  33. ARVO_COMMAND_MODE_KEY = 0x3,
  34. ARVO_COMMAND_BUTTON = 0x4,
  35. ARVO_COMMAND_INFO = 0x5,
  36. ARVO_COMMAND_KEY_MASK = 0x6,
  37. ARVO_COMMAND_ACTUAL_PROFILE = 0x7,
  38. };
  39. enum arvo_usb_commands {
  40. ARVO_USB_COMMAND_MODE_KEY = 0x303,
  41. /*
  42. * read/write
  43. * Read uses both index bytes as profile/key indexes
  44. * Write has index 0, profile/key is determined by payload
  45. */
  46. ARVO_USB_COMMAND_BUTTON = 0x304,
  47. ARVO_USB_COMMAND_INFO = 0x305,
  48. ARVO_USB_COMMAND_KEY_MASK = 0x306,
  49. ARVO_USB_COMMAND_ACTUAL_PROFILE = 0x307,
  50. };
  51. struct arvo_special_report {
  52. uint8_t unknown1; /* always 0x01 */
  53. uint8_t event;
  54. uint8_t unknown2; /* always 0x70 */
  55. } __packed;
  56. enum arvo_special_report_events {
  57. ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS = 0x10,
  58. ARVO_SPECIAL_REPORT_EVENT_ACTION_RELEASE = 0x0,
  59. };
  60. enum arvo_special_report_event_masks {
  61. ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION = 0xf0,
  62. ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON = 0x0f,
  63. };
  64. struct arvo_roccat_report {
  65. uint8_t profile;
  66. uint8_t button;
  67. uint8_t action;
  68. } __packed;
  69. enum arvo_roccat_report_action {
  70. ARVO_ROCCAT_REPORT_ACTION_RELEASE = 0,
  71. ARVO_ROCCAT_REPORT_ACTION_PRESS = 1,
  72. };
  73. struct arvo_device {
  74. int roccat_claimed;
  75. int chrdev_minor;
  76. struct mutex arvo_lock;
  77. int actual_profile;
  78. };
  79. #endif