summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorStefan Achatz <erazor_de@users.sourceforge.net>2011-05-29 19:32:57 +0200
committerJiri Kosina <jkosina@suse.cz>2011-06-13 12:50:40 +0200
commit6d1dec85afa7306e66fff633689ff06195ad079a (patch)
treee6814054d84696115794134ff165f6a206e27427 /drivers/hid
parentd762f4383100c2a87b1a3f2d678cd3b5425655b4 (diff)
downloadblackbird-op-linux-6d1dec85afa7306e66fff633689ff06195ad079a.tar.gz
blackbird-op-linux-6d1dec85afa7306e66fff633689ff06195ad079a.zip
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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-roccat-koneplus.c13
-rw-r--r--drivers/hid/hid-roccat-koneplus.h9
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
index 5b640a7a15a7..23cdb449d88e 100644
--- a/drivers/hid/hid-roccat-koneplus.c
+++ b/drivers/hid/hid-roccat-koneplus.c
@@ -240,6 +240,14 @@ static ssize_t koneplus_sysfs_write(struct file *fp, struct kobject *kobj,
return real_size;
}
+static ssize_t koneplus_sysfs_write_talk(struct file *fp,
+ struct kobject *kobj, struct bin_attribute *attr, char *buf,
+ loff_t off, size_t count)
+{
+ return koneplus_sysfs_write(fp, kobj, buf, off, count,
+ sizeof(struct koneplus_talk), KONEPLUS_USB_COMMAND_TALK);
+}
+
static ssize_t koneplus_sysfs_write_macro(struct file *fp,
struct kobject *kobj, struct bin_attribute *attr, char *buf,
loff_t off, size_t count)
@@ -557,6 +565,11 @@ static struct bin_attribute koneplus_bin_attributes[] = {
.size = sizeof(struct koneplus_macro),
.write = koneplus_sysfs_write_macro
},
+ {
+ .attr = { .name = "talk", .mode = 0220 },
+ .size = sizeof(struct koneplus_talk),
+ .write = koneplus_sysfs_write_talk
+ },
__ATTR_NULL
};
diff --git a/drivers/hid/hid-roccat-koneplus.h b/drivers/hid/hid-roccat-koneplus.h
index c57a376ab8ae..0bf252076ee7 100644
--- a/drivers/hid/hid-roccat-koneplus.h
+++ b/drivers/hid/hid-roccat-koneplus.h
@@ -14,6 +14,12 @@
#include <linux/types.h>
+struct koneplus_talk {
+ uint8_t command; /* KONEPLUS_COMMAND_TALK */
+ uint8_t size; /* always 0x10 */
+ uint8_t data[14];
+} __packed;
+
/*
* case 1: writes request 80 and reads value 1
*
@@ -139,6 +145,7 @@ enum koneplus_commands {
KONEPLUS_COMMAND_INFO = 0x9,
KONEPLUS_COMMAND_E = 0xe,
KONEPLUS_COMMAND_SENSOR = 0xf,
+ KONEPLUS_COMMAND_TALK = 0x10,
KONEPLUS_COMMAND_FIRMWARE_WRITE = 0x1b,
KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
};
@@ -153,6 +160,7 @@ enum koneplus_usb_commands {
KONEPLUS_USB_COMMAND_TCU = 0x30c,
KONEPLUS_USB_COMMAND_E = 0x30e,
KONEPLUS_USB_COMMAND_SENSOR = 0x30f,
+ KONEPLUS_USB_COMMAND_TALK = 0x310,
KONEPLUS_USB_COMMAND_FIRMWARE_WRITE = 0x31b,
KONEPLUS_USB_COMMAND_FIRMWARE_WRITE_CONTROL = 0x31c,
};
@@ -193,6 +201,7 @@ enum koneplus_mouse_report_button_types {
* data2 = action
*/
KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
+ KONEPLUS_MOUSE_REPORT_TALK = 0xff,
};
enum koneplus_mouse_report_button_action {
OpenPOWER on IntegriCloud