diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2011-05-29 13:32:57 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-13 06:50:40 -0400 |
commit | 6d1dec85afa7306e66fff633689ff06195ad079a (patch) | |
tree | e6814054d84696115794134ff165f6a206e27427 /drivers/hid/hid-roccat-koneplus.c | |
parent | d762f4383100c2a87b1a3f2d678cd3b5425655b4 (diff) |
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/hid-roccat-koneplus.c')
-rw-r--r-- | drivers/hid/hid-roccat-koneplus.c | 13 |
1 files changed, 13 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, | |||
240 | return real_size; | 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 | static ssize_t koneplus_sysfs_write_macro(struct file *fp, | 251 | static ssize_t koneplus_sysfs_write_macro(struct file *fp, |
244 | struct kobject *kobj, struct bin_attribute *attr, char *buf, | 252 | struct kobject *kobj, struct bin_attribute *attr, char *buf, |
245 | loff_t off, size_t count) | 253 | loff_t off, size_t count) |
@@ -557,6 +565,11 @@ static struct bin_attribute koneplus_bin_attributes[] = { | |||
557 | .size = sizeof(struct koneplus_macro), | 565 | .size = sizeof(struct koneplus_macro), |
558 | .write = koneplus_sysfs_write_macro | 566 | .write = koneplus_sysfs_write_macro |
559 | }, | 567 | }, |
568 | { | ||
569 | .attr = { .name = "talk", .mode = 0220 }, | ||
570 | .size = sizeof(struct koneplus_talk), | ||
571 | .write = koneplus_sysfs_write_talk | ||
572 | }, | ||
560 | __ATTR_NULL | 573 | __ATTR_NULL |
561 | }; | 574 | }; |
562 | 575 | ||