hid-roccat-isku.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef __HID_ROCCAT_ISKU_H
  2. #define __HID_ROCCAT_ISKU_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. enum {
  14. ISKU_SIZE_CONTROL = 0x03,
  15. ISKU_SIZE_INFO = 0x06,
  16. ISKU_SIZE_KEY_MASK = 0x06,
  17. ISKU_SIZE_KEYS_FUNCTION = 0x29,
  18. ISKU_SIZE_KEYS_EASYZONE = 0x41,
  19. ISKU_SIZE_KEYS_MEDIA = 0x1d,
  20. ISKU_SIZE_KEYS_THUMBSTER = 0x17,
  21. ISKU_SIZE_KEYS_MACRO = 0x23,
  22. ISKU_SIZE_KEYS_CAPSLOCK = 0x06,
  23. ISKU_SIZE_LAST_SET = 0x14,
  24. ISKU_SIZE_LIGHT = 0x10,
  25. ISKU_SIZE_MACRO = 0x823,
  26. ISKU_SIZE_RESET = 0x03,
  27. ISKU_SIZE_TALK = 0x10,
  28. ISKU_SIZE_TALKFX = 0x10,
  29. };
  30. enum {
  31. ISKU_PROFILE_NUM = 5,
  32. ISKU_USB_INTERFACE_PROTOCOL = 0,
  33. };
  34. struct isku_actual_profile {
  35. uint8_t command; /* ISKU_COMMAND_ACTUAL_PROFILE */
  36. uint8_t size; /* always 3 */
  37. uint8_t actual_profile;
  38. } __packed;
  39. enum isku_commands {
  40. ISKU_COMMAND_CONTROL = 0x4,
  41. ISKU_COMMAND_ACTUAL_PROFILE = 0x5,
  42. ISKU_COMMAND_KEY_MASK = 0x7,
  43. ISKU_COMMAND_KEYS_FUNCTION = 0x8,
  44. ISKU_COMMAND_KEYS_EASYZONE = 0x9,
  45. ISKU_COMMAND_KEYS_MEDIA = 0xa,
  46. ISKU_COMMAND_KEYS_THUMBSTER = 0xb,
  47. ISKU_COMMAND_KEYS_MACRO = 0xd,
  48. ISKU_COMMAND_MACRO = 0xe,
  49. ISKU_COMMAND_INFO = 0xf,
  50. ISKU_COMMAND_LIGHT = 0x10,
  51. ISKU_COMMAND_RESET = 0x11,
  52. ISKU_COMMAND_KEYS_CAPSLOCK = 0x13,
  53. ISKU_COMMAND_LAST_SET = 0x14,
  54. ISKU_COMMAND_15 = 0x15,
  55. ISKU_COMMAND_TALK = 0x16,
  56. ISKU_COMMAND_TALKFX = 0x17,
  57. ISKU_COMMAND_FIRMWARE_WRITE = 0x1b,
  58. ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
  59. };
  60. struct isku_report_button {
  61. uint8_t number; /* ISKU_REPORT_NUMBER_BUTTON */
  62. uint8_t zero;
  63. uint8_t event;
  64. uint8_t data1;
  65. uint8_t data2;
  66. };
  67. enum isku_report_numbers {
  68. ISKU_REPORT_NUMBER_BUTTON = 3,
  69. };
  70. enum isku_report_button_events {
  71. ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2,
  72. };
  73. struct isku_roccat_report {
  74. uint8_t event;
  75. uint8_t data1;
  76. uint8_t data2;
  77. uint8_t profile;
  78. } __packed;
  79. struct isku_device {
  80. int roccat_claimed;
  81. int chrdev_minor;
  82. struct mutex isku_lock;
  83. int actual_profile;
  84. };
  85. #endif