hid-roccat-arvo.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. struct arvo_special_report {
  40. uint8_t unknown1; /* always 0x01 */
  41. uint8_t event;
  42. uint8_t unknown2; /* always 0x70 */
  43. } __packed;
  44. enum arvo_special_report_events {
  45. ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS = 0x10,
  46. ARVO_SPECIAL_REPORT_EVENT_ACTION_RELEASE = 0x0,
  47. };
  48. enum arvo_special_report_event_masks {
  49. ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION = 0xf0,
  50. ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON = 0x0f,
  51. };
  52. struct arvo_roccat_report {
  53. uint8_t profile;
  54. uint8_t button;
  55. uint8_t action;
  56. } __packed;
  57. enum arvo_roccat_report_action {
  58. ARVO_ROCCAT_REPORT_ACTION_RELEASE = 0,
  59. ARVO_ROCCAT_REPORT_ACTION_PRESS = 1,
  60. };
  61. struct arvo_device {
  62. int roccat_claimed;
  63. int chrdev_minor;
  64. struct mutex arvo_lock;
  65. int actual_profile;
  66. };
  67. #endif