drivers/hid/hid-roccat-kone.h

Source file repositories/reference/linux-study-clean/drivers/hid/hid-roccat-kone.h

File Facts

System
Linux kernel
Corpus path
drivers/hid/hid-roccat-kone.h
Extension
.h
Size
6811 bytes
Lines
227
Domain
Driver Families
Bucket
drivers/hid
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct kone_keystroke {
	uint8_t key;
	uint8_t action;
	uint16_t period; /* in milliseconds */
} __attribute__ ((__packed__));

enum kone_keystroke_buttons {
	kone_keystroke_button_1 = 0xf0, /* left mouse button */
	kone_keystroke_button_2 = 0xf1, /* right mouse button */
	kone_keystroke_button_3 = 0xf2, /* wheel */
	kone_keystroke_button_9 = 0xf3, /* side button up */
	kone_keystroke_button_8 = 0xf4 /* side button down */
};

enum kone_keystroke_actions {
	kone_keystroke_action_press = 0,
	kone_keystroke_action_release = 1
};

struct kone_button_info {
	uint8_t number; /* range 1-8 */
	uint8_t type;
	uint8_t macro_type; /* 0 = short, 1 = overlong */
	uint8_t macro_set_name[16]; /* can be max 15 chars long */
	uint8_t macro_name[16]; /* can be max 15 chars long */
	uint8_t count;
	struct kone_keystroke keystrokes[20];
} __attribute__ ((__packed__));

enum kone_button_info_types {
	/* valid button types until firmware 1.32 */
	kone_button_info_type_button_1 = 0x1, /* click (left mouse button) */
	kone_button_info_type_button_2 = 0x2, /* menu (right mouse button)*/
	kone_button_info_type_button_3 = 0x3, /* scroll (wheel) */
	kone_button_info_type_double_click = 0x4,
	kone_button_info_type_key = 0x5,
	kone_button_info_type_macro = 0x6,
	kone_button_info_type_off = 0x7,
	/* TODO clarify function and rename */
	kone_button_info_type_osd_xy_prescaling = 0x8,
	kone_button_info_type_osd_dpi = 0x9,
	kone_button_info_type_osd_profile = 0xa,
	kone_button_info_type_button_9 = 0xb, /* ie forward */
	kone_button_info_type_button_8 = 0xc, /* ie backward */
	kone_button_info_type_dpi_up = 0xd, /* internal */
	kone_button_info_type_dpi_down = 0xe, /* internal */
	kone_button_info_type_button_7 = 0xf, /* tilt left */
	kone_button_info_type_button_6 = 0x10, /* tilt right */
	kone_button_info_type_profile_up = 0x11, /* internal */
	kone_button_info_type_profile_down = 0x12, /* internal */
	/* additional valid button types since firmware 1.38 */
	kone_button_info_type_multimedia_open_player = 0x20,
	kone_button_info_type_multimedia_next_track = 0x21,
	kone_button_info_type_multimedia_prev_track = 0x22,
	kone_button_info_type_multimedia_play_pause = 0x23,
	kone_button_info_type_multimedia_stop = 0x24,
	kone_button_info_type_multimedia_mute = 0x25,
	kone_button_info_type_multimedia_volume_up = 0x26,
	kone_button_info_type_multimedia_volume_down = 0x27
};

enum kone_button_info_numbers {
	kone_button_top = 1,
	kone_button_wheel_tilt_left = 2,
	kone_button_wheel_tilt_right = 3,
	kone_button_forward = 4,
	kone_button_backward = 5,
	kone_button_middle = 6,
	kone_button_plus = 7,
	kone_button_minus = 8,
};

struct kone_light_info {
	uint8_t number; /* number of light 1-5 */
	uint8_t mod;   /* 1 = on, 2 = off */
	uint8_t red;   /* range 0x00-0xff */
	uint8_t green; /* range 0x00-0xff */
	uint8_t blue;  /* range 0x00-0xff */
} __attribute__ ((__packed__));

struct kone_profile {
	uint16_t size; /* always 975 */
	uint16_t unused; /* always 0 */

	/*
	 * range 1-5
	 * This number does not need to correspond with location where profile
	 * saved
	 */
	uint8_t profile; /* range 1-5 */

Annotation

Implementation Notes