Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: roccat: deprecated some Pyra 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>

authored by

Stefan Achatz and committed by
Jiri Kosina
ecbfe7aa f1da71e1

+45 -29
+25
Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra
··· 37 37 Please use binary attribute "info" which provides this information. 38 38 Users: http://roccat.sourceforge.net 39 39 40 + What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_buttons 41 + Date: August 2010 42 + Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 43 + Description: The mouse can store 5 profiles which can be switched by the 44 + press of a button. A profile is split in settings and buttons. 45 + profile_buttons holds information about button layout. 46 + When read, these files return the respective profile buttons. 47 + The returned data is 19 bytes in size. 48 + This file is readonly. 49 + Write control to select profile and read profile_buttons instead. 50 + Users: http://roccat.sourceforge.net 51 + 52 + What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_settings 53 + Date: August 2010 54 + Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 55 + Description: The mouse can store 5 profiles which can be switched by the 56 + press of a button. A profile is split in settings and buttons. 57 + profile_settings holds information like resolution, sensitivity 58 + and light effects. 59 + When read, these files return the respective profile settings. 60 + The returned data is 13 bytes in size. 61 + This file is readonly. 62 + Write control to select profile and read profile_settings instead. 63 + Users: http://roccat.sourceforge.net 64 + 40 65 What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/startup_profile 41 66 Date: August 2010 42 67 Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
+12 -25
Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra
··· 1 + What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/info 2 + Date: November 2012 3 + Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 4 + Description: When read, this file returns general data like firmware version. 5 + When written, the device can be reset. 6 + The data is 6 bytes long. 7 + Users: http://roccat.sourceforge.net 8 + 1 9 What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile_settings 2 10 Date: August 2010 3 11 Contact: Stefan Achatz <erazor_de@users.sourceforge.net> ··· 18 10 The mouse will reject invalid data. 19 11 Which profile to write is determined by the profile number 20 12 contained in the data. 21 - This file is writeonly. 22 - Users: http://roccat.sourceforge.net 23 - 24 - What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_settings 25 - Date: August 2010 26 - Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 27 - Description: The mouse can store 5 profiles which can be switched by the 28 - press of a button. A profile is split in settings and buttons. 29 - profile_settings holds information like resolution, sensitivity 30 - and light effects. 31 - When read, these files return the respective profile settings. 32 - The returned data is 13 bytes in size. 33 - This file is readonly. 13 + Before reading this file, control has to be written to select 14 + which profile to read. 34 15 Users: http://roccat.sourceforge.net 35 16 36 17 What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile_buttons ··· 33 36 The mouse will reject invalid data. 34 37 Which profile to write is determined by the profile number 35 38 contained in the data. 36 - This file is writeonly. 37 - Users: http://roccat.sourceforge.net 38 - 39 - What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_buttons 40 - Date: August 2010 41 - Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 42 - Description: The mouse can store 5 profiles which can be switched by the 43 - press of a button. A profile is split in settings and buttons. 44 - profile_buttons holds information about button layout. 45 - When read, these files return the respective profile buttons. 46 - The returned data is 19 bytes in size. 47 - This file is readonly. 39 + Before reading this file, control has to be written to select 40 + which profile to read. 48 41 Users: http://roccat.sourceforge.net 49 42 50 43 What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/settings
+6 -4
drivers/hid/hid-roccat-pyra.c
··· 177 177 .write = pyra_sysfs_write_ ## thingy \ 178 178 } 179 179 180 + PYRA_SYSFS_W(control, CONTROL) 180 181 PYRA_SYSFS_RW(info, INFO) 181 - PYRA_SYSFS_W(profile_settings, PROFILE_SETTINGS) 182 - PYRA_SYSFS_W(profile_buttons, PROFILE_BUTTONS) 182 + PYRA_SYSFS_RW(profile_settings, PROFILE_SETTINGS) 183 + PYRA_SYSFS_RW(profile_buttons, PROFILE_BUTTONS) 183 184 PYRA_SYSFS_R(settings, SETTINGS) 184 185 185 186 static ssize_t pyra_sysfs_read_profilex_settings(struct file *fp, ··· 313 312 }; 314 313 315 314 static struct bin_attribute pyra_bin_attributes[] = { 315 + PYRA_BIN_ATTRIBUTE_W(control, CONTROL), 316 316 PYRA_BIN_ATTRIBUTE_RW(info, INFO), 317 - PYRA_BIN_ATTRIBUTE_W(profile_settings, PROFILE_SETTINGS), 318 - PYRA_BIN_ATTRIBUTE_W(profile_buttons, PROFILE_BUTTONS), 317 + PYRA_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS), 318 + PYRA_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS), 319 319 PYRA_BIN_ATTRIBUTE_RW(settings, SETTINGS), 320 320 { 321 321 .attr = { .name = "profile1_settings", .mode = 0440 },
+2
drivers/hid/hid-roccat-pyra.h
··· 15 15 #include <linux/types.h> 16 16 17 17 enum { 18 + PYRA_SIZE_CONTROL = 0x03, 18 19 PYRA_SIZE_INFO = 0x06, 19 20 PYRA_SIZE_PROFILE_SETTINGS = 0x0d, 20 21 PYRA_SIZE_PROFILE_BUTTONS = 0x13, ··· 58 57 } __attribute__ ((__packed__)); 59 58 60 59 enum pyra_commands { 60 + PYRA_COMMAND_CONTROL = 0x4, 61 61 PYRA_COMMAND_SETTINGS = 0x5, 62 62 PYRA_COMMAND_PROFILE_SETTINGS = 0x6, 63 63 PYRA_COMMAND_PROFILE_BUTTONS = 0x7,