1 #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 17 enum { 18 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, 28 ISKU_SIZE_LIGHT = 0x0a, 29 ISKU_SIZE_MACRO = 0x823, 30 ISKU_SIZE_RESET = 0x03, 31 ISKU_SIZE_TALK = 0x10, 32 }; 33 34 enum { 35 ISKU_PROFILE_NUM = 5, 36 ISKU_USB_INTERFACE_PROTOCOL = 0, 37 }; 38 39 struct isku_actual_profile { 40 uint8_t command; /* ISKU_COMMAND_ACTUAL_PROFILE */ 41 uint8_t size; /* always 3 */ 42 uint8_t actual_profile; 43 } __packed; 44 45 enum isku_commands { 46 ISKU_COMMAND_CONTROL = 0x4, 47 ISKU_COMMAND_ACTUAL_PROFILE = 0x5, 48 ISKU_COMMAND_KEY_MASK = 0x7, 49 ISKU_COMMAND_KEYS_FUNCTION = 0x8, 50 ISKU_COMMAND_KEYS_EASYZONE = 0x9, 51 ISKU_COMMAND_KEYS_MEDIA = 0xa, 52 ISKU_COMMAND_KEYS_THUMBSTER = 0xb, 53 ISKU_COMMAND_KEYS_MACRO = 0xd, 54 ISKU_COMMAND_MACRO = 0xe, 55 ISKU_COMMAND_INFO = 0xf, 56 ISKU_COMMAND_LIGHT = 0x10, 57 ISKU_COMMAND_RESET = 0x11, 58 ISKU_COMMAND_KEYS_CAPSLOCK = 0x13, 59 ISKU_COMMAND_LAST_SET = 0x14, 60 ISKU_COMMAND_15 = 0x15, 61 ISKU_COMMAND_TALK = 0x16, 62 ISKU_COMMAND_FIRMWARE_WRITE = 0x1b, 63 ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c, 64 }; 65 66 struct isku_report_button { 67 uint8_t number; /* ISKU_REPORT_NUMBER_BUTTON */ 68 uint8_t zero; 69 uint8_t event; 70 uint8_t data1; 71 uint8_t data2; 72 }; 73 74 enum isku_report_numbers { 75 ISKU_REPORT_NUMBER_BUTTON = 3, 76 }; 77 78 enum isku_report_button_events { 79 ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2, 80 }; 81 82 struct isku_roccat_report { 83 uint8_t event; 84 uint8_t data1; 85 uint8_t data2; 86 uint8_t profile; 87 } __packed; 88 89 struct isku_device { 90 int roccat_claimed; 91 int chrdev_minor; 92 93 struct mutex isku_lock; 94 95 int actual_profile; 96 }; 97 98 #endif 99