Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: roccat: Add "Roccat Talk" support for koneplus

Added binary sysfs attribute to support new functionality the manufacturer
added to koneplus.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Stefan Achatz and committed by
Jiri Kosina
6d1dec85 d762f438

+30
+8
Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
··· 92 92 This file is writeonly. 93 93 Users: http://roccat.sourceforge.net 94 94 95 + What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/talk 96 + Date: May 2011 97 + Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 98 + Description: Used to active some easy* functions of the mouse from outside. 99 + The data has to be 16 bytes long. 100 + This file is writeonly. 101 + Users: http://roccat.sourceforge.net 102 + 95 103 What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu 96 104 Date: October 2010 97 105 Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
+13
drivers/hid/hid-roccat-koneplus.c
··· 240 240 return real_size; 241 241 } 242 242 243 + static ssize_t koneplus_sysfs_write_talk(struct file *fp, 244 + struct kobject *kobj, struct bin_attribute *attr, char *buf, 245 + loff_t off, size_t count) 246 + { 247 + return koneplus_sysfs_write(fp, kobj, buf, off, count, 248 + sizeof(struct koneplus_talk), KONEPLUS_USB_COMMAND_TALK); 249 + } 250 + 243 251 static ssize_t koneplus_sysfs_write_macro(struct file *fp, 244 252 struct kobject *kobj, struct bin_attribute *attr, char *buf, 245 253 loff_t off, size_t count) ··· 564 556 .attr = { .name = "macro", .mode = 0220 }, 565 557 .size = sizeof(struct koneplus_macro), 566 558 .write = koneplus_sysfs_write_macro 559 + }, 560 + { 561 + .attr = { .name = "talk", .mode = 0220 }, 562 + .size = sizeof(struct koneplus_talk), 563 + .write = koneplus_sysfs_write_talk 567 564 }, 568 565 __ATTR_NULL 569 566 };
+9
drivers/hid/hid-roccat-koneplus.h
··· 14 14 15 15 #include <linux/types.h> 16 16 17 + struct koneplus_talk { 18 + uint8_t command; /* KONEPLUS_COMMAND_TALK */ 19 + uint8_t size; /* always 0x10 */ 20 + uint8_t data[14]; 21 + } __packed; 22 + 17 23 /* 18 24 * case 1: writes request 80 and reads value 1 19 25 * ··· 145 139 KONEPLUS_COMMAND_INFO = 0x9, 146 140 KONEPLUS_COMMAND_E = 0xe, 147 141 KONEPLUS_COMMAND_SENSOR = 0xf, 142 + KONEPLUS_COMMAND_TALK = 0x10, 148 143 KONEPLUS_COMMAND_FIRMWARE_WRITE = 0x1b, 149 144 KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c, 150 145 }; ··· 160 153 KONEPLUS_USB_COMMAND_TCU = 0x30c, 161 154 KONEPLUS_USB_COMMAND_E = 0x30e, 162 155 KONEPLUS_USB_COMMAND_SENSOR = 0x30f, 156 + KONEPLUS_USB_COMMAND_TALK = 0x310, 163 157 KONEPLUS_USB_COMMAND_FIRMWARE_WRITE = 0x31b, 164 158 KONEPLUS_USB_COMMAND_FIRMWARE_WRITE_CONTROL = 0x31c, 165 159 }; ··· 201 193 * data2 = action 202 194 */ 203 195 KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0, 196 + KONEPLUS_MOUSE_REPORT_TALK = 0xff, 204 197 }; 205 198 206 199 enum koneplus_mouse_report_button_action {