blob: 53056860d4d859f53f391f7081191c3821376a2b [file] [log] [blame]
Stefan Achatzd41c2a72011-11-24 17:46:24 +01001#ifndef __HID_ROCCAT_ISKU_H
2#define __HID_ROCCAT_ISKU_H
3
4/*
5 * Copyright (c) 2011 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
17enum {
Stefan Achatz6e5920d2012-11-11 06:21:02 +010018 ISKU_SIZE_CONTROL = 0x03,
19 ISKU_SIZE_INFO = 0x06,
20 ISKU_SIZE_KEY_MASK = 0x06,
21 ISKU_SIZE_KEYS_FUNCTION = 0x29,
22 ISKU_SIZE_KEYS_EASYZONE = 0x41,
23 ISKU_SIZE_KEYS_MEDIA = 0x1d,
24 ISKU_SIZE_KEYS_THUMBSTER = 0x17,
25 ISKU_SIZE_KEYS_MACRO = 0x23,
26 ISKU_SIZE_KEYS_CAPSLOCK = 0x06,
27 ISKU_SIZE_LAST_SET = 0x14,
Stefan Achatzce716962013-03-10 12:33:02 +010028 ISKU_SIZE_LIGHT = 0x10,
Stefan Achatz6e5920d2012-11-11 06:21:02 +010029 ISKU_SIZE_MACRO = 0x823,
Stefan Achatzf1da71e2012-11-11 06:21:06 +010030 ISKU_SIZE_RESET = 0x03,
Stefan Achatz6e5920d2012-11-11 06:21:02 +010031 ISKU_SIZE_TALK = 0x10,
Stefan Achatzce716962013-03-10 12:33:02 +010032 ISKU_SIZE_TALKFX = 0x10,
Stefan Achatz6e5920d2012-11-11 06:21:02 +010033};
34
35enum {
Stefan Achatzd41c2a72011-11-24 17:46:24 +010036 ISKU_PROFILE_NUM = 5,
37 ISKU_USB_INTERFACE_PROTOCOL = 0,
38};
39
Stefan Achatzd41c2a72011-11-24 17:46:24 +010040struct isku_actual_profile {
41 uint8_t command; /* ISKU_COMMAND_ACTUAL_PROFILE */
42 uint8_t size; /* always 3 */
43 uint8_t actual_profile;
44} __packed;
45
Stefan Achatzd41c2a72011-11-24 17:46:24 +010046enum isku_commands {
47 ISKU_COMMAND_CONTROL = 0x4,
48 ISKU_COMMAND_ACTUAL_PROFILE = 0x5,
49 ISKU_COMMAND_KEY_MASK = 0x7,
50 ISKU_COMMAND_KEYS_FUNCTION = 0x8,
51 ISKU_COMMAND_KEYS_EASYZONE = 0x9,
52 ISKU_COMMAND_KEYS_MEDIA = 0xa,
53 ISKU_COMMAND_KEYS_THUMBSTER = 0xb,
54 ISKU_COMMAND_KEYS_MACRO = 0xd,
55 ISKU_COMMAND_MACRO = 0xe,
56 ISKU_COMMAND_INFO = 0xf,
57 ISKU_COMMAND_LIGHT = 0x10,
Stefan Achatzf1da71e2012-11-11 06:21:06 +010058 ISKU_COMMAND_RESET = 0x11,
Stefan Achatzd41c2a72011-11-24 17:46:24 +010059 ISKU_COMMAND_KEYS_CAPSLOCK = 0x13,
60 ISKU_COMMAND_LAST_SET = 0x14,
61 ISKU_COMMAND_15 = 0x15,
62 ISKU_COMMAND_TALK = 0x16,
Stefan Achatzce716962013-03-10 12:33:02 +010063 ISKU_COMMAND_TALKFX = 0x17,
Stefan Achatzd41c2a72011-11-24 17:46:24 +010064 ISKU_COMMAND_FIRMWARE_WRITE = 0x1b,
65 ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
66};
67
68struct isku_report_button {
69 uint8_t number; /* ISKU_REPORT_NUMBER_BUTTON */
70 uint8_t zero;
71 uint8_t event;
72 uint8_t data1;
73 uint8_t data2;
74};
75
76enum isku_report_numbers {
77 ISKU_REPORT_NUMBER_BUTTON = 3,
78};
79
80enum isku_report_button_events {
81 ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2,
82};
83
84struct isku_roccat_report {
85 uint8_t event;
86 uint8_t data1;
87 uint8_t data2;
88 uint8_t profile;
89} __packed;
90
91struct isku_device {
92 int roccat_claimed;
93 int chrdev_minor;
94
95 struct mutex isku_lock;
96
97 int actual_profile;
98};
99
100#endif