]> Pileus Git - ~andy/linux/commitdiff
HID: roccat: deprecate some Koneplus attributes
authorStefan Achatz <stefan_achatz@web.de>
Sun, 11 Nov 2012 05:21:15 +0000 (06:21 +0100)
committerJiri Kosina <jkosina@suse.cz>
Mon, 12 Nov 2012 14:30:28 +0000 (15:30 +0100)
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>
Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
drivers/hid/hid-roccat-koneplus.c
drivers/hid/hid-roccat-koneplus.h

index 22568b45973e1b33570e23ab35bbb961a77f1f6e..833fd59926a73c1f3725559400b60b598f2446fa 100644 (file)
@@ -8,6 +8,7 @@ Description:    The integer value of this attribute ranges from 0-4.
                When written, this file sets the number of the startup profile
                and the mouse activates this profile immediately.
                Please use actual_profile, it does the same thing.
+Users:         http://roccat.sourceforge.net
 
 What:          /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/firmware_version
 Date:          October 2010
@@ -19,3 +20,29 @@ Description: When read, this file returns the raw integer version number of the
                left. E.g. a returned value of 121 means 1.21
                This file is readonly.
                Please read binary attribute info which contains firmware version.
+Users:         http://roccat.sourceforge.net
+
+What:          /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_buttons
+Date:          August 2010
+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 77 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>/koneplus/roccatkoneplus<minor>/profile[1-5]_settings
+Date:          August 2010
+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 43 bytes in size.
+               This file is readonly.
+               Write control to select profile and read profile_settings instead.
+Users:         http://roccat.sourceforge.net
\ No newline at end of file
index ed1213defb81792f61fdf490877ee1bbd4b349f9..7bd776f9c3c70cc2f92290cbae254a9858c41daf 100644 (file)
@@ -39,18 +39,8 @@ Description: The mouse can store 5 profiles which can be switched by the
                The mouse will reject invalid data.
                Which profile to write is determined by the profile number
                contained in the data.
-               This file is writeonly.
-Users:         http://roccat.sourceforge.net
-
-What:          /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_buttons
-Date:          August 2010
-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 77 bytes in size.
-               This file is readonly.
+               Before reading this file, control has to be written to select
+               which profile to read.
 Users:         http://roccat.sourceforge.net
 
 What:          /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile_settings
@@ -65,19 +55,8 @@ Description: The mouse can store 5 profiles which can be switched by the
                The mouse will reject invalid data.
                Which profile to write is determined by the profile number
                contained in the data.
-               This file is writeonly.
-Users:         http://roccat.sourceforge.net
-
-What:          /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_settings
-Date:          August 2010
-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 43 bytes in size.
-               This file is readonly.
+               Before reading this file, control has to be written to select
+               which profile to read.
 Users:         http://roccat.sourceforge.net
 
 What:          /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/sensor
index 9fe445082308511c5e1e2a6d9e76a46bf57ce02e..6a48fa3c7da913e487e5aa0b1538ba5aff19bbb1 100644 (file)
@@ -177,14 +177,15 @@ KONEPLUS_SYSFS_R(thingy, THINGY)
        .write = koneplus_sysfs_write_ ## thingy \
 }
 
+KONEPLUS_SYSFS_W(control, CONTROL)
 KONEPLUS_SYSFS_RW(info, INFO)
 KONEPLUS_SYSFS_W(talk, TALK)
 KONEPLUS_SYSFS_W(macro, MACRO)
 KONEPLUS_SYSFS_RW(sensor, SENSOR)
 KONEPLUS_SYSFS_RW(tcu, TCU)
 KONEPLUS_SYSFS_R(tcu_image, TCU_IMAGE)
-KONEPLUS_SYSFS_W(profile_settings, PROFILE_SETTINGS)
-KONEPLUS_SYSFS_W(profile_buttons, PROFILE_BUTTONS)
+KONEPLUS_SYSFS_RW(profile_settings, PROFILE_SETTINGS)
+KONEPLUS_SYSFS_RW(profile_buttons, PROFILE_BUTTONS)
 
 static ssize_t koneplus_sysfs_read_profilex_settings(struct file *fp,
                struct kobject *kobj, struct bin_attribute *attr, char *buf,
@@ -306,14 +307,15 @@ static struct device_attribute koneplus_attributes[] = {
 };
 
 static struct bin_attribute koneplus_bin_attributes[] = {
+       KONEPLUS_BIN_ATTRIBUTE_W(control, CONTROL),
        KONEPLUS_BIN_ATTRIBUTE_RW(info, INFO),
        KONEPLUS_BIN_ATTRIBUTE_W(talk, TALK),
        KONEPLUS_BIN_ATTRIBUTE_W(macro, MACRO),
        KONEPLUS_BIN_ATTRIBUTE_RW(sensor, SENSOR),
        KONEPLUS_BIN_ATTRIBUTE_RW(tcu, TCU),
        KONEPLUS_BIN_ATTRIBUTE_R(tcu_image, TCU_IMAGE),
-       KONEPLUS_BIN_ATTRIBUTE_W(profile_settings, PROFILE_SETTINGS),
-       KONEPLUS_BIN_ATTRIBUTE_W(profile_buttons, PROFILE_BUTTONS),
+       KONEPLUS_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS),
+       KONEPLUS_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS),
        {
                .attr = { .name = "profile1_settings", .mode = 0440 },
                .size = KONEPLUS_SIZE_PROFILE_SETTINGS,
index 563b9d3fe5fb0f6e517ac7e2e4c0ee5692afc9d7..d2b55f2c764d550904ed8389b492c5ba28edee4f 100644 (file)
@@ -16,6 +16,7 @@
 
 enum {
        KONEPLUS_SIZE_ACTUAL_PROFILE = 0x03,
+       KONEPLUS_SIZE_CONTROL = 0x03,
        KONEPLUS_SIZE_FIRMWARE_WRITE = 0x0402,
        KONEPLUS_SIZE_INFO = 0x06,
        KONEPLUS_SIZE_MACRO = 0x0822,
@@ -47,6 +48,7 @@ struct koneplus_info {
 
 enum koneplus_commands {
        KONEPLUS_COMMAND_ACTUAL_PROFILE = 0x5,
+       KONEPLUS_COMMAND_CONTROL = 0x4,
        KONEPLUS_COMMAND_PROFILE_SETTINGS = 0x6,
        KONEPLUS_COMMAND_PROFILE_BUTTONS = 0x7,
        KONEPLUS_COMMAND_MACRO = 0x8,