1 #ifndef __HID_ROCCAT_KOVAPLUS_H
2 #define __HID_ROCCAT_KOVAPLUS_H
5 * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
15 #include <linux/types.h>
17 struct kovaplus_control
{
18 uint8_t command
; /* KOVAPLUS_COMMAND_CONTROL */
23 enum kovaplus_control_requests
{
24 /* read after write; value = 1 */
25 KOVAPLUS_CONTROL_REQUEST_STATUS
= 0x0,
26 /* write; value = profile number range 0-4 */
27 KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS
= 0x10,
28 /* write; value = profile number range 0-4 */
29 KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS
= 0x20,
32 enum kovaplus_control_values
{
33 KOVAPLUS_CONTROL_REQUEST_STATUS_OVERLOAD
= 0, /* supposed */
34 KOVAPLUS_CONTROL_REQUEST_STATUS_OK
= 1,
35 KOVAPLUS_CONTROL_REQUEST_STATUS_WAIT
= 3, /* supposed */
38 struct kovaplus_actual_profile
{
39 uint8_t command
; /* KOVAPLUS_COMMAND_ACTUAL_PROFILE */
40 uint8_t size
; /* always 3 */
41 uint8_t actual_profile
; /* Range 0-4! */
44 struct kovaplus_profile_settings
{
45 uint8_t command
; /* KOVAPLUS_COMMAND_PROFILE_SETTINGS */
46 uint8_t size
; /* 16 */
47 uint8_t profile_index
; /* range 0-4 */
49 uint8_t sensitivity_x
; /* range 1-10 */
50 uint8_t sensitivity_y
; /* range 1-10 */
51 uint8_t cpi_levels_enabled
;
52 uint8_t cpi_startup_level
; /* range 1-4 */
56 struct kovaplus_profile_buttons
{
57 uint8_t command
; /* KOVAPLUS_COMMAND_PROFILE_BUTTONS */
58 uint8_t size
; /* 23 */
59 uint8_t profile_index
; /* range 0-4 */
63 struct kovaplus_info
{
64 uint8_t command
; /* KOVAPLUS_COMMAND_INFO */
66 uint8_t firmware_version
;
70 /* writes 1 on plugin */
72 uint8_t command
; /* KOVAPLUS_COMMAND_A */
77 enum kovaplus_commands
{
78 KOVAPLUS_COMMAND_CONTROL
= 0x4,
79 KOVAPLUS_COMMAND_ACTUAL_PROFILE
= 0x5,
80 KOVAPLUS_COMMAND_PROFILE_SETTINGS
= 0x6,
81 KOVAPLUS_COMMAND_PROFILE_BUTTONS
= 0x7,
82 KOVAPLUS_COMMAND_INFO
= 0x9,
83 KOVAPLUS_COMMAND_A
= 0xa,
86 enum kovaplus_mouse_report_numbers
{
87 KOVAPLUS_MOUSE_REPORT_NUMBER_MOUSE
= 1,
88 KOVAPLUS_MOUSE_REPORT_NUMBER_AUDIO
= 2,
89 KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON
= 3,
90 KOVAPLUS_MOUSE_REPORT_NUMBER_KBD
= 4,
93 struct kovaplus_mouse_report_button
{
94 uint8_t report_number
; /* KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON */
101 enum kovaplus_mouse_report_button_types
{
102 /* data1 = profile_number range 1-5; no release event */
103 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1
= 0x20,
104 /* data1 = profile_number range 1-5; no release event */
105 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_2
= 0x30,
106 /* data1 = button_number range 1-18; data2 = action */
107 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MACRO
= 0x40,
108 /* data1 = button_number range 1-18; data2 = action */
109 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SHORTCUT
= 0x50,
110 /* data1 = button_number range 1-18; data2 = action */
111 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH
= 0x60,
112 /* data1 = button_number range 1-18; data2 = action */
113 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER
= 0x80,
114 /* data1 = 1 = 400, 2 = 800, 4 = 1600, 7 = 3200; no release event */
115 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI
= 0xb0,
116 /* data1 + data2 = sense range 1-10; no release event */
117 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY
= 0xc0,
118 /* data1 = type as in profile_buttons; data2 = action */
119 KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA
= 0xf0,
122 enum kovaplus_mouse_report_button_actions
{
123 KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS
= 0,
124 KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE
= 1,
127 struct kovaplus_roccat_report
{
135 struct kovaplus_device
{
138 int actual_x_sensitivity
;
139 int actual_y_sensitivity
;
142 struct mutex kovaplus_lock
;
143 struct kovaplus_info info
;
144 struct kovaplus_profile_settings profile_settings
[5];
145 struct kovaplus_profile_buttons profile_buttons
[5];