summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-roccat-common.c
diff options
context:
space:
mode:
authorStefan Achatz <erazor_de@users.sourceforge.net>2012-05-20 22:45:04 +0200
committerJiri Kosina <jkosina@suse.cz>2012-06-28 10:34:01 +0200
commit7392d73be2b3c907d65126f072c313215e1907b3 (patch)
treea10a80d29a8f17e1e330e4b50db48aff468e9c3c /drivers/hid/hid-roccat-common.c
parent4ec141ad4e470485803a98ddb250aa7df030e8df (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/hid-roccat-common.c')
-rw-r--r--drivers/hid/hid-roccat-common.c34
1 files changed, 17 insertions, 17 deletions
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 @@
#include <linux/module.h>
#include "hid-roccat-common.h"
-static inline uint16_t roccat_common_feature_report(uint8_t report_id)
+static inline uint16_t roccat_common2_feature_report(uint8_t report_id)
{
return 0x300 | report_id;
}
-int roccat_common_receive(struct usb_device *usb_dev, uint report_id,
+int roccat_common2_receive(struct usb_device *usb_dev, uint report_id,
void *data, uint size)
{
char *buf;
@@ -34,16 +34,16 @@ int roccat_common_receive(struct usb_device *usb_dev, uint report_id,
len = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0),
HID_REQ_GET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
- roccat_common_feature_report(report_id),
+ roccat_common2_feature_report(report_id),
0, buf, size, USB_CTRL_SET_TIMEOUT);
memcpy(data, buf, size);
kfree(buf);
return ((len < 0) ? len : ((len != size) ? -EIO : 0));
}
-EXPORT_SYMBOL_GPL(roccat_common_receive);
+EXPORT_SYMBOL_GPL(roccat_common2_receive);
-int roccat_common_send(struct usb_device *usb_dev, uint report_id,
+int roccat_common2_send(struct usb_device *usb_dev, uint report_id,
void const *data, uint size)
{
char *buf;
@@ -56,31 +56,31 @@ int roccat_common_send(struct usb_device *usb_dev, uint report_id,
len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0),
HID_REQ_SET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT,
- roccat_common_feature_report(report_id),
+ roccat_common2_feature_report(report_id),
0, buf, size, USB_CTRL_SET_TIMEOUT);
kfree(buf);
return ((len < 0) ? len : ((len != size) ? -EIO : 0));
}
-EXPORT_SYMBOL_GPL(roccat_common_send);
+EXPORT_SYMBOL_GPL(roccat_common2_send);
-enum roccat_common_control_states {
+enum roccat_common2_control_states {
ROCCAT_COMMON_CONTROL_STATUS_OVERLOAD = 0,
ROCCAT_COMMON_CONTROL_STATUS_OK = 1,
ROCCAT_COMMON_CONTROL_STATUS_INVALID = 2,
ROCCAT_COMMON_CONTROL_STATUS_WAIT = 3,
};
-static int roccat_common_receive_control_status(struct usb_device *usb_dev)
+static int roccat_common2_receive_control_status(struct usb_device *usb_dev)
{
int retval;
- struct roccat_common_control control;
+ struct roccat_common2_control control;
do {
msleep(50);
- retval = roccat_common_receive(usb_dev,
+ retval = roccat_common2_receive(usb_dev,
ROCCAT_COMMON_COMMAND_CONTROL,
- &control, sizeof(struct roccat_common_control));
+ &control, sizeof(struct roccat_common2_control));
if (retval)
return retval;
@@ -98,7 +98,7 @@ static int roccat_common_receive_control_status(struct usb_device *usb_dev)
return -EINVAL;
default:
dev_err(&usb_dev->dev,
- "roccat_common_receive_control_status: "
+ "roccat_common2_receive_control_status: "
"unknown response value 0x%x\n",
control.value);
return -EINVAL;
@@ -107,20 +107,20 @@ static int roccat_common_receive_control_status(struct usb_device *usb_dev)
} while (1);
}
-int roccat_common_send_with_status(struct usb_device *usb_dev,
+int roccat_common2_send_with_status(struct usb_device *usb_dev,
uint command, void const *buf, uint size)
{
int retval;
- retval = roccat_common_send(usb_dev, command, buf, size);
+ retval = roccat_common2_send(usb_dev, command, buf, size);
if (retval)
return retval;
msleep(100);
- return roccat_common_receive_control_status(usb_dev);
+ return roccat_common2_receive_control_status(usb_dev);
}
-EXPORT_SYMBOL_GPL(roccat_common_send_with_status);
+EXPORT_SYMBOL_GPL(roccat_common2_send_with_status);
MODULE_AUTHOR("Stefan Achatz");
MODULE_DESCRIPTION("USB Roccat common driver");