Skip to contentSkip to conversation

HID: roccat: Introduced module hid-roccat-common

PATCH Applied Stefan Achatz 1 participant 1 message Jan 30, 2011

Subsystems (2)
lore
Share & tools
lore

Stefan Achatz

author maintainer
#0 lore raw

PATCH 3/8 HID: roccat: Introduced module hid-roccat-common

Module hid-roccat-common contains functions used by roccat device driver modules to reduce code duplication.
At the moment it contains just two wrapper methods for usb_control_msg that ensure that the buffer used for transfer is dma capable which wasn't the case before.
The kconfig option is not visible to the user but will be selected by the device specific drivers.

---
 drivers/hid/Kconfig               |    7 ++
 drivers/hid/Makefile              |    1 +
 drivers/hid/hid-roccat-arvo.c     |  148 ++++++++++------------------------
 drivers/hid/hid-roccat-common.c   |   62 ++++++++++++++
 drivers/hid/hid-roccat-common.h   |   23 +++++
 drivers/hid/hid-roccat-kone.c     |  143 +++++++++------------------------
 drivers/hid/hid-roccat-koneplus.c |  135 +++++++++----------------------
 drivers/hid/hid-roccat-pyra.c     |  161 ++++++++++---------------------------
 8 files changed, 254 insertions(+), 426 deletions(-)
 create mode 100644 drivers/hid/hid-roccat-common.c
 create mode 100644 drivers/hid/hid-roccat-common.h
drivers/hid/Kconfig +7 -0
index 539865a..7952369 100644
@@ -417,10 +417,14 @@ config HID_ROCCAT
 	Say Y here if you have a Roccat mouse or keyboard and want OSD or
 	macro execution support.
 
+config HID_ROCCAT_COMMON
+	tristate
+
 config HID_ROCCAT_ARVO
 	tristate "Roccat Arvo keyboard support"
 	depends on USB_HID
 	select HID_ROCCAT
+	select HID_ROCCAT_COMMON
 	---help---
 	Support for Roccat Arvo keyboard.
 
@@ -428,6 +432,7 @@ config HID_ROCCAT_KONE
 	tristate "Roccat Kone Mouse support"
 	depends on USB_HID
 	select HID_ROCCAT
+	select HID_ROCCAT_COMMON
 	---help---
 	Support for Roccat Kone mouse.
 
@@ -435,6 +440,7 @@ config HID_ROCCAT_KONEPLUS
 	tristate "Roccat Kone[+] mouse support"
 	depends on USB_HID
 	select HID_ROCCAT
+	select HID_ROCCAT_COMMON
 	---help---
 	Support for Roccat Kone[+] mouse.
 
@@ -442,6 +448,7 @@ config HID_ROCCAT_PYRA
 	tristate "Roccat Pyra mouse support"
 	depends on USB_HID
 	select HID_ROCCAT
+	select HID_ROCCAT_COMMON
 	---help---
 	Support for Roccat Pyra mouse.
 
drivers/hid/Makefile +1 -0
index fea4eb8..086cf62 100644
@@ -56,6 +56,7 @@ obj-$(CONFIG_HID_PANTHERLORD)	+= hid-pl.o
 obj-$(CONFIG_HID_PETALYNX)	+= hid-petalynx.o
 obj-$(CONFIG_HID_PICOLCD)	+= hid-picolcd.o
 obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o
+obj-$(CONFIG_HID_ROCCAT_COMMON)	+= hid-roccat-common.o
 obj-$(CONFIG_HID_ROCCAT_ARVO)	+= hid-roccat-arvo.o
 obj-$(CONFIG_HID_ROCCAT_KONE)	+= hid-roccat-kone.o
 obj-$(CONFIG_HID_ROCCAT_KONEPLUS)	+= hid-roccat-koneplus.o
drivers/hid/hid-roccat-arvo.c +41 -107

260 lines not on this page · raw message

drivers/hid/hid-roccat-common.c new file +62 -0

62 lines not on this page · raw message

drivers/hid/hid-roccat-common.h new file +23 -0
new file mode 100644
index 0000000..fe45fae
@@ -0,0 +1,23 @@
+#ifndef __HID_ROCCAT_COMMON_H
+#define __HID_ROCCAT_COMMON_H
+
+/*
+ * Copyright (c) 2011 Stefan Achatz <[email protected]>
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <linux/usb.h>
+#include <linux/types.h>
+
+int roccat_common_receive(struct usb_device *usb_dev, uint usb_command,
+		void *data, uint size);
+int roccat_common_send(struct usb_device *usb_dev, uint usb_command,
+		void const *data, uint size);
+
+#endif
drivers/hid/hid-roccat-kone.c +38 -105

218 lines not on this page · raw message

drivers/hid/hid-roccat-koneplus.c +39 -96

252 lines not on this page · raw message

drivers/hid/hid-roccat-pyra.c +43 -118

254 lines not on this page · raw message

Signature · 1 line
1.7.3.4