diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2012-10-17 16:35:42 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-10-17 17:37:21 +0200 |
commit | 5277e97c2474a85eb0325ac6fff71910a4e6c134 (patch) | |
tree | 076e5448a8e733d5bd8057cbc94202ed93864eeb /drivers/hid/hid-roccat-koneplus.c | |
parent | 4424f616e48e0a48ac31de8d223ba1bdb46a84f1 (diff) |
HID: roccat: allow readout of koneplus sensor register data
tcu sysfs attr was used to only control calibration process so far. Direct
sensor register access possibility has been revealed. Allowing readout of tcu
permits usage of this feature.
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 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index f5602fec4865..c47540a5d4f3 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 }, { |