diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2011-06-01 09:54:17 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-13 06:52:57 -0400 |
commit | 1edd5b42a6631b1b1f147e9018e309bde8d96a05 (patch) | |
tree | f40ddc82488de055948f634ee7c2caef8b8730f8 /drivers/hid/hid-roccat-pyra.c | |
parent | 303f272c1f9f174146fc6c8fe9df614fa3e5825e (diff) |
HID: roccat: correction and cleanup of HID feature reports
Removed analog feature report enums and modified code in roccat_common
to reflect this. Non standard conform Kone got its own copy of the old
code. That helps extracting more generalizations for newer devices.
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-pyra.c')
-rw-r--r-- | drivers/hid/hid-roccat-pyra.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index 38280c055a19..75a092e0d1d8 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c | |||
@@ -53,7 +53,7 @@ static int pyra_send_control(struct usb_device *usb_dev, int value, | |||
53 | control.value = value; | 53 | control.value = value; |
54 | control.request = request; | 54 | control.request = request; |
55 | 55 | ||
56 | return roccat_common_send(usb_dev, PYRA_USB_COMMAND_CONTROL, | 56 | return roccat_common_send(usb_dev, PYRA_COMMAND_CONTROL, |
57 | &control, sizeof(struct pyra_control)); | 57 | &control, sizeof(struct pyra_control)); |
58 | } | 58 | } |
59 | 59 | ||
@@ -64,7 +64,7 @@ static int pyra_receive_control_status(struct usb_device *usb_dev) | |||
64 | 64 | ||
65 | do { | 65 | do { |
66 | msleep(10); | 66 | msleep(10); |
67 | retval = roccat_common_receive(usb_dev, PYRA_USB_COMMAND_CONTROL, | 67 | retval = roccat_common_receive(usb_dev, PYRA_COMMAND_CONTROL, |
68 | &control, sizeof(struct pyra_control)); | 68 | &control, sizeof(struct pyra_control)); |
69 | 69 | ||
70 | /* requested too early, try again */ | 70 | /* requested too early, try again */ |
@@ -89,7 +89,7 @@ static int pyra_get_profile_settings(struct usb_device *usb_dev, | |||
89 | PYRA_CONTROL_REQUEST_PROFILE_SETTINGS); | 89 | PYRA_CONTROL_REQUEST_PROFILE_SETTINGS); |
90 | if (retval) | 90 | if (retval) |
91 | return retval; | 91 | return retval; |
92 | return roccat_common_receive(usb_dev, PYRA_USB_COMMAND_PROFILE_SETTINGS, | 92 | return roccat_common_receive(usb_dev, PYRA_COMMAND_PROFILE_SETTINGS, |
93 | buf, sizeof(struct pyra_profile_settings)); | 93 | buf, sizeof(struct pyra_profile_settings)); |
94 | } | 94 | } |
95 | 95 | ||
@@ -101,20 +101,20 @@ static int pyra_get_profile_buttons(struct usb_device *usb_dev, | |||
101 | PYRA_CONTROL_REQUEST_PROFILE_BUTTONS); | 101 | PYRA_CONTROL_REQUEST_PROFILE_BUTTONS); |
102 | if (retval) | 102 | if (retval) |
103 | return retval; | 103 | return retval; |
104 | return roccat_common_receive(usb_dev, PYRA_USB_COMMAND_PROFILE_BUTTONS, | 104 | return roccat_common_receive(usb_dev, PYRA_COMMAND_PROFILE_BUTTONS, |
105 | buf, sizeof(struct pyra_profile_buttons)); | 105 | buf, sizeof(struct pyra_profile_buttons)); |
106 | } | 106 | } |
107 | 107 | ||
108 | static int pyra_get_settings(struct usb_device *usb_dev, | 108 | static int pyra_get_settings(struct usb_device *usb_dev, |
109 | struct pyra_settings *buf) | 109 | struct pyra_settings *buf) |
110 | { | 110 | { |
111 | return roccat_common_receive(usb_dev, PYRA_USB_COMMAND_SETTINGS, | 111 | return roccat_common_receive(usb_dev, PYRA_COMMAND_SETTINGS, |
112 | buf, sizeof(struct pyra_settings)); | 112 | buf, sizeof(struct pyra_settings)); |
113 | } | 113 | } |
114 | 114 | ||
115 | static int pyra_get_info(struct usb_device *usb_dev, struct pyra_info *buf) | 115 | static int pyra_get_info(struct usb_device *usb_dev, struct pyra_info *buf) |
116 | { | 116 | { |
117 | return roccat_common_receive(usb_dev, PYRA_USB_COMMAND_INFO, | 117 | return roccat_common_receive(usb_dev, PYRA_COMMAND_INFO, |
118 | buf, sizeof(struct pyra_info)); | 118 | buf, sizeof(struct pyra_info)); |
119 | } | 119 | } |
120 | 120 | ||
@@ -131,26 +131,22 @@ static int pyra_send(struct usb_device *usb_dev, uint command, | |||
131 | static int pyra_set_profile_settings(struct usb_device *usb_dev, | 131 | static int pyra_set_profile_settings(struct usb_device *usb_dev, |
132 | struct pyra_profile_settings const *settings) | 132 | struct pyra_profile_settings const *settings) |
133 | { | 133 | { |
134 | return pyra_send(usb_dev, PYRA_USB_COMMAND_PROFILE_SETTINGS, settings, | 134 | return pyra_send(usb_dev, PYRA_COMMAND_PROFILE_SETTINGS, settings, |
135 | sizeof(struct pyra_profile_settings)); | 135 | sizeof(struct pyra_profile_settings)); |
136 | } | 136 | } |
137 | 137 | ||
138 | static int pyra_set_profile_buttons(struct usb_device *usb_dev, | 138 | static int pyra_set_profile_buttons(struct usb_device *usb_dev, |
139 | struct pyra_profile_buttons const *buttons) | 139 | struct pyra_profile_buttons const *buttons) |
140 | { | 140 | { |
141 | return pyra_send(usb_dev, PYRA_USB_COMMAND_PROFILE_BUTTONS, buttons, | 141 | return pyra_send(usb_dev, PYRA_COMMAND_PROFILE_BUTTONS, buttons, |
142 | sizeof(struct pyra_profile_buttons)); | 142 | sizeof(struct pyra_profile_buttons)); |
143 | } | 143 | } |
144 | 144 | ||
145 | static int pyra_set_settings(struct usb_device *usb_dev, | 145 | static int pyra_set_settings(struct usb_device *usb_dev, |
146 | struct pyra_settings const *settings) | 146 | struct pyra_settings const *settings) |
147 | { | 147 | { |
148 | int retval; | 148 | return pyra_send(usb_dev, PYRA_COMMAND_SETTINGS, settings, |
149 | retval = roccat_common_send(usb_dev, PYRA_USB_COMMAND_SETTINGS, settings, | ||
150 | sizeof(struct pyra_settings)); | 149 | sizeof(struct pyra_settings)); |
151 | if (retval) | ||
152 | return retval; | ||
153 | return pyra_receive_control_status(usb_dev); | ||
154 | } | 150 | } |
155 | 151 | ||
156 | static ssize_t pyra_sysfs_read_profilex_settings(struct file *fp, | 152 | static ssize_t pyra_sysfs_read_profilex_settings(struct file *fp, |