diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2012-05-20 16:44:54 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-06-28 04:34:01 -0400 |
commit | 6a2a6390cf098b899a30146ef5c1fb85c9fefb3c (patch) | |
tree | 1ffce47d4cd2967ab441c4b48d99e93e4817d278 /drivers/hid/hid-roccat-savu.h | |
parent | 60d2c25251cac20d8c142a03e230237528b68430 (diff) |
HID: roccat: add support for Roccat Savu
This patch adds rupport for Roccat Savu gaming mouse.
In comparison to the other Roccat modules I tried to move even more
functionality to userland.
Userland tools can soon be found at http://sourceforge.net/projects/roccat
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-savu.h')
-rw-r--r-- | drivers/hid/hid-roccat-savu.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/drivers/hid/hid-roccat-savu.h b/drivers/hid/hid-roccat-savu.h new file mode 100644 index 000000000000..97b43d5b0477 --- /dev/null +++ b/drivers/hid/hid-roccat-savu.h | |||
@@ -0,0 +1,103 @@ | |||
1 | #ifndef __HID_ROCCAT_SAVU_H | ||
2 | #define __HID_ROCCAT_SAVU_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (c) 2012 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 | |||
17 | enum { | ||
18 | SAVU_SIZE_CONTROL = 0x03, | ||
19 | SAVU_SIZE_PROFILE = 0x03, | ||
20 | SAVU_SIZE_GENERAL = 0x10, | ||
21 | SAVU_SIZE_BUTTONS = 0x2f, | ||
22 | SAVU_SIZE_MACRO = 0x0823, | ||
23 | SAVU_SIZE_INFO = 0x08, | ||
24 | }; | ||
25 | |||
26 | struct savu_control { | ||
27 | uint8_t command; /* SAVU_COMMAND_CONTROL */ | ||
28 | /* | ||
29 | * value is profile number in range 0-4 for requesting settings and buttons | ||
30 | * 1 if status ok for requesting status | ||
31 | */ | ||
32 | uint8_t value; | ||
33 | uint8_t request; | ||
34 | } __packed; | ||
35 | |||
36 | enum savu_control_requests { | ||
37 | SAVU_CONTROL_REQUEST_WRITE_CHECK = 0x00, | ||
38 | SAVU_CONTROL_REQUEST_GENERAL = 0x80, | ||
39 | SAVU_CONTROL_REQUEST_BUTTONS = 0x90, | ||
40 | }; | ||
41 | |||
42 | enum savu_control_values { | ||
43 | SAVU_CONTROL_REQUEST_WRITE_CHECK_OVERLOAD = 0, | ||
44 | SAVU_CONTROL_REQUEST_WRITE_CHECK_OK = 1, | ||
45 | SAVU_CONTROL_REQUEST_WRITE_CHECK_INVALID = 2, | ||
46 | SAVU_CONTROL_REQUEST_WRITE_CHECK_WAIT = 3, | ||
47 | }; | ||
48 | |||
49 | enum savu_commands { | ||
50 | SAVU_COMMAND_CONTROL = 0x4, | ||
51 | SAVU_COMMAND_PROFILE = 0x5, | ||
52 | SAVU_COMMAND_GENERAL = 0x6, | ||
53 | SAVU_COMMAND_BUTTONS = 0x7, | ||
54 | SAVU_COMMAND_MACRO = 0x8, | ||
55 | SAVU_COMMAND_INFO = 0x9, | ||
56 | }; | ||
57 | |||
58 | struct savu_mouse_report_special { | ||
59 | uint8_t report_number; /* always 3 */ | ||
60 | uint8_t zero; | ||
61 | uint8_t type; | ||
62 | uint8_t data[2]; | ||
63 | } __packed; | ||
64 | |||
65 | enum { | ||
66 | SAVU_MOUSE_REPORT_NUMBER_SPECIAL = 3, | ||
67 | }; | ||
68 | |||
69 | enum savu_mouse_report_button_types { | ||
70 | /* data1 = new profile range 1-5 */ | ||
71 | SAVU_MOUSE_REPORT_BUTTON_TYPE_PROFILE = 0x20, | ||
72 | |||
73 | /* data1 = button number range 1-24; data2 = action */ | ||
74 | SAVU_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60, | ||
75 | |||
76 | /* data1 = button number range 1-24; data2 = action */ | ||
77 | SAVU_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80, | ||
78 | |||
79 | /* data1 = setting number range 1-5 */ | ||
80 | SAVU_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0, | ||
81 | |||
82 | /* data1 and data2 = range 0x1-0xb */ | ||
83 | SAVU_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0, | ||
84 | |||
85 | /* data1 = 22 = next track... | ||
86 | * data2 = action | ||
87 | */ | ||
88 | SAVU_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0, | ||
89 | }; | ||
90 | |||
91 | struct savu_roccat_report { | ||
92 | uint8_t type; | ||
93 | uint8_t data[2]; | ||
94 | } __packed; | ||
95 | |||
96 | struct savu_device { | ||
97 | int roccat_claimed; | ||
98 | int chrdev_minor; | ||
99 | |||
100 | struct mutex savu_lock; | ||
101 | }; | ||
102 | |||
103 | #endif | ||