Commit | Line | Data |
---|---|---|
47dbdbff SA |
1 | #ifndef __HID_ROCCAT_KONEPLUS_H |
2 | #define __HID_ROCCAT_KONEPLUS_H | |
3 | ||
4 | /* | |
5 | * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net> | |
6 | */ | |
7 | ||
8 | /* | |
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) | |
12 | * any later version. | |
13 | */ | |
14 | ||
15 | #include <linux/types.h> | |
16 | ||
f114fec5 SA |
17 | enum { |
18 | KONEPLUS_SIZE_ACTUAL_PROFILE = 0x03, | |
bb060d65 | 19 | KONEPLUS_SIZE_CONTROL = 0x03, |
f114fec5 SA |
20 | KONEPLUS_SIZE_FIRMWARE_WRITE = 0x0402, |
21 | KONEPLUS_SIZE_INFO = 0x06, | |
22 | KONEPLUS_SIZE_MACRO = 0x0822, | |
23 | KONEPLUS_SIZE_PROFILE_SETTINGS = 0x2b, | |
24 | KONEPLUS_SIZE_PROFILE_BUTTONS = 0x4d, | |
25 | KONEPLUS_SIZE_SENSOR = 0x06, | |
26 | KONEPLUS_SIZE_TALK = 0x10, | |
955dca35 | 27 | KONEPLUS_SIZE_TCU = 0x04, |
f114fec5 SA |
28 | KONEPLUS_SIZE_TCU_IMAGE = 0x0404, |
29 | }; | |
6d1dec85 | 30 | |
47dbdbff | 31 | enum koneplus_control_requests { |
47dbdbff SA |
32 | KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS = 0x80, |
33 | KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS = 0x90, | |
34 | }; | |
35 | ||
b50f315c SA |
36 | struct koneplus_actual_profile { |
37 | uint8_t command; /* KONEPLUS_COMMAND_ACTUAL_PROFILE */ | |
47dbdbff | 38 | uint8_t size; /* always 3 */ |
b50f315c | 39 | uint8_t actual_profile; /* Range 0-4! */ |
4d043101 | 40 | } __attribute__ ((__packed__)); |
47dbdbff | 41 | |
47dbdbff SA |
42 | struct koneplus_info { |
43 | uint8_t command; /* KONEPLUS_COMMAND_INFO */ | |
44 | uint8_t size; /* always 6 */ | |
45 | uint8_t firmware_version; | |
46 | uint8_t unknown[3]; | |
4d043101 | 47 | } __attribute__ ((__packed__)); |
47dbdbff | 48 | |
47dbdbff | 49 | enum koneplus_commands { |
b50f315c | 50 | KONEPLUS_COMMAND_ACTUAL_PROFILE = 0x5, |
bb060d65 | 51 | KONEPLUS_COMMAND_CONTROL = 0x4, |
47dbdbff SA |
52 | KONEPLUS_COMMAND_PROFILE_SETTINGS = 0x6, |
53 | KONEPLUS_COMMAND_PROFILE_BUTTONS = 0x7, | |
54 | KONEPLUS_COMMAND_MACRO = 0x8, | |
55 | KONEPLUS_COMMAND_INFO = 0x9, | |
1edd5b42 | 56 | KONEPLUS_COMMAND_TCU = 0xc, |
f114fec5 | 57 | KONEPLUS_COMMAND_TCU_IMAGE = 0xc, |
47dbdbff SA |
58 | KONEPLUS_COMMAND_E = 0xe, |
59 | KONEPLUS_COMMAND_SENSOR = 0xf, | |
6d1dec85 | 60 | KONEPLUS_COMMAND_TALK = 0x10, |
47dbdbff SA |
61 | KONEPLUS_COMMAND_FIRMWARE_WRITE = 0x1b, |
62 | KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c, | |
63 | }; | |
64 | ||
47dbdbff SA |
65 | enum koneplus_mouse_report_numbers { |
66 | KONEPLUS_MOUSE_REPORT_NUMBER_HID = 1, | |
67 | KONEPLUS_MOUSE_REPORT_NUMBER_AUDIO = 2, | |
68 | KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON = 3, | |
69 | }; | |
70 | ||
71 | struct koneplus_mouse_report_button { | |
72 | uint8_t report_number; /* always KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON */ | |
73 | uint8_t zero1; | |
74 | uint8_t type; | |
75 | uint8_t data1; | |
76 | uint8_t data2; | |
77 | uint8_t zero2; | |
78 | uint8_t unknown[2]; | |
4d043101 | 79 | } __attribute__ ((__packed__)); |
47dbdbff SA |
80 | |
81 | enum koneplus_mouse_report_button_types { | |
82 | /* data1 = new profile range 1-5 */ | |
83 | KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE = 0x20, | |
84 | ||
85 | /* data1 = button number range 1-24; data2 = action */ | |
86 | KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60, | |
87 | ||
88 | /* data1 = button number range 1-24; data2 = action */ | |
89 | KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80, | |
90 | ||
91 | /* data1 = setting number range 1-5 */ | |
92 | KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0, | |
93 | ||
94 | /* data1 and data2 = range 0x1-0xb */ | |
95 | KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0, | |
96 | ||
97 | /* data1 = 22 = next track... | |
98 | * data2 = action | |
99 | */ | |
100 | KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0, | |
6d1dec85 | 101 | KONEPLUS_MOUSE_REPORT_TALK = 0xff, |
47dbdbff SA |
102 | }; |
103 | ||
104 | enum koneplus_mouse_report_button_action { | |
105 | KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS = 0, | |
106 | KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE = 1, | |
107 | }; | |
108 | ||
109 | struct koneplus_roccat_report { | |
110 | uint8_t type; | |
111 | uint8_t data1; | |
112 | uint8_t data2; | |
113 | uint8_t profile; | |
4d043101 | 114 | } __attribute__ ((__packed__)); |
47dbdbff SA |
115 | |
116 | struct koneplus_device { | |
117 | int actual_profile; | |
118 | ||
119 | int roccat_claimed; | |
120 | int chrdev_minor; | |
121 | ||
122 | struct mutex koneplus_lock; | |
47dbdbff SA |
123 | }; |
124 | ||
125 | #endif |