HID: roccat: deprecate some Kovaplus attributes

Introduced attribute "control" and made profile_settings and profile_buttons
readable, which makes profile[1-5]_settings and profile[1-5]_buttons obsolete.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Stefan Achatz 2012-11-11 06:21:19 +01:00 committed by Jiri Kosina
parent bb060d65c3
commit 172e2abc19
4 changed files with 37 additions and 29 deletions

View File

@ -39,3 +39,28 @@ Description: When read, this file returns the raw integer version number of the
This file is readonly. This file is readonly.
Obsoleted by binary sysfs attribute "info". Obsoleted by binary sysfs attribute "info".
Users: http://roccat.sourceforge.net Users: http://roccat.sourceforge.net
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_buttons
Date: January 2011
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
Description: The mouse can store 5 profiles which can be switched by the
press of a button. A profile is split in settings and buttons.
profile_buttons holds information about button layout.
When read, these files return the respective profile buttons.
The returned data is 23 bytes in size.
This file is readonly.
Write control to select profile and read profile_buttons instead.
Users: http://roccat.sourceforge.net
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_settings
Date: January 2011
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
Description: The mouse can store 5 profiles which can be switched by the
press of a button. A profile is split in settings and buttons.
profile_settings holds information like resolution, sensitivity
and light effects.
When read, these files return the respective profile settings.
The returned data is 16 bytes in size.
This file is readonly.
Write control to select profile and read profile_settings instead.
Users: http://roccat.sourceforge.net

View File

@ -28,18 +28,8 @@ Description: The mouse can store 5 profiles which can be switched by the
The mouse will reject invalid data. The mouse will reject invalid data.
Which profile to write is determined by the profile number Which profile to write is determined by the profile number
contained in the data. contained in the data.
This file is writeonly. Before reading this file, control has to be written to select
Users: http://roccat.sourceforge.net which profile to read.
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_buttons
Date: January 2011
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
Description: The mouse can store 5 profiles which can be switched by the
press of a button. A profile is split in settings and buttons.
profile_buttons holds information about button layout.
When read, these files return the respective profile buttons.
The returned data is 23 bytes in size.
This file is readonly.
Users: http://roccat.sourceforge.net Users: http://roccat.sourceforge.net
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile_settings What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile_settings
@ -54,17 +44,6 @@ Description: The mouse can store 5 profiles which can be switched by the
The mouse will reject invalid data. The mouse will reject invalid data.
Which profile to write is determined by the profile number Which profile to write is determined by the profile number
contained in the data. contained in the data.
This file is writeonly. Before reading this file, control has to be written to select
Users: http://roccat.sourceforge.net which profile to read.
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_settings
Date: January 2011
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
Description: The mouse can store 5 profiles which can be switched by the
press of a button. A profile is split in settings and buttons.
profile_settings holds information like resolution, sensitivity
and light effects.
When read, these files return the respective profile settings.
The returned data is 16 bytes in size.
This file is readonly.
Users: http://roccat.sourceforge.net Users: http://roccat.sourceforge.net

View File

@ -218,9 +218,10 @@ KOVAPLUS_SYSFS_R(thingy, THINGY)
.write = kovaplus_sysfs_write_ ## thingy \ .write = kovaplus_sysfs_write_ ## thingy \
} }
KOVAPLUS_SYSFS_W(control, CONTROL)
KOVAPLUS_SYSFS_RW(info, INFO) KOVAPLUS_SYSFS_RW(info, INFO)
KOVAPLUS_SYSFS_W(profile_settings, PROFILE_SETTINGS) KOVAPLUS_SYSFS_RW(profile_settings, PROFILE_SETTINGS)
KOVAPLUS_SYSFS_W(profile_buttons, PROFILE_BUTTONS) KOVAPLUS_SYSFS_RW(profile_buttons, PROFILE_BUTTONS)
static ssize_t kovaplus_sysfs_read_profilex_settings(struct file *fp, static ssize_t kovaplus_sysfs_read_profilex_settings(struct file *fp,
struct kobject *kobj, struct bin_attribute *attr, char *buf, struct kobject *kobj, struct bin_attribute *attr, char *buf,
@ -369,9 +370,10 @@ static struct device_attribute kovaplus_attributes[] = {
}; };
static struct bin_attribute kovaplus_bin_attributes[] = { static struct bin_attribute kovaplus_bin_attributes[] = {
KOVAPLUS_BIN_ATTRIBUTE_W(control, CONTROL),
KOVAPLUS_BIN_ATTRIBUTE_RW(info, INFO), KOVAPLUS_BIN_ATTRIBUTE_RW(info, INFO),
KOVAPLUS_BIN_ATTRIBUTE_W(profile_settings, PROFILE_SETTINGS), KOVAPLUS_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS),
KOVAPLUS_BIN_ATTRIBUTE_W(profile_buttons, PROFILE_BUTTONS), KOVAPLUS_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS),
{ {
.attr = { .name = "profile1_settings", .mode = 0440 }, .attr = { .name = "profile1_settings", .mode = 0440 },
.size = KOVAPLUS_SIZE_PROFILE_SETTINGS, .size = KOVAPLUS_SIZE_PROFILE_SETTINGS,

View File

@ -15,6 +15,7 @@
#include <linux/types.h> #include <linux/types.h>
enum { enum {
KOVAPLUS_SIZE_CONTROL = 0x03,
KOVAPLUS_SIZE_INFO = 0x06, KOVAPLUS_SIZE_INFO = 0x06,
KOVAPLUS_SIZE_PROFILE_SETTINGS = 0x10, KOVAPLUS_SIZE_PROFILE_SETTINGS = 0x10,
KOVAPLUS_SIZE_PROFILE_BUTTONS = 0x17, KOVAPLUS_SIZE_PROFILE_BUTTONS = 0x17,
@ -61,6 +62,7 @@ struct kovaplus_info {
enum kovaplus_commands { enum kovaplus_commands {
KOVAPLUS_COMMAND_ACTUAL_PROFILE = 0x5, KOVAPLUS_COMMAND_ACTUAL_PROFILE = 0x5,
KOVAPLUS_COMMAND_CONTROL = 0x4,
KOVAPLUS_COMMAND_PROFILE_SETTINGS = 0x6, KOVAPLUS_COMMAND_PROFILE_SETTINGS = 0x6,
KOVAPLUS_COMMAND_PROFILE_BUTTONS = 0x7, KOVAPLUS_COMMAND_PROFILE_BUTTONS = 0x7,
KOVAPLUS_COMMAND_INFO = 0x9, KOVAPLUS_COMMAND_INFO = 0x9,