blob: 0779d72e4e2fbe6dff24d886713063a5bc43147a [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Stefan Achatzd41c2a72011-11-24 17:46:24 +01002#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/*
Stefan Achatzd41c2a72011-11-24 17:46:24 +010010 */
11
12#include <linux/types.h>
13
14enum {
Stefan Achatz6e5920d2012-11-11 06:21:02 +010015 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,
Stefan Achatzce716962013-03-10 12:33:02 +010025 ISKU_SIZE_LIGHT = 0x10,
Stefan Achatz6e5920d2012-11-11 06:21:02 +010026 ISKU_SIZE_MACRO = 0x823,
Stefan Achatzf1da71e2012-11-11 06:21:06 +010027 ISKU_SIZE_RESET = 0x03,
Stefan Achatz6e5920d2012-11-11 06:21:02 +010028 ISKU_SIZE_TALK = 0x10,
Stefan Achatzce716962013-03-10 12:33:02 +010029 ISKU_SIZE_TALKFX = 0x10,
Stefan Achatz6e5920d2012-11-11 06:21:02 +010030};
31
32enum {
Stefan Achatzd41c2a72011-11-24 17:46:24 +010033 ISKU_PROFILE_NUM = 5,
34 ISKU_USB_INTERFACE_PROTOCOL = 0,
35};
36
Stefan Achatzd41c2a72011-11-24 17:46:24 +010037struct 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
Stefan Achatzd41c2a72011-11-24 17:46:24 +010043enum 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,
Stefan Achatzf1da71e2012-11-11 06:21:06 +010055 ISKU_COMMAND_RESET = 0x11,
Stefan Achatzd41c2a72011-11-24 17:46:24 +010056 ISKU_COMMAND_KEYS_CAPSLOCK = 0x13,
57 ISKU_COMMAND_LAST_SET = 0x14,
58 ISKU_COMMAND_15 = 0x15,
59 ISKU_COMMAND_TALK = 0x16,
Stefan Achatzce716962013-03-10 12:33:02 +010060 ISKU_COMMAND_TALKFX = 0x17,
Stefan Achatzd41c2a72011-11-24 17:46:24 +010061 ISKU_COMMAND_FIRMWARE_WRITE = 0x1b,
62 ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
63};
64
65struct 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
73enum isku_report_numbers {
74 ISKU_REPORT_NUMBER_BUTTON = 3,
75};
76
77enum isku_report_button_events {
78 ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2,
79};
80
81struct isku_roccat_report {
82 uint8_t event;
83 uint8_t data1;
84 uint8_t data2;
85 uint8_t profile;
86} __packed;
87
88struct 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