Path: blob/master/drivers/hid/hid-roccat-kovaplus.h
15109 views
#ifndef __HID_ROCCAT_KOVAPLUS_H1#define __HID_ROCCAT_KOVAPLUS_H23/*4* Copyright (c) 2010 Stefan Achatz <[email protected]>5*/67/*8* This program is free software; you can redistribute it and/or modify it9* under the terms of the GNU General Public License as published by the Free10* Software Foundation; either version 2 of the License, or (at your option)11* any later version.12*/1314#include <linux/types.h>1516struct kovaplus_control {17uint8_t command; /* KOVAPLUS_COMMAND_CONTROL */18uint8_t value;19uint8_t request;20} __packed;2122enum kovaplus_control_requests {23/* read after write; value = 1 */24KOVAPLUS_CONTROL_REQUEST_STATUS = 0x0,25/* write; value = profile number range 0-4 */26KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,27/* write; value = profile number range 0-4 */28KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20,29};3031enum kovaplus_control_values {32KOVAPLUS_CONTROL_REQUEST_STATUS_OVERLOAD = 0, /* supposed */33KOVAPLUS_CONTROL_REQUEST_STATUS_OK = 1,34KOVAPLUS_CONTROL_REQUEST_STATUS_WAIT = 3, /* supposed */35};3637struct kovaplus_actual_profile {38uint8_t command; /* KOVAPLUS_COMMAND_ACTUAL_PROFILE */39uint8_t size; /* always 3 */40uint8_t actual_profile; /* Range 0-4! */41} __packed;4243struct kovaplus_profile_settings {44uint8_t command; /* KOVAPLUS_COMMAND_PROFILE_SETTINGS */45uint8_t size; /* 16 */46uint8_t profile_index; /* range 0-4 */47uint8_t unknown1;48uint8_t sensitivity_x; /* range 1-10 */49uint8_t sensitivity_y; /* range 1-10 */50uint8_t cpi_levels_enabled;51uint8_t cpi_startup_level; /* range 1-4 */52uint8_t data[8];53} __packed;5455struct kovaplus_profile_buttons {56uint8_t command; /* KOVAPLUS_COMMAND_PROFILE_BUTTONS */57uint8_t size; /* 23 */58uint8_t profile_index; /* range 0-4 */59uint8_t data[20];60} __packed;6162struct kovaplus_info {63uint8_t command; /* KOVAPLUS_COMMAND_INFO */64uint8_t size; /* 6 */65uint8_t firmware_version;66uint8_t unknown[3];67} __packed;6869/* writes 1 on plugin */70struct kovaplus_a {71uint8_t command; /* KOVAPLUS_COMMAND_A */72uint8_t size; /* 3 */73uint8_t unknown;74} __packed;7576enum kovaplus_commands {77KOVAPLUS_COMMAND_CONTROL = 0x4,78KOVAPLUS_COMMAND_ACTUAL_PROFILE = 0x5,79KOVAPLUS_COMMAND_PROFILE_SETTINGS = 0x6,80KOVAPLUS_COMMAND_PROFILE_BUTTONS = 0x7,81KOVAPLUS_COMMAND_INFO = 0x9,82KOVAPLUS_COMMAND_A = 0xa,83};8485enum kovaplus_usb_commands {86KOVAPLUS_USB_COMMAND_CONTROL = 0x304,87KOVAPLUS_USB_COMMAND_ACTUAL_PROFILE = 0x305,88KOVAPLUS_USB_COMMAND_PROFILE_SETTINGS = 0x306,89KOVAPLUS_USB_COMMAND_PROFILE_BUTTONS = 0x307,90KOVAPLUS_USB_COMMAND_INFO = 0x309,91KOVAPLUS_USB_COMMAND_A = 0x30a,92};9394enum kovaplus_mouse_report_numbers {95KOVAPLUS_MOUSE_REPORT_NUMBER_MOUSE = 1,96KOVAPLUS_MOUSE_REPORT_NUMBER_AUDIO = 2,97KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON = 3,98KOVAPLUS_MOUSE_REPORT_NUMBER_KBD = 4,99};100101struct kovaplus_mouse_report_button {102uint8_t report_number; /* KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON */103uint8_t unknown1;104uint8_t type;105uint8_t data1;106uint8_t data2;107} __packed;108109enum kovaplus_mouse_report_button_types {110/* data1 = profile_number range 1-5; no release event */111KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1 = 0x20,112/* data1 = profile_number range 1-5; no release event */113KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_2 = 0x30,114/* data1 = button_number range 1-18; data2 = action */115KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MACRO = 0x40,116/* data1 = button_number range 1-18; data2 = action */117KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SHORTCUT = 0x50,118/* data1 = button_number range 1-18; data2 = action */119KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60,120/* data1 = button_number range 1-18; data2 = action */121KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80,122/* data1 = 1 = 400, 2 = 800, 4 = 1600, 7 = 3200; no release event */123KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0,124/* data1 + data2 = sense range 1-10; no release event */125KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0,126/* data1 = type as in profile_buttons; data2 = action */127KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,128};129130enum kovaplus_mouse_report_button_actions {131KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS = 0,132KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE = 1,133};134135struct kovaplus_roccat_report {136uint8_t type;137uint8_t profile;138uint8_t button;139uint8_t data1;140uint8_t data2;141} __packed;142143struct kovaplus_device {144int actual_profile;145int actual_cpi;146int actual_x_sensitivity;147int actual_y_sensitivity;148int roccat_claimed;149int chrdev_minor;150struct mutex kovaplus_lock;151struct kovaplus_info info;152struct kovaplus_profile_settings profile_settings[5];153struct kovaplus_profile_buttons profile_buttons[5];154};155156#endif157158159