1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef __HID_ROCCAT_ISKU_H
3 #define __HID_ROCCAT_ISKU_H
4 
5 /*
6  * Copyright (c) 2011 Stefan Achatz <erazor_de@users.sourceforge.net>
7  */
8 
9 /*
10  */
11 
12 #include <linux/types.h>
13 
14 enum {
15 	ISKU_SIZE_CONTROL = 0x03,
16 	ISKU_SIZE_INFO = 0x06,
17 	ISKU_SIZE_KEY_MASK = 0x06,
18 	ISKU_SIZE_KEYS_FUNCTION = 0x29,
19 	ISKU_SIZE_KEYS_EASYZONE = 0x41,
20 	ISKU_SIZE_KEYS_MEDIA = 0x1d,
21 	ISKU_SIZE_KEYS_THUMBSTER = 0x17,
22 	ISKU_SIZE_KEYS_MACRO = 0x23,
23 	ISKU_SIZE_KEYS_CAPSLOCK = 0x06,
24 	ISKU_SIZE_LAST_SET = 0x14,
25 	ISKU_SIZE_LIGHT = 0x10,
26 	ISKU_SIZE_MACRO = 0x823,
27 	ISKU_SIZE_RESET = 0x03,
28 	ISKU_SIZE_TALK = 0x10,
29 	ISKU_SIZE_TALKFX = 0x10,
30 };
31 
32 enum {
33 	ISKU_PROFILE_NUM = 5,
34 	ISKU_USB_INTERFACE_PROTOCOL = 0,
35 };
36 
37 struct isku_actual_profile {
38 	uint8_t command; /* ISKU_COMMAND_ACTUAL_PROFILE */
39 	uint8_t size; /* always 3 */
40 	uint8_t actual_profile;
41 } __packed;
42 
43 enum isku_commands {
44 	ISKU_COMMAND_CONTROL = 0x4,
45 	ISKU_COMMAND_ACTUAL_PROFILE = 0x5,
46 	ISKU_COMMAND_KEY_MASK = 0x7,
47 	ISKU_COMMAND_KEYS_FUNCTION = 0x8,
48 	ISKU_COMMAND_KEYS_EASYZONE = 0x9,
49 	ISKU_COMMAND_KEYS_MEDIA = 0xa,
50 	ISKU_COMMAND_KEYS_THUMBSTER = 0xb,
51 	ISKU_COMMAND_KEYS_MACRO = 0xd,
52 	ISKU_COMMAND_MACRO = 0xe,
53 	ISKU_COMMAND_INFO = 0xf,
54 	ISKU_COMMAND_LIGHT = 0x10,
55 	ISKU_COMMAND_RESET = 0x11,
56 	ISKU_COMMAND_KEYS_CAPSLOCK = 0x13,
57 	ISKU_COMMAND_LAST_SET = 0x14,
58 	ISKU_COMMAND_15 = 0x15,
59 	ISKU_COMMAND_TALK = 0x16,
60 	ISKU_COMMAND_TALKFX = 0x17,
61 	ISKU_COMMAND_FIRMWARE_WRITE = 0x1b,
62 	ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
63 };
64 
65 struct isku_report_button {
66 	uint8_t number; /* ISKU_REPORT_NUMBER_BUTTON */
67 	uint8_t zero;
68 	uint8_t event;
69 	uint8_t data1;
70 	uint8_t data2;
71 };
72 
73 enum isku_report_numbers {
74 	ISKU_REPORT_NUMBER_BUTTON = 3,
75 };
76 
77 enum isku_report_button_events {
78 	ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2,
79 };
80 
81 struct isku_roccat_report {
82 	uint8_t event;
83 	uint8_t data1;
84 	uint8_t data2;
85 	uint8_t profile;
86 } __packed;
87 
88 struct isku_device {
89 	int roccat_claimed;
90 	int chrdev_minor;
91 
92 	struct mutex isku_lock;
93 
94 	int actual_profile;
95 };
96 
97 #endif
98