Skip to content

Commit cb7cf3d

Browse files
Stefan AchatzJiri Kosina
authored andcommitted
HID: roccat: add driver for Roccat Pyra mouse
This patch add support for Pyra mobile gaming mouse from Roccat. It provides access to profiles, settings, actual settings etc. through sysfs attributes. This driver is conceptual similar to the existing Kone driver. Userland tools can soon be found at http://sourceforge.net/projects/roccat Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 763008c commit cb7cf3d

7 files changed

Lines changed: 1259 additions & 0 deletions

File tree

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/actual_cpi
2+
Date: August 2010
3+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
4+
Description: It is possible to switch the cpi setting of the mouse with the
5+
press of a button.
6+
When read, this file returns the raw number of the actual cpi
7+
setting reported by the mouse. This number has to be further
8+
processed to receive the real dpi value.
9+
10+
VALUE DPI
11+
1 400
12+
2 800
13+
4 1600
14+
15+
This file is readonly.
16+
17+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/actual_profile
18+
Date: August 2010
19+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
20+
Description: When read, this file returns the number of the actual profile in
21+
range 0-4.
22+
This file is readonly.
23+
24+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/firmware_version
25+
Date: August 2010
26+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
27+
Description: When read, this file returns the raw integer version number of the
28+
firmware reported by the mouse. Using the integer value eases
29+
further usage in other programs. To receive the real version
30+
number the decimal point has to be shifted 2 positions to the
31+
left. E.g. a returned value of 138 means 1.38
32+
This file is readonly.
33+
34+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile_settings
35+
Date: August 2010
36+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
37+
Description: The mouse can store 5 profiles which can be switched by the
38+
press of a button. A profile is split in settings and buttons.
39+
profile_settings holds informations like resolution, sensitivity
40+
and light effects.
41+
When written, this file lets one write the respective profile
42+
settings back to the mouse. The data has to be 13 bytes long.
43+
The mouse will reject invalid data.
44+
Which profile to write is determined by the profile number
45+
contained in the data.
46+
This file is writeonly.
47+
48+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile[1-5]_settings
49+
Date: August 2010
50+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
51+
Description: The mouse can store 5 profiles which can be switched by the
52+
press of a button. A profile is split in settings and buttons.
53+
profile_settings holds informations like resolution, sensitivity
54+
and light effects.
55+
When read, these files return the respective profile settings.
56+
The returned data is 13 bytes in size.
57+
This file is readonly.
58+
59+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile_buttons
60+
Date: August 2010
61+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
62+
Description: The mouse can store 5 profiles which can be switched by the
63+
press of a button. A profile is split in settings and buttons.
64+
profile_buttons holds informations about button layout.
65+
When written, this file lets one write the respective profile
66+
buttons back to the mouse. The data has to be 19 bytes long.
67+
The mouse will reject invalid data.
68+
Which profile to write is determined by the profile number
69+
contained in the data.
70+
This file is writeonly.
71+
72+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile[1-5]_buttons
73+
Date: August 2010
74+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
75+
Description: The mouse can store 5 profiles which can be switched by the
76+
press of a button. A profile is split in settings and buttons.
77+
profile_buttons holds informations about button layout.
78+
When read, these files return the respective profile buttons.
79+
The returned data is 19 bytes in size.
80+
This file is readonly.
81+
82+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/startup_profile
83+
Date: August 2010
84+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
85+
Description: The integer value of this attribute ranges from 0-4.
86+
When read, this attribute returns the number of the profile
87+
that's active when the mouse is powered on.
88+
This file is readonly.
89+
90+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/settings
91+
Date: August 2010
92+
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
93+
Description: When read, this file returns the settings stored in the mouse.
94+
The size of the data is 3 bytes and holds information on the
95+
startup_profile.
96+
When written, this file lets write settings back to the mouse.
97+
The data has to be 3 bytes long. The mouse will reject invalid
98+
data.

‎drivers/hid/Kconfig‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ config HID_ROCCAT_KONE
376376
---help---
377377
Support for Roccat Kone mouse.
378378

379+
config HID_ROCCAT_PYRA
380+
tristate "Roccat Pyra mouse support"
381+
depends on USB_HID
382+
select HID_ROCCAT
383+
---help---
384+
Support for Roccat Pyra mouse.
385+
379386
config HID_SAMSUNG
380387
tristate "Samsung"
381388
depends on USB_HID

‎drivers/hid/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o
5252
obj-$(CONFIG_HID_PICOLCD) += hid-picolcd.o
5353
obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o
5454
obj-$(CONFIG_HID_ROCCAT_KONE) += hid-roccat-kone.o
55+
obj-$(CONFIG_HID_ROCCAT_PYRA) += hid-roccat-pyra.o
5556
obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
5657
obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
5758
obj-$(CONFIG_HID_SONY) += hid-sony.o

‎drivers/hid/hid-core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ static const struct hid_device_id hid_blacklist[] = {
13671367
{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) },
13681368
{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN) },
13691369
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
1370+
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
13701371
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
13711372
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
13721373
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },

‎drivers/hid/hid-ids.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@
459459

460460
#define USB_VENDOR_ID_ROCCAT 0x1e7d
461461
#define USB_DEVICE_ID_ROCCAT_KONE 0x2ced
462+
#define USB_DEVICE_ID_ROCCAT_PYRA_WIRED 0x2c24
463+
#define USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS 0x2cf6
462464

463465
#define USB_VENDOR_ID_SAITEK 0x06a3
464466
#define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17

0 commit comments

Comments
 (0)