hid-roccat-isku.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 = 0x0a,
  25. ISKU_SIZE_MACRO = 0x823,
  26. ISKU_SIZE_RESET = 0x03,
  27. ISKU_SIZE_TALK = 0x10,
  28. };
  29. enum {
  30. ISKU_PROFILE_NUM = 5,
  31. ISKU_USB_INTERFACE_PROTOCOL = 0,
  32. };
  33. struct isku_actual_profile {
  34. uint8_t command; /* ISKU_COMMAND_ACTUAL_PROFILE */
  35. uint8_t size; /* always 3 */
  36. uint8_t actual_profile;
  37. } __packed;
  38. enum isku_commands {
  39. ISKU_COMMAND_CONTROL = 0x4,
  40. ISKU_COMMAND_ACTUAL_PROFILE = 0x5,
  41. ISKU_COMMAND_KEY_MASK = 0x7,
  42. ISKU_COMMAND_KEYS_FUNCTION = 0x8,
  43. ISKU_COMMAND_KEYS_EASYZONE = 0x9,
  44. ISKU_COMMAND_KEYS_MEDIA = 0xa,
  45. ISKU_COMMAND_KEYS_THUMBSTER = 0xb,
  46. ISKU_COMMAND_KEYS_MACRO = 0xd,
  47. ISKU_COMMAND_MACRO = 0xe,
  48. ISKU_COMMAND_INFO = 0xf,
  49. ISKU_COMMAND_LIGHT = 0x10,
  50. ISKU_COMMAND_RESET = 0x11,
  51. ISKU_COMMAND_KEYS_CAPSLOCK = 0x13,
  52. ISKU_COMMAND_LAST_SET = 0x14,
  53. ISKU_COMMAND_15 = 0x15,
  54. ISKU_COMMAND_TALK = 0x16,
  55. ISKU_COMMAND_FIRMWARE_WRITE = 0x1b,
  56. ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
  57. };
  58. struct isku_report_button {
  59. uint8_t number; /* ISKU_REPORT_NUMBER_BUTTON */
  60. uint8_t zero;
  61. uint8_t event;
  62. uint8_t data1;
  63. uint8_t data2;
  64. };
  65. enum isku_report_numbers {
  66. ISKU_REPORT_NUMBER_BUTTON = 3,
  67. };
  68. enum isku_report_button_events {
  69. ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2,
  70. };
  71. struct isku_roccat_report {
  72. uint8_t event;
  73. uint8_t data1;
  74. uint8_t data2;
  75. uint8_t profile;
  76. } __packed;
  77. struct isku_device {
  78. int roccat_claimed;
  79. int chrdev_minor;
  80. struct mutex isku_lock;
  81. int actual_profile;
  82. };
  83. #endif