Loading...
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2#ifndef __HID_ROCCAT_ARVO_H
3#define __HID_ROCCAT_ARVO_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
14struct arvo_mode_key { /* 2 bytes */
15 uint8_t command; /* ARVO_COMMAND_MODE_KEY */
16 uint8_t state;
17} __packed;
18
19struct arvo_button {
20 uint8_t unknown[24];
21} __packed;
22
23struct arvo_info {
24 uint8_t unknown[8];
25} __packed;
26
27struct arvo_key_mask { /* 2 bytes */
28 uint8_t command; /* ARVO_COMMAND_KEY_MASK */
29 uint8_t key_mask;
30} __packed;
31
32/* selected profile is persistent */
33struct arvo_actual_profile { /* 2 bytes */
34 uint8_t command; /* ARVO_COMMAND_ACTUAL_PROFILE */
35 uint8_t actual_profile;
36} __packed;
37
38enum arvo_commands {
39 ARVO_COMMAND_MODE_KEY = 0x3,
40 ARVO_COMMAND_BUTTON = 0x4,
41 ARVO_COMMAND_INFO = 0x5,
42 ARVO_COMMAND_KEY_MASK = 0x6,
43 ARVO_COMMAND_ACTUAL_PROFILE = 0x7,
44};
45
46struct arvo_special_report {
47 uint8_t unknown1; /* always 0x01 */
48 uint8_t event;
49 uint8_t unknown2; /* always 0x70 */
50} __packed;
51
52enum arvo_special_report_events {
53 ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS = 0x10,
54 ARVO_SPECIAL_REPORT_EVENT_ACTION_RELEASE = 0x0,
55};
56
57enum arvo_special_report_event_masks {
58 ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION = 0xf0,
59 ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON = 0x0f,
60};
61
62struct arvo_roccat_report {
63 uint8_t profile;
64 uint8_t button;
65 uint8_t action;
66} __packed;
67
68enum arvo_roccat_report_action {
69 ARVO_ROCCAT_REPORT_ACTION_RELEASE = 0,
70 ARVO_ROCCAT_REPORT_ACTION_PRESS = 1,
71};
72
73struct arvo_device {
74 int roccat_claimed;
75 int chrdev_minor;
76
77 struct mutex arvo_lock;
78
79 int actual_profile;
80};
81
82#endif
1#ifndef __HID_ROCCAT_ARVO_H
2#define __HID_ROCCAT_ARVO_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
17struct arvo_mode_key { /* 2 bytes */
18 uint8_t command; /* ARVO_COMMAND_MODE_KEY */
19 uint8_t state;
20} __packed;
21
22struct arvo_button {
23 uint8_t unknown[24];
24} __packed;
25
26struct arvo_info {
27 uint8_t unknown[8];
28} __packed;
29
30struct arvo_key_mask { /* 2 bytes */
31 uint8_t command; /* ARVO_COMMAND_KEY_MASK */
32 uint8_t key_mask;
33} __packed;
34
35/* selected profile is persistent */
36struct arvo_actual_profile { /* 2 bytes */
37 uint8_t command; /* ARVO_COMMAND_ACTUAL_PROFILE */
38 uint8_t actual_profile;
39} __packed;
40
41enum arvo_commands {
42 ARVO_COMMAND_MODE_KEY = 0x3,
43 ARVO_COMMAND_BUTTON = 0x4,
44 ARVO_COMMAND_INFO = 0x5,
45 ARVO_COMMAND_KEY_MASK = 0x6,
46 ARVO_COMMAND_ACTUAL_PROFILE = 0x7,
47};
48
49struct arvo_special_report {
50 uint8_t unknown1; /* always 0x01 */
51 uint8_t event;
52 uint8_t unknown2; /* always 0x70 */
53} __packed;
54
55enum arvo_special_report_events {
56 ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS = 0x10,
57 ARVO_SPECIAL_REPORT_EVENT_ACTION_RELEASE = 0x0,
58};
59
60enum arvo_special_report_event_masks {
61 ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION = 0xf0,
62 ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON = 0x0f,
63};
64
65struct arvo_roccat_report {
66 uint8_t profile;
67 uint8_t button;
68 uint8_t action;
69} __packed;
70
71enum arvo_roccat_report_action {
72 ARVO_ROCCAT_REPORT_ACTION_RELEASE = 0,
73 ARVO_ROCCAT_REPORT_ACTION_PRESS = 1,
74};
75
76struct arvo_device {
77 int roccat_claimed;
78 int chrdev_minor;
79
80 struct mutex arvo_lock;
81
82 int actual_profile;
83};
84
85#endif