hid-roccat-savu.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef __HID_ROCCAT_SAVU_H
  2. #define __HID_ROCCAT_SAVU_H
  3. /*
  4. * Copyright (c) 2012 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. SAVU_SIZE_CONTROL = 0x03,
  15. SAVU_SIZE_PROFILE = 0x03,
  16. SAVU_SIZE_GENERAL = 0x10,
  17. SAVU_SIZE_BUTTONS = 0x2f,
  18. SAVU_SIZE_MACRO = 0x0823,
  19. SAVU_SIZE_INFO = 0x08,
  20. };
  21. enum savu_control_requests {
  22. SAVU_CONTROL_REQUEST_GENERAL = 0x80,
  23. SAVU_CONTROL_REQUEST_BUTTONS = 0x90,
  24. };
  25. enum savu_commands {
  26. SAVU_COMMAND_CONTROL = 0x4,
  27. SAVU_COMMAND_PROFILE = 0x5,
  28. SAVU_COMMAND_GENERAL = 0x6,
  29. SAVU_COMMAND_BUTTONS = 0x7,
  30. SAVU_COMMAND_MACRO = 0x8,
  31. SAVU_COMMAND_INFO = 0x9,
  32. };
  33. struct savu_mouse_report_special {
  34. uint8_t report_number; /* always 3 */
  35. uint8_t zero;
  36. uint8_t type;
  37. uint8_t data[2];
  38. } __packed;
  39. enum {
  40. SAVU_MOUSE_REPORT_NUMBER_SPECIAL = 3,
  41. };
  42. enum savu_mouse_report_button_types {
  43. /* data1 = new profile range 1-5 */
  44. SAVU_MOUSE_REPORT_BUTTON_TYPE_PROFILE = 0x20,
  45. /* data1 = button number range 1-24; data2 = action */
  46. SAVU_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
  47. /* data1 = button number range 1-24; data2 = action */
  48. SAVU_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80,
  49. /* data1 = setting number range 1-5 */
  50. SAVU_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0,
  51. /* data1 and data2 = range 0x1-0xb */
  52. SAVU_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0,
  53. /* data1 = 22 = next track...
  54. * data2 = action
  55. */
  56. SAVU_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
  57. };
  58. struct savu_roccat_report {
  59. uint8_t type;
  60. uint8_t data[2];
  61. } __packed;
  62. struct savu_device {
  63. int roccat_claimed;
  64. int chrdev_minor;
  65. struct mutex savu_lock;
  66. };
  67. #endif