HID: roccat: add sysfs attr "reset" for Isku
[deliverable/linux.git] / drivers / hid / hid-roccat-pyra.h
CommitLineData
cb7cf3da
SA
1#ifndef __HID_ROCCAT_PYRA_H
2#define __HID_ROCCAT_PYRA_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
be34380e
SA
17enum {
18 PYRA_SIZE_INFO = 0x06,
19 PYRA_SIZE_PROFILE_SETTINGS = 0x0d,
20 PYRA_SIZE_PROFILE_BUTTONS = 0x13,
21 PYRA_SIZE_SETTINGS = 0x03,
22};
cb7cf3da 23
cb7cf3da 24enum pyra_control_requests {
cb7cf3da
SA
25 PYRA_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,
26 PYRA_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20
27};
28
29struct pyra_settings {
30 uint8_t command; /* PYRA_COMMAND_SETTINGS */
31 uint8_t size; /* always 3 */
32 uint8_t startup_profile; /* Range 0-4! */
4d043101 33} __attribute__ ((__packed__));
cb7cf3da
SA
34
35struct pyra_profile_settings {
36 uint8_t command; /* PYRA_COMMAND_PROFILE_SETTINGS */
37 uint8_t size; /* always 0xd */
38 uint8_t number; /* Range 0-4 */
39 uint8_t xysync;
40 uint8_t x_sensitivity; /* 0x1-0xa */
41 uint8_t y_sensitivity;
42 uint8_t x_cpi; /* unused */
43 uint8_t y_cpi; /* this value is for x and y */
44 uint8_t lightswitch; /* 0 = off, 1 = on */
45 uint8_t light_effect;
46 uint8_t handedness;
47 uint16_t checksum; /* byte sum */
4d043101 48} __attribute__ ((__packed__));
cb7cf3da 49
cb7cf3da
SA
50struct pyra_info {
51 uint8_t command; /* PYRA_COMMAND_INFO */
52 uint8_t size; /* always 6 */
53 uint8_t firmware_version;
54 uint8_t unknown1; /* always 0 */
55 uint8_t unknown2; /* always 1 */
56 uint8_t unknown3; /* always 0 */
4d043101 57} __attribute__ ((__packed__));
cb7cf3da
SA
58
59enum pyra_commands {
cb7cf3da
SA
60 PYRA_COMMAND_SETTINGS = 0x5,
61 PYRA_COMMAND_PROFILE_SETTINGS = 0x6,
62 PYRA_COMMAND_PROFILE_BUTTONS = 0x7,
63 PYRA_COMMAND_INFO = 0x9,
64 PYRA_COMMAND_B = 0xb
65};
66
cb7cf3da
SA
67enum pyra_mouse_report_numbers {
68 PYRA_MOUSE_REPORT_NUMBER_HID = 1,
69 PYRA_MOUSE_REPORT_NUMBER_AUDIO = 2,
70 PYRA_MOUSE_REPORT_NUMBER_BUTTON = 3,
71};
72
73struct pyra_mouse_event_button {
74 uint8_t report_number; /* always 3 */
75 uint8_t unknown; /* always 0 */
76 uint8_t type;
77 uint8_t data1;
78 uint8_t data2;
4d043101 79} __attribute__ ((__packed__));
cb7cf3da
SA
80
81struct pyra_mouse_event_audio {
82 uint8_t report_number; /* always 2 */
83 uint8_t type;
84 uint8_t unused; /* always 0 */
4d043101 85} __attribute__ ((__packed__));
cb7cf3da
SA
86
87/* hid audio controls */
88enum pyra_mouse_event_audio_types {
89 PYRA_MOUSE_EVENT_AUDIO_TYPE_MUTE = 0xe2,
90 PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_UP = 0xe9,
91 PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_DOWN = 0xea,
92};
93
94enum pyra_mouse_event_button_types {
95 /*
96 * Mouse sends tilt events on report_number 1 and 3
97 * Tilt events are sent repeatedly with 0.94s between first and second
98 * event and 0.22s on subsequent
99 */
100 PYRA_MOUSE_EVENT_BUTTON_TYPE_TILT = 0x10,
101
102 /*
103 * These are sent sequentially
104 * data1 contains new profile number in range 1-5
105 */
106 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_1 = 0x20,
107 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2 = 0x30,
108
109 /*
110 * data1 = button_number (rmp index)
111 * data2 = pressed/released
112 */
113 PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO = 0x40,
114 PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT = 0x50,
115
116 /*
117 * data1 = button_number (rmp index)
118 */
119 PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
120
121 /* data1 = new cpi */
122 PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI = 0xb0,
123
124 /* data1 and data2 = new sensitivity */
125 PYRA_MOUSE_EVENT_BUTTON_TYPE_SENSITIVITY = 0xc0,
126
127 PYRA_MOUSE_EVENT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
128};
129
130enum {
131 PYRA_MOUSE_EVENT_BUTTON_PRESS = 0,
132 PYRA_MOUSE_EVENT_BUTTON_RELEASE = 1,
133};
134
135struct pyra_roccat_report {
136 uint8_t type;
137 uint8_t value;
138 uint8_t key;
4d043101 139} __attribute__ ((__packed__));
cb7cf3da
SA
140
141struct pyra_device {
142 int actual_profile;
143 int actual_cpi;
cb7cf3da
SA
144 int roccat_claimed;
145 int chrdev_minor;
146 struct mutex pyra_lock;
cb7cf3da 147 struct pyra_profile_settings profile_settings[5];
cb7cf3da
SA
148};
149
150#endif
This page took 0.136179 seconds and 5 git commands to generate.