diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2012-05-20 16:45:04 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-06-28 04:34:01 -0400 |
commit | 7392d73be2b3c907d65126f072c313215e1907b3 (patch) | |
tree | a10a80d29a8f17e1e330e4b50db48aff468e9c3c /drivers/hid | |
parent | 4ec141ad4e470485803a98ddb250aa7df030e8df (diff) |
HID: roccat: rename roccat_common functions to roccat_common2
Did this to illustrate my understanding of the firmware generations:
Valo and Kone were 1st generation
Arvo was externaly developed and lies in the middle
All others until now are considered 2nd generation
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-roccat-arvo.c | 16 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-common.c | 34 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-common.h | 10 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-isku.c | 6 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-koneplus.c | 24 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-kovaplus.c | 20 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-pyra.c | 20 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-savu.c | 4 |
8 files changed, 67 insertions, 67 deletions
diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c index 093bfad00b02..327f9b8ed1f4 100644 --- a/drivers/hid/hid-roccat-arvo.c +++ b/drivers/hid/hid-roccat-arvo.c | |||
@@ -39,7 +39,7 @@ static ssize_t arvo_sysfs_show_mode_key(struct device *dev, | |||
39 | int retval; | 39 | int retval; |
40 | 40 | ||
41 | mutex_lock(&arvo->arvo_lock); | 41 | mutex_lock(&arvo->arvo_lock); |
42 | retval = roccat_common_receive(usb_dev, ARVO_COMMAND_MODE_KEY, | 42 | retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_MODE_KEY, |
43 | &temp_buf, sizeof(struct arvo_mode_key)); | 43 | &temp_buf, sizeof(struct arvo_mode_key)); |
44 | mutex_unlock(&arvo->arvo_lock); | 44 | mutex_unlock(&arvo->arvo_lock); |
45 | if (retval) | 45 | if (retval) |
@@ -67,7 +67,7 @@ static ssize_t arvo_sysfs_set_mode_key(struct device *dev, | |||
67 | temp_buf.state = state; | 67 | temp_buf.state = state; |
68 | 68 | ||
69 | mutex_lock(&arvo->arvo_lock); | 69 | mutex_lock(&arvo->arvo_lock); |
70 | retval = roccat_common_send(usb_dev, ARVO_COMMAND_MODE_KEY, | 70 | retval = roccat_common2_send(usb_dev, ARVO_COMMAND_MODE_KEY, |
71 | &temp_buf, sizeof(struct arvo_mode_key)); | 71 | &temp_buf, sizeof(struct arvo_mode_key)); |
72 | mutex_unlock(&arvo->arvo_lock); | 72 | mutex_unlock(&arvo->arvo_lock); |
73 | if (retval) | 73 | if (retval) |
@@ -87,7 +87,7 @@ static ssize_t arvo_sysfs_show_key_mask(struct device *dev, | |||
87 | int retval; | 87 | int retval; |
88 | 88 | ||
89 | mutex_lock(&arvo->arvo_lock); | 89 | mutex_lock(&arvo->arvo_lock); |
90 | retval = roccat_common_receive(usb_dev, ARVO_COMMAND_KEY_MASK, | 90 | retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_KEY_MASK, |
91 | &temp_buf, sizeof(struct arvo_key_mask)); | 91 | &temp_buf, sizeof(struct arvo_key_mask)); |
92 | mutex_unlock(&arvo->arvo_lock); | 92 | mutex_unlock(&arvo->arvo_lock); |
93 | if (retval) | 93 | if (retval) |
@@ -115,7 +115,7 @@ static ssize_t arvo_sysfs_set_key_mask(struct device *dev, | |||
115 | temp_buf.key_mask = key_mask; | 115 | temp_buf.key_mask = key_mask; |
116 | 116 | ||
117 | mutex_lock(&arvo->arvo_lock); | 117 | mutex_lock(&arvo->arvo_lock); |
118 | retval = roccat_common_send(usb_dev, ARVO_COMMAND_KEY_MASK, | 118 | retval = roccat_common2_send(usb_dev, ARVO_COMMAND_KEY_MASK, |
119 | &temp_buf, sizeof(struct arvo_key_mask)); | 119 | &temp_buf, sizeof(struct arvo_key_mask)); |
120 | mutex_unlock(&arvo->arvo_lock); | 120 | mutex_unlock(&arvo->arvo_lock); |
121 | if (retval) | 121 | if (retval) |
@@ -130,7 +130,7 @@ static int arvo_get_actual_profile(struct usb_device *usb_dev) | |||
130 | struct arvo_actual_profile temp_buf; | 130 | struct arvo_actual_profile temp_buf; |
131 | int retval; | 131 | int retval; |
132 | 132 | ||
133 | retval = roccat_common_receive(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE, | 133 | retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE, |
134 | &temp_buf, sizeof(struct arvo_actual_profile)); | 134 | &temp_buf, sizeof(struct arvo_actual_profile)); |
135 | 135 | ||
136 | if (retval) | 136 | if (retval) |
@@ -170,7 +170,7 @@ static ssize_t arvo_sysfs_set_actual_profile(struct device *dev, | |||
170 | temp_buf.actual_profile = profile; | 170 | temp_buf.actual_profile = profile; |
171 | 171 | ||
172 | mutex_lock(&arvo->arvo_lock); | 172 | mutex_lock(&arvo->arvo_lock); |
173 | retval = roccat_common_send(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE, | 173 | retval = roccat_common2_send(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE, |
174 | &temp_buf, sizeof(struct arvo_actual_profile)); | 174 | &temp_buf, sizeof(struct arvo_actual_profile)); |
175 | if (!retval) { | 175 | if (!retval) { |
176 | arvo->actual_profile = profile; | 176 | arvo->actual_profile = profile; |
@@ -194,7 +194,7 @@ static ssize_t arvo_sysfs_write(struct file *fp, | |||
194 | return -EINVAL; | 194 | return -EINVAL; |
195 | 195 | ||
196 | mutex_lock(&arvo->arvo_lock); | 196 | mutex_lock(&arvo->arvo_lock); |
197 | retval = roccat_common_send(usb_dev, command, buf, real_size); | 197 | retval = roccat_common2_send(usb_dev, command, buf, real_size); |
198 | mutex_unlock(&arvo->arvo_lock); | 198 | mutex_unlock(&arvo->arvo_lock); |
199 | 199 | ||
200 | return (retval ? retval : real_size); | 200 | return (retval ? retval : real_size); |
@@ -217,7 +217,7 @@ static ssize_t arvo_sysfs_read(struct file *fp, | |||
217 | return -EINVAL; | 217 | return -EINVAL; |
218 | 218 | ||
219 | mutex_lock(&arvo->arvo_lock); | 219 | mutex_lock(&arvo->arvo_lock); |
220 | retval = roccat_common_receive(usb_dev, command, buf, real_size); | 220 | retval = roccat_common2_receive(usb_dev, command, buf, real_size); |
221 | mutex_unlock(&arvo->arvo_lock); | 221 | mutex_unlock(&arvo->arvo_lock); |
222 | 222 | ||
223 | return (retval ? retval : real_size); | 223 | return (retval ? retval : real_size); |
diff --git a/drivers/hid/hid-roccat-common.c b/drivers/hid/hid-roccat-common.c index 291414eac279..74f704032627 100644 --- a/drivers/hid/hid-roccat-common.c +++ b/drivers/hid/hid-roccat-common.c | |||
@@ -16,12 +16,12 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include "hid-roccat-common.h" | 17 | #include "hid-roccat-common.h" |
18 | 18 | ||
19 | static inline uint16_t roccat_common_feature_report(uint8_t report_id) | 19 | static inline uint16_t roccat_common2_feature_report(uint8_t report_id) |
20 | { | 20 | { |
21 | return 0x300 | report_id; | 21 | return 0x300 | report_id; |
22 | } | 22 | } |
23 | 23 | ||
24 | int roccat_common_receive(struct usb_device *usb_dev, uint report_id, | 24 | int roccat_common2_receive(struct usb_device *usb_dev, uint report_id, |
25 | void *data, uint size) | 25 | void *data, uint size) |
26 | { | 26 | { |
27 | char *buf; | 27 | char *buf; |
@@ -34,16 +34,16 @@ int roccat_common_receive(struct usb_device *usb_dev, uint report_id, | |||
34 | len = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), | 34 | len = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), |
35 | HID_REQ_GET_REPORT, | 35 | HID_REQ_GET_REPORT, |
36 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, | 36 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, |
37 | roccat_common_feature_report(report_id), | 37 | roccat_common2_feature_report(report_id), |
38 | 0, buf, size, USB_CTRL_SET_TIMEOUT); | 38 | 0, buf, size, USB_CTRL_SET_TIMEOUT); |
39 | 39 | ||
40 | memcpy(data, buf, size); | 40 | memcpy(data, buf, size); |
41 | kfree(buf); | 41 | kfree(buf); |
42 | return ((len < 0) ? len : ((len != size) ? -EIO : 0)); | 42 | return ((len < 0) ? len : ((len != size) ? -EIO : 0)); |
43 | } | 43 | } |
44 | EXPORT_SYMBOL_GPL(roccat_common_receive); | 44 | EXPORT_SYMBOL_GPL(roccat_common2_receive); |
45 | 45 | ||
46 | int roccat_common_send(struct usb_device *usb_dev, uint report_id, | 46 | int roccat_common2_send(struct usb_device *usb_dev, uint report_id, |
47 | void const *data, uint size) | 47 | void const *data, uint size) |
48 | { | 48 | { |
49 | char *buf; | 49 | char *buf; |
@@ -56,31 +56,31 @@ int roccat_common_send(struct usb_device *usb_dev, uint report_id, | |||
56 | len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), | 56 | len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), |
57 | HID_REQ_SET_REPORT, | 57 | HID_REQ_SET_REPORT, |
58 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, | 58 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, |
59 | roccat_common_feature_report(report_id), | 59 | roccat_common2_feature_report(report_id), |
60 | 0, buf, size, USB_CTRL_SET_TIMEOUT); | 60 | 0, buf, size, USB_CTRL_SET_TIMEOUT); |
61 | 61 | ||
62 | kfree(buf); | 62 | kfree(buf); |
63 | return ((len < 0) ? len : ((len != size) ? -EIO : 0)); | 63 | return ((len < 0) ? len : ((len != size) ? -EIO : 0)); |
64 | } | 64 | } |
65 | EXPORT_SYMBOL_GPL(roccat_common_send); | 65 | EXPORT_SYMBOL_GPL(roccat_common2_send); |
66 | 66 | ||
67 | enum roccat_common_control_states { | 67 | enum roccat_common2_control_states { |
68 | ROCCAT_COMMON_CONTROL_STATUS_OVERLOAD = 0, | 68 | ROCCAT_COMMON_CONTROL_STATUS_OVERLOAD = 0, |
69 | ROCCAT_COMMON_CONTROL_STATUS_OK = 1, | 69 | ROCCAT_COMMON_CONTROL_STATUS_OK = 1, |
70 | ROCCAT_COMMON_CONTROL_STATUS_INVALID = 2, | 70 | ROCCAT_COMMON_CONTROL_STATUS_INVALID = 2, |
71 | ROCCAT_COMMON_CONTROL_STATUS_WAIT = 3, | 71 | ROCCAT_COMMON_CONTROL_STATUS_WAIT = 3, |
72 | }; | 72 | }; |
73 | 73 | ||
74 | static int roccat_common_receive_control_status(struct usb_device *usb_dev) | 74 | static int roccat_common2_receive_control_status(struct usb_device *usb_dev) |
75 | { | 75 | { |
76 | int retval; | 76 | int retval; |
77 | struct roccat_common_control control; | 77 | struct roccat_common2_control control; |
78 | 78 | ||
79 | do { | 79 | do { |
80 | msleep(50); | 80 | msleep(50); |
81 | retval = roccat_common_receive(usb_dev, | 81 | retval = roccat_common2_receive(usb_dev, |
82 | ROCCAT_COMMON_COMMAND_CONTROL, | 82 | ROCCAT_COMMON_COMMAND_CONTROL, |
83 | &control, sizeof(struct roccat_common_control)); | 83 | &control, sizeof(struct roccat_common2_control)); |
84 | 84 | ||
85 | if (retval) | 85 | if (retval) |
86 | return retval; | 86 | return retval; |
@@ -98,7 +98,7 @@ static int roccat_common_receive_control_status(struct usb_device *usb_dev) | |||
98 | return -EINVAL; | 98 | return -EINVAL; |
99 | default: | 99 | default: |
100 | dev_err(&usb_dev->dev, | 100 | dev_err(&usb_dev->dev, |
101 | "roccat_common_receive_control_status: " | 101 | "roccat_common2_receive_control_status: " |
102 | "unknown response value 0x%x\n", | 102 | "unknown response value 0x%x\n", |
103 | control.value); | 103 | control.value); |
104 | return -EINVAL; | 104 | return -EINVAL; |
@@ -107,20 +107,20 @@ static int roccat_common_receive_control_status(struct usb_device *usb_dev) | |||
107 | } while (1); | 107 | } while (1); |
108 | } | 108 | } |
109 | 109 | ||
110 | int roccat_common_send_with_status(struct usb_device *usb_dev, | 110 | int roccat_common2_send_with_status(struct usb_device *usb_dev, |
111 | uint command, void const *buf, uint size) | 111 | uint command, void const *buf, uint size) |
112 | { | 112 | { |
113 | int retval; | 113 | int retval; |
114 | 114 | ||
115 | retval = roccat_common_send(usb_dev, command, buf, size); | 115 | retval = roccat_common2_send(usb_dev, command, buf, size); |
116 | if (retval) | 116 | if (retval) |
117 | return retval; | 117 | return retval; |
118 | 118 | ||
119 | msleep(100); | 119 | msleep(100); |
120 | 120 | ||
121 | return roccat_common_receive_control_status(usb_dev); | 121 | return roccat_common2_receive_control_status(usb_dev); |
122 | } | 122 | } |
123 | EXPORT_SYMBOL_GPL(roccat_common_send_with_status); | 123 | EXPORT_SYMBOL_GPL(roccat_common2_send_with_status); |
124 | 124 | ||
125 | MODULE_AUTHOR("Stefan Achatz"); | 125 | MODULE_AUTHOR("Stefan Achatz"); |
126 | MODULE_DESCRIPTION("USB Roccat common driver"); | 126 | MODULE_DESCRIPTION("USB Roccat common driver"); |
diff --git a/drivers/hid/hid-roccat-common.h b/drivers/hid/hid-roccat-common.h index 86bce05da013..a97746a63b70 100644 --- a/drivers/hid/hid-roccat-common.h +++ b/drivers/hid/hid-roccat-common.h | |||
@@ -15,21 +15,21 @@ | |||
15 | #include <linux/usb.h> | 15 | #include <linux/usb.h> |
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | 17 | ||
18 | enum roccat_common_commands { | 18 | enum roccat_common2_commands { |
19 | ROCCAT_COMMON_COMMAND_CONTROL = 0x4, | 19 | ROCCAT_COMMON_COMMAND_CONTROL = 0x4, |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct roccat_common_control { | 22 | struct roccat_common2_control { |
23 | uint8_t command; | 23 | uint8_t command; |
24 | uint8_t value; | 24 | uint8_t value; |
25 | uint8_t request; /* always 0 on requesting write check */ | 25 | uint8_t request; /* always 0 on requesting write check */ |
26 | } __packed; | 26 | } __packed; |
27 | 27 | ||
28 | int roccat_common_receive(struct usb_device *usb_dev, uint report_id, | 28 | int roccat_common2_receive(struct usb_device *usb_dev, uint report_id, |
29 | void *data, uint size); | 29 | void *data, uint size); |
30 | int roccat_common_send(struct usb_device *usb_dev, uint report_id, | 30 | int roccat_common2_send(struct usb_device *usb_dev, uint report_id, |
31 | void const *data, uint size); | 31 | void const *data, uint size); |
32 | int roccat_common_send_with_status(struct usb_device *usb_dev, | 32 | int roccat_common2_send_with_status(struct usb_device *usb_dev, |
33 | uint command, void const *buf, uint size); | 33 | uint command, void const *buf, uint size); |
34 | 34 | ||
35 | #endif | 35 | #endif |
diff --git a/drivers/hid/hid-roccat-isku.c b/drivers/hid/hid-roccat-isku.c index 20e7f84ee832..5669916c2943 100644 --- a/drivers/hid/hid-roccat-isku.c +++ b/drivers/hid/hid-roccat-isku.c | |||
@@ -36,7 +36,7 @@ static void isku_profile_activated(struct isku_device *isku, uint new_profile) | |||
36 | static int isku_receive(struct usb_device *usb_dev, uint command, | 36 | static int isku_receive(struct usb_device *usb_dev, uint command, |
37 | void *buf, uint size) | 37 | void *buf, uint size) |
38 | { | 38 | { |
39 | return roccat_common_receive(usb_dev, command, buf, size); | 39 | return roccat_common2_receive(usb_dev, command, buf, size); |
40 | } | 40 | } |
41 | 41 | ||
42 | static int isku_get_actual_profile(struct usb_device *usb_dev) | 42 | static int isku_get_actual_profile(struct usb_device *usb_dev) |
@@ -56,7 +56,7 @@ static int isku_set_actual_profile(struct usb_device *usb_dev, int new_profile) | |||
56 | buf.command = ISKU_COMMAND_ACTUAL_PROFILE; | 56 | buf.command = ISKU_COMMAND_ACTUAL_PROFILE; |
57 | buf.size = sizeof(struct isku_actual_profile); | 57 | buf.size = sizeof(struct isku_actual_profile); |
58 | buf.actual_profile = new_profile; | 58 | buf.actual_profile = new_profile; |
59 | return roccat_common_send_with_status(usb_dev, | 59 | return roccat_common2_send_with_status(usb_dev, |
60 | ISKU_COMMAND_ACTUAL_PROFILE, &buf, | 60 | ISKU_COMMAND_ACTUAL_PROFILE, &buf, |
61 | sizeof(struct isku_actual_profile)); | 61 | sizeof(struct isku_actual_profile)); |
62 | } | 62 | } |
@@ -154,7 +154,7 @@ static ssize_t isku_sysfs_write(struct file *fp, struct kobject *kobj, | |||
154 | return -EINVAL; | 154 | return -EINVAL; |
155 | 155 | ||
156 | mutex_lock(&isku->isku_lock); | 156 | mutex_lock(&isku->isku_lock); |
157 | retval = roccat_common_send_with_status(usb_dev, command, | 157 | retval = roccat_common2_send_with_status(usb_dev, command, |
158 | (void *)buf, real_size); | 158 | (void *)buf, real_size); |
159 | mutex_unlock(&isku->isku_lock); | 159 | mutex_unlock(&isku->isku_lock); |
160 | 160 | ||
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 01167a831258..f5602fec4865 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c | |||
@@ -39,7 +39,7 @@ static void koneplus_profile_activated(struct koneplus_device *koneplus, | |||
39 | static int koneplus_send_control(struct usb_device *usb_dev, uint value, | 39 | static int koneplus_send_control(struct usb_device *usb_dev, uint value, |
40 | enum koneplus_control_requests request) | 40 | enum koneplus_control_requests request) |
41 | { | 41 | { |
42 | struct roccat_common_control control; | 42 | struct roccat_common2_control control; |
43 | 43 | ||
44 | if ((request == KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS || | 44 | if ((request == KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS || |
45 | request == KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) && | 45 | request == KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) && |
@@ -50,15 +50,15 @@ static int koneplus_send_control(struct usb_device *usb_dev, uint value, | |||
50 | control.value = value; | 50 | control.value = value; |
51 | control.request = request; | 51 | control.request = request; |
52 | 52 | ||
53 | return roccat_common_send_with_status(usb_dev, | 53 | return roccat_common2_send_with_status(usb_dev, |
54 | ROCCAT_COMMON_COMMAND_CONTROL, | 54 | ROCCAT_COMMON_COMMAND_CONTROL, |
55 | &control, sizeof(struct roccat_common_control)); | 55 | &control, sizeof(struct roccat_common2_control)); |
56 | } | 56 | } |
57 | 57 | ||
58 | static int koneplus_get_info(struct usb_device *usb_dev, | 58 | static int koneplus_get_info(struct usb_device *usb_dev, |
59 | struct koneplus_info *buf) | 59 | struct koneplus_info *buf) |
60 | { | 60 | { |
61 | return roccat_common_receive(usb_dev, KONEPLUS_COMMAND_INFO, | 61 | return roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_INFO, |
62 | buf, sizeof(struct koneplus_info)); | 62 | buf, sizeof(struct koneplus_info)); |
63 | } | 63 | } |
64 | 64 | ||
@@ -72,14 +72,14 @@ static int koneplus_get_profile_settings(struct usb_device *usb_dev, | |||
72 | if (retval) | 72 | if (retval) |
73 | return retval; | 73 | return retval; |
74 | 74 | ||
75 | return roccat_common_receive(usb_dev, KONEPLUS_COMMAND_PROFILE_SETTINGS, | 75 | return roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_PROFILE_SETTINGS, |
76 | buf, sizeof(struct koneplus_profile_settings)); | 76 | buf, sizeof(struct koneplus_profile_settings)); |
77 | } | 77 | } |
78 | 78 | ||
79 | static int koneplus_set_profile_settings(struct usb_device *usb_dev, | 79 | static int koneplus_set_profile_settings(struct usb_device *usb_dev, |
80 | struct koneplus_profile_settings const *settings) | 80 | struct koneplus_profile_settings const *settings) |
81 | { | 81 | { |
82 | return roccat_common_send_with_status(usb_dev, | 82 | return roccat_common2_send_with_status(usb_dev, |
83 | KONEPLUS_COMMAND_PROFILE_SETTINGS, | 83 | KONEPLUS_COMMAND_PROFILE_SETTINGS, |
84 | settings, sizeof(struct koneplus_profile_settings)); | 84 | settings, sizeof(struct koneplus_profile_settings)); |
85 | } | 85 | } |
@@ -94,14 +94,14 @@ static int koneplus_get_profile_buttons(struct usb_device *usb_dev, | |||
94 | if (retval) | 94 | if (retval) |
95 | return retval; | 95 | return retval; |
96 | 96 | ||
97 | return roccat_common_receive(usb_dev, KONEPLUS_COMMAND_PROFILE_BUTTONS, | 97 | return roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_PROFILE_BUTTONS, |
98 | buf, sizeof(struct koneplus_profile_buttons)); | 98 | buf, sizeof(struct koneplus_profile_buttons)); |
99 | } | 99 | } |
100 | 100 | ||
101 | static int koneplus_set_profile_buttons(struct usb_device *usb_dev, | 101 | static int koneplus_set_profile_buttons(struct usb_device *usb_dev, |
102 | struct koneplus_profile_buttons const *buttons) | 102 | struct koneplus_profile_buttons const *buttons) |
103 | { | 103 | { |
104 | return roccat_common_send_with_status(usb_dev, | 104 | return roccat_common2_send_with_status(usb_dev, |
105 | KONEPLUS_COMMAND_PROFILE_BUTTONS, | 105 | KONEPLUS_COMMAND_PROFILE_BUTTONS, |
106 | buttons, sizeof(struct koneplus_profile_buttons)); | 106 | buttons, sizeof(struct koneplus_profile_buttons)); |
107 | } | 107 | } |
@@ -112,7 +112,7 @@ static int koneplus_get_actual_profile(struct usb_device *usb_dev) | |||
112 | struct koneplus_actual_profile buf; | 112 | struct koneplus_actual_profile buf; |
113 | int retval; | 113 | int retval; |
114 | 114 | ||
115 | retval = roccat_common_receive(usb_dev, KONEPLUS_COMMAND_ACTUAL_PROFILE, | 115 | retval = roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_ACTUAL_PROFILE, |
116 | &buf, sizeof(struct koneplus_actual_profile)); | 116 | &buf, sizeof(struct koneplus_actual_profile)); |
117 | 117 | ||
118 | return retval ? retval : buf.actual_profile; | 118 | return retval ? retval : buf.actual_profile; |
@@ -127,7 +127,7 @@ static int koneplus_set_actual_profile(struct usb_device *usb_dev, | |||
127 | buf.size = sizeof(struct koneplus_actual_profile); | 127 | buf.size = sizeof(struct koneplus_actual_profile); |
128 | buf.actual_profile = new_profile; | 128 | buf.actual_profile = new_profile; |
129 | 129 | ||
130 | return roccat_common_send_with_status(usb_dev, | 130 | return roccat_common2_send_with_status(usb_dev, |
131 | KONEPLUS_COMMAND_ACTUAL_PROFILE, | 131 | KONEPLUS_COMMAND_ACTUAL_PROFILE, |
132 | &buf, sizeof(struct koneplus_actual_profile)); | 132 | &buf, sizeof(struct koneplus_actual_profile)); |
133 | } | 133 | } |
@@ -149,7 +149,7 @@ static ssize_t koneplus_sysfs_read(struct file *fp, struct kobject *kobj, | |||
149 | return -EINVAL; | 149 | return -EINVAL; |
150 | 150 | ||
151 | mutex_lock(&koneplus->koneplus_lock); | 151 | mutex_lock(&koneplus->koneplus_lock); |
152 | retval = roccat_common_receive(usb_dev, command, buf, real_size); | 152 | retval = roccat_common2_receive(usb_dev, command, buf, real_size); |
153 | mutex_unlock(&koneplus->koneplus_lock); | 153 | mutex_unlock(&koneplus->koneplus_lock); |
154 | 154 | ||
155 | if (retval) | 155 | if (retval) |
@@ -172,7 +172,7 @@ static ssize_t koneplus_sysfs_write(struct file *fp, struct kobject *kobj, | |||
172 | return -EINVAL; | 172 | return -EINVAL; |
173 | 173 | ||
174 | mutex_lock(&koneplus->koneplus_lock); | 174 | mutex_lock(&koneplus->koneplus_lock); |
175 | retval = roccat_common_send_with_status(usb_dev, command, | 175 | retval = roccat_common2_send_with_status(usb_dev, command, |
176 | buf, real_size); | 176 | buf, real_size); |
177 | mutex_unlock(&koneplus->koneplus_lock); | 177 | mutex_unlock(&koneplus->koneplus_lock); |
178 | 178 | ||
diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index c219cff91555..ca6527ac655d 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c | |||
@@ -47,7 +47,7 @@ static int kovaplus_send_control(struct usb_device *usb_dev, uint value, | |||
47 | enum kovaplus_control_requests request) | 47 | enum kovaplus_control_requests request) |
48 | { | 48 | { |
49 | int retval; | 49 | int retval; |
50 | struct roccat_common_control control; | 50 | struct roccat_common2_control control; |
51 | 51 | ||
52 | if ((request == KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS || | 52 | if ((request == KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS || |
53 | request == KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) && | 53 | request == KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) && |
@@ -58,8 +58,8 @@ static int kovaplus_send_control(struct usb_device *usb_dev, uint value, | |||
58 | control.value = value; | 58 | control.value = value; |
59 | control.request = request; | 59 | control.request = request; |
60 | 60 | ||
61 | retval = roccat_common_send(usb_dev, ROCCAT_COMMON_COMMAND_CONTROL, | 61 | retval = roccat_common2_send(usb_dev, ROCCAT_COMMON_COMMAND_CONTROL, |
62 | &control, sizeof(struct roccat_common_control)); | 62 | &control, sizeof(struct roccat_common2_control)); |
63 | 63 | ||
64 | return retval; | 64 | return retval; |
65 | } | 65 | } |
@@ -73,7 +73,7 @@ static int kovaplus_select_profile(struct usb_device *usb_dev, uint number, | |||
73 | static int kovaplus_get_info(struct usb_device *usb_dev, | 73 | static int kovaplus_get_info(struct usb_device *usb_dev, |
74 | struct kovaplus_info *buf) | 74 | struct kovaplus_info *buf) |
75 | { | 75 | { |
76 | return roccat_common_receive(usb_dev, KOVAPLUS_COMMAND_INFO, | 76 | return roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_INFO, |
77 | buf, sizeof(struct kovaplus_info)); | 77 | buf, sizeof(struct kovaplus_info)); |
78 | } | 78 | } |
79 | 79 | ||
@@ -87,14 +87,14 @@ static int kovaplus_get_profile_settings(struct usb_device *usb_dev, | |||
87 | if (retval) | 87 | if (retval) |
88 | return retval; | 88 | return retval; |
89 | 89 | ||
90 | return roccat_common_receive(usb_dev, KOVAPLUS_COMMAND_PROFILE_SETTINGS, | 90 | return roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_PROFILE_SETTINGS, |
91 | buf, sizeof(struct kovaplus_profile_settings)); | 91 | buf, sizeof(struct kovaplus_profile_settings)); |
92 | } | 92 | } |
93 | 93 | ||
94 | static int kovaplus_set_profile_settings(struct usb_device *usb_dev, | 94 | static int kovaplus_set_profile_settings(struct usb_device *usb_dev, |
95 | struct kovaplus_profile_settings const *settings) | 95 | struct kovaplus_profile_settings const *settings) |
96 | { | 96 | { |
97 | return roccat_common_send_with_status(usb_dev, | 97 | return roccat_common2_send_with_status(usb_dev, |
98 | KOVAPLUS_COMMAND_PROFILE_SETTINGS, | 98 | KOVAPLUS_COMMAND_PROFILE_SETTINGS, |
99 | settings, sizeof(struct kovaplus_profile_settings)); | 99 | settings, sizeof(struct kovaplus_profile_settings)); |
100 | } | 100 | } |
@@ -109,14 +109,14 @@ static int kovaplus_get_profile_buttons(struct usb_device *usb_dev, | |||
109 | if (retval) | 109 | if (retval) |
110 | return retval; | 110 | return retval; |
111 | 111 | ||
112 | return roccat_common_receive(usb_dev, KOVAPLUS_COMMAND_PROFILE_BUTTONS, | 112 | return roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_PROFILE_BUTTONS, |
113 | buf, sizeof(struct kovaplus_profile_buttons)); | 113 | buf, sizeof(struct kovaplus_profile_buttons)); |
114 | } | 114 | } |
115 | 115 | ||
116 | static int kovaplus_set_profile_buttons(struct usb_device *usb_dev, | 116 | static int kovaplus_set_profile_buttons(struct usb_device *usb_dev, |
117 | struct kovaplus_profile_buttons const *buttons) | 117 | struct kovaplus_profile_buttons const *buttons) |
118 | { | 118 | { |
119 | return roccat_common_send_with_status(usb_dev, | 119 | return roccat_common2_send_with_status(usb_dev, |
120 | KOVAPLUS_COMMAND_PROFILE_BUTTONS, | 120 | KOVAPLUS_COMMAND_PROFILE_BUTTONS, |
121 | buttons, sizeof(struct kovaplus_profile_buttons)); | 121 | buttons, sizeof(struct kovaplus_profile_buttons)); |
122 | } | 122 | } |
@@ -127,7 +127,7 @@ static int kovaplus_get_actual_profile(struct usb_device *usb_dev) | |||
127 | struct kovaplus_actual_profile buf; | 127 | struct kovaplus_actual_profile buf; |
128 | int retval; | 128 | int retval; |
129 | 129 | ||
130 | retval = roccat_common_receive(usb_dev, KOVAPLUS_COMMAND_ACTUAL_PROFILE, | 130 | retval = roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_ACTUAL_PROFILE, |
131 | &buf, sizeof(struct kovaplus_actual_profile)); | 131 | &buf, sizeof(struct kovaplus_actual_profile)); |
132 | 132 | ||
133 | return retval ? retval : buf.actual_profile; | 133 | return retval ? retval : buf.actual_profile; |
@@ -142,7 +142,7 @@ static int kovaplus_set_actual_profile(struct usb_device *usb_dev, | |||
142 | buf.size = sizeof(struct kovaplus_actual_profile); | 142 | buf.size = sizeof(struct kovaplus_actual_profile); |
143 | buf.actual_profile = new_profile; | 143 | buf.actual_profile = new_profile; |
144 | 144 | ||
145 | return roccat_common_send_with_status(usb_dev, | 145 | return roccat_common2_send_with_status(usb_dev, |
146 | KOVAPLUS_COMMAND_ACTUAL_PROFILE, | 146 | KOVAPLUS_COMMAND_ACTUAL_PROFILE, |
147 | &buf, sizeof(struct kovaplus_actual_profile)); | 147 | &buf, sizeof(struct kovaplus_actual_profile)); |
148 | } | 148 | } |
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index 440cb1bd70d4..1317c177a3e2 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c | |||
@@ -42,7 +42,7 @@ static void profile_activated(struct pyra_device *pyra, | |||
42 | static int pyra_send_control(struct usb_device *usb_dev, int value, | 42 | static int pyra_send_control(struct usb_device *usb_dev, int value, |
43 | enum pyra_control_requests request) | 43 | enum pyra_control_requests request) |
44 | { | 44 | { |
45 | struct roccat_common_control control; | 45 | struct roccat_common2_control control; |
46 | 46 | ||
47 | if ((request == PYRA_CONTROL_REQUEST_PROFILE_SETTINGS || | 47 | if ((request == PYRA_CONTROL_REQUEST_PROFILE_SETTINGS || |
48 | request == PYRA_CONTROL_REQUEST_PROFILE_BUTTONS) && | 48 | request == PYRA_CONTROL_REQUEST_PROFILE_BUTTONS) && |
@@ -53,8 +53,8 @@ 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, ROCCAT_COMMON_COMMAND_CONTROL, | 56 | return roccat_common2_send(usb_dev, ROCCAT_COMMON_COMMAND_CONTROL, |
57 | &control, sizeof(struct roccat_common_control)); | 57 | &control, sizeof(struct roccat_common2_control)); |
58 | } | 58 | } |
59 | 59 | ||
60 | static int pyra_get_profile_settings(struct usb_device *usb_dev, | 60 | static int pyra_get_profile_settings(struct usb_device *usb_dev, |
@@ -65,7 +65,7 @@ static int pyra_get_profile_settings(struct usb_device *usb_dev, | |||
65 | PYRA_CONTROL_REQUEST_PROFILE_SETTINGS); | 65 | PYRA_CONTROL_REQUEST_PROFILE_SETTINGS); |
66 | if (retval) | 66 | if (retval) |
67 | return retval; | 67 | return retval; |
68 | return roccat_common_receive(usb_dev, PYRA_COMMAND_PROFILE_SETTINGS, | 68 | return roccat_common2_receive(usb_dev, PYRA_COMMAND_PROFILE_SETTINGS, |
69 | buf, sizeof(struct pyra_profile_settings)); | 69 | buf, sizeof(struct pyra_profile_settings)); |
70 | } | 70 | } |
71 | 71 | ||
@@ -77,27 +77,27 @@ static int pyra_get_profile_buttons(struct usb_device *usb_dev, | |||
77 | PYRA_CONTROL_REQUEST_PROFILE_BUTTONS); | 77 | PYRA_CONTROL_REQUEST_PROFILE_BUTTONS); |
78 | if (retval) | 78 | if (retval) |
79 | return retval; | 79 | return retval; |
80 | return roccat_common_receive(usb_dev, PYRA_COMMAND_PROFILE_BUTTONS, | 80 | return roccat_common2_receive(usb_dev, PYRA_COMMAND_PROFILE_BUTTONS, |
81 | buf, sizeof(struct pyra_profile_buttons)); | 81 | buf, sizeof(struct pyra_profile_buttons)); |
82 | } | 82 | } |
83 | 83 | ||
84 | static int pyra_get_settings(struct usb_device *usb_dev, | 84 | static int pyra_get_settings(struct usb_device *usb_dev, |
85 | struct pyra_settings *buf) | 85 | struct pyra_settings *buf) |
86 | { | 86 | { |
87 | return roccat_common_receive(usb_dev, PYRA_COMMAND_SETTINGS, | 87 | return roccat_common2_receive(usb_dev, PYRA_COMMAND_SETTINGS, |
88 | buf, sizeof(struct pyra_settings)); | 88 | buf, sizeof(struct pyra_settings)); |
89 | } | 89 | } |
90 | 90 | ||
91 | static int pyra_get_info(struct usb_device *usb_dev, struct pyra_info *buf) | 91 | static int pyra_get_info(struct usb_device *usb_dev, struct pyra_info *buf) |
92 | { | 92 | { |
93 | return roccat_common_receive(usb_dev, PYRA_COMMAND_INFO, | 93 | return roccat_common2_receive(usb_dev, PYRA_COMMAND_INFO, |
94 | buf, sizeof(struct pyra_info)); | 94 | buf, sizeof(struct pyra_info)); |
95 | } | 95 | } |
96 | 96 | ||
97 | static int pyra_set_profile_settings(struct usb_device *usb_dev, | 97 | static int pyra_set_profile_settings(struct usb_device *usb_dev, |
98 | struct pyra_profile_settings const *settings) | 98 | struct pyra_profile_settings const *settings) |
99 | { | 99 | { |
100 | return roccat_common_send_with_status(usb_dev, | 100 | return roccat_common2_send_with_status(usb_dev, |
101 | PYRA_COMMAND_PROFILE_SETTINGS, settings, | 101 | PYRA_COMMAND_PROFILE_SETTINGS, settings, |
102 | sizeof(struct pyra_profile_settings)); | 102 | sizeof(struct pyra_profile_settings)); |
103 | } | 103 | } |
@@ -105,7 +105,7 @@ static int pyra_set_profile_settings(struct usb_device *usb_dev, | |||
105 | static int pyra_set_profile_buttons(struct usb_device *usb_dev, | 105 | static int pyra_set_profile_buttons(struct usb_device *usb_dev, |
106 | struct pyra_profile_buttons const *buttons) | 106 | struct pyra_profile_buttons const *buttons) |
107 | { | 107 | { |
108 | return roccat_common_send_with_status(usb_dev, | 108 | return roccat_common2_send_with_status(usb_dev, |
109 | PYRA_COMMAND_PROFILE_BUTTONS, buttons, | 109 | PYRA_COMMAND_PROFILE_BUTTONS, buttons, |
110 | sizeof(struct pyra_profile_buttons)); | 110 | sizeof(struct pyra_profile_buttons)); |
111 | } | 111 | } |
@@ -113,7 +113,7 @@ static int pyra_set_profile_buttons(struct usb_device *usb_dev, | |||
113 | static int pyra_set_settings(struct usb_device *usb_dev, | 113 | static int pyra_set_settings(struct usb_device *usb_dev, |
114 | struct pyra_settings const *settings) | 114 | struct pyra_settings const *settings) |
115 | { | 115 | { |
116 | return roccat_common_send_with_status(usb_dev, | 116 | return roccat_common2_send_with_status(usb_dev, |
117 | PYRA_COMMAND_SETTINGS, settings, | 117 | PYRA_COMMAND_SETTINGS, settings, |
118 | sizeof(struct pyra_settings)); | 118 | sizeof(struct pyra_settings)); |
119 | } | 119 | } |
diff --git a/drivers/hid/hid-roccat-savu.c b/drivers/hid/hid-roccat-savu.c index 19f9c47fc020..29e87d712de0 100644 --- a/drivers/hid/hid-roccat-savu.c +++ b/drivers/hid/hid-roccat-savu.c | |||
@@ -44,7 +44,7 @@ static ssize_t savu_sysfs_read(struct file *fp, struct kobject *kobj, | |||
44 | return -EINVAL; | 44 | return -EINVAL; |
45 | 45 | ||
46 | mutex_lock(&savu->savu_lock); | 46 | mutex_lock(&savu->savu_lock); |
47 | retval = roccat_common_receive(usb_dev, command, buf, real_size); | 47 | retval = roccat_common2_receive(usb_dev, command, buf, real_size); |
48 | mutex_unlock(&savu->savu_lock); | 48 | mutex_unlock(&savu->savu_lock); |
49 | 49 | ||
50 | return retval ? retval : real_size; | 50 | return retval ? retval : real_size; |
@@ -64,7 +64,7 @@ static ssize_t savu_sysfs_write(struct file *fp, struct kobject *kobj, | |||
64 | return -EINVAL; | 64 | return -EINVAL; |
65 | 65 | ||
66 | mutex_lock(&savu->savu_lock); | 66 | mutex_lock(&savu->savu_lock); |
67 | retval = roccat_common_send_with_status(usb_dev, command, | 67 | retval = roccat_common2_send_with_status(usb_dev, command, |
68 | (void *)buf, real_size); | 68 | (void *)buf, real_size); |
69 | mutex_unlock(&savu->savu_lock); | 69 | mutex_unlock(&savu->savu_lock); |
70 | 70 | ||