diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus index 65e6e5dd67e..f9e2a61900e 100644 --- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus @@ -104,9 +104,9 @@ What: /sys/bus/usb/devices/-:./ Description: When written a calibration process for the tracking control unit - can be initiated/cancelled. - The data has to be 3 bytes long. - This file is writeonly. + can be initiated/cancelled. Also lets one read/write sensor + registers. + The data has to be 4 bytes long. Users: http://roccat.sourceforge.net What: /sys/bus/usb/devices/-:./::./koneplus/roccatkoneplus/tcu_image diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index f5602fec486..c47540a5d4f 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -222,6 +222,14 @@ static ssize_t koneplus_sysfs_write_tcu(struct file *fp, sizeof(struct koneplus_tcu), KONEPLUS_COMMAND_TCU); } +static ssize_t koneplus_sysfs_read_tcu(struct file *fp, + struct kobject *kobj, struct bin_attribute *attr, char *buf, + loff_t off, size_t count) +{ + return koneplus_sysfs_read(fp, kobj, buf, off, count, + sizeof(struct koneplus_tcu), KONEPLUS_COMMAND_TCU); +} + static ssize_t koneplus_sysfs_read_tcu_image(struct file *fp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) @@ -426,8 +434,9 @@ static struct bin_attribute koneplus_bin_attributes[] = { .write = koneplus_sysfs_write_sensor }, { - .attr = { .name = "tcu", .mode = 0220 }, + .attr = { .name = "tcu", .mode = 0660 }, .size = sizeof(struct koneplus_tcu), + .read = koneplus_sysfs_read_tcu, .write = koneplus_sysfs_write_tcu }, {