blob: af7f57e8cf3b38743892b0365bde4dfa61b07682 [file] [log] [blame]
Stefan Achatz47dbdbff2010-11-26 19:57:42 +00001#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
Stefan Achatzf114fec2012-11-04 09:39:09 +010017enum {
18 KONEPLUS_SIZE_ACTUAL_PROFILE = 0x03,
Stefan Achatzbb060d62012-11-11 06:21:15 +010019 KONEPLUS_SIZE_CONTROL = 0x03,
Stefan Achatzf114fec2012-11-04 09:39:09 +010020 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,
Stefan Achatz955dca32012-11-17 21:27:11 +010027 KONEPLUS_SIZE_TCU = 0x04,
Stefan Achatzf114fec2012-11-04 09:39:09 +010028 KONEPLUS_SIZE_TCU_IMAGE = 0x0404,
29};
Stefan Achatz6d1dec82011-05-29 19:32:57 +020030
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000031enum koneplus_control_requests {
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000032 KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS = 0x80,
33 KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS = 0x90,
34};
35
Stefan Achatzb50f3152011-04-13 17:17:52 +020036struct koneplus_actual_profile {
37 uint8_t command; /* KONEPLUS_COMMAND_ACTUAL_PROFILE */
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000038 uint8_t size; /* always 3 */
Stefan Achatzb50f3152011-04-13 17:17:52 +020039 uint8_t actual_profile; /* Range 0-4! */
Jiri Kosina4d043102010-12-09 14:29:34 +010040} __attribute__ ((__packed__));
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000041
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000042struct 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];
Jiri Kosina4d043102010-12-09 14:29:34 +010047} __attribute__ ((__packed__));
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000048
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000049enum koneplus_commands {
Stefan Achatzb50f3152011-04-13 17:17:52 +020050 KONEPLUS_COMMAND_ACTUAL_PROFILE = 0x5,
Stefan Achatzbb060d62012-11-11 06:21:15 +010051 KONEPLUS_COMMAND_CONTROL = 0x4,
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000052 KONEPLUS_COMMAND_PROFILE_SETTINGS = 0x6,
53 KONEPLUS_COMMAND_PROFILE_BUTTONS = 0x7,
54 KONEPLUS_COMMAND_MACRO = 0x8,
55 KONEPLUS_COMMAND_INFO = 0x9,
Stefan Achatz1edd5b42011-06-01 15:54:17 +020056 KONEPLUS_COMMAND_TCU = 0xc,
Stefan Achatzf114fec2012-11-04 09:39:09 +010057 KONEPLUS_COMMAND_TCU_IMAGE = 0xc,
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000058 KONEPLUS_COMMAND_E = 0xe,
59 KONEPLUS_COMMAND_SENSOR = 0xf,
Stefan Achatz6d1dec82011-05-29 19:32:57 +020060 KONEPLUS_COMMAND_TALK = 0x10,
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000061 KONEPLUS_COMMAND_FIRMWARE_WRITE = 0x1b,
62 KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
63};
64
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000065enum 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
71struct 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];
Jiri Kosina4d043102010-12-09 14:29:34 +010079} __attribute__ ((__packed__));
Stefan Achatz47dbdbff2010-11-26 19:57:42 +000080
81enum 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,
Stefan Achatz6d1dec82011-05-29 19:32:57 +0200101 KONEPLUS_MOUSE_REPORT_TALK = 0xff,
Stefan Achatz47dbdbff2010-11-26 19:57:42 +0000102};
103
104enum koneplus_mouse_report_button_action {
105 KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS = 0,
106 KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE = 1,
107};
108
109struct koneplus_roccat_report {
110 uint8_t type;
111 uint8_t data1;
112 uint8_t data2;
113 uint8_t profile;
Jiri Kosina4d043102010-12-09 14:29:34 +0100114} __attribute__ ((__packed__));
Stefan Achatz47dbdbff2010-11-26 19:57:42 +0000115
116struct koneplus_device {
117 int actual_profile;
118
119 int roccat_claimed;
120 int chrdev_minor;
121
122 struct mutex koneplus_lock;
Stefan Achatz47dbdbff2010-11-26 19:57:42 +0000123};
124
125#endif