@@ -25,6 +25,11 @@ ifdef CONFIG_LOGIWII_FF
hid-logitech-objs += hid-lg4ff.o
endif
+hid-dragonrise-objs := hid-dr.o
+ifdef CONFIG_DRAGONRISE_FF
+ hid-dragonrise-objs += hid-drff.o
+endif
+
obj-$(CONFIG_HID_3M_PCT) += hid-3m-pct.o
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
obj-$(CONFIG_HID_ACRUX_FF) += hid-axff.o
@@ -34,7 +39,7 @@ obj-$(CONFIG_HID_CANDO) += hid-cando.o
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
-obj-$(CONFIG_HID_DRAGONRISE) += hid-drff.o
+obj-$(CONFIG_HID_DRAGONRISE) += hid-dragonrise.o
obj-$(CONFIG_HID_EGALAX) += hid-egalax.o
obj-$(CONFIG_HID_ELECOM) += hid-elecom.o
obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
new file mode 100644
@@ -0,0 +1,71 @@
+/*
+ * HID driver for DragonRise Inc. devices not fully compliant with HID standard
+ *
+ * Copyright (c) 2010 Nikolai Kondrashov <spbnick@gmail.com>
+ * Copyright (c) 2009 Richard Walmsley <richwalm@gmail.com>
+ */
+
+/*
+ * 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/input.h>
+#include <linux/usb.h>
+#include <linux/hid.h>
+
+#include "hid-ids.h"
+#include "hid-dr.h"
+
+static int dr_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+ int ret;
+
+ dev_dbg(&hdev->dev, "DragonRise Inc. HID hardware probe...");
+
+ ret = hid_parse(hdev);
+ if (ret) {
+ dev_err(&hdev->dev, "parse failed\n");
+ goto err;
+ }
+
+ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
+ if (ret) {
+ dev_err(&hdev->dev, "hw start failed\n");
+ goto err;
+ }
+
+ drff_init(hdev);
+
+ return 0;
+err:
+ return ret;
+}
+
+static const struct hid_device_id dr_devices[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006), },
+ { }
+};
+MODULE_DEVICE_TABLE(hid, dr_devices);
+
+static struct hid_driver dr_driver = {
+ .name = "dragonrise",
+ .id_table = dr_devices,
+ .probe = dr_probe,
+};
+
+static int __init dr_init(void)
+{
+ return hid_register_driver(&dr_driver);
+}
+
+static void __exit dr_exit(void)
+{
+ hid_unregister_driver(&dr_driver);
+}
+
+module_init(dr_init);
+module_exit(dr_exit);
+MODULE_LICENSE("GPL");
new file mode 100644
@@ -0,0 +1,13 @@
+#ifndef __HID_DR_H
+#define __HID_DR_H
+
+#ifdef CONFIG_DRAGONRISE_FF
+extern int drff_init(struct hid_device *hid);
+#else
+static inline int drff_init(struct hid_device *hid)
+{
+ return 0;
+}
+#endif
+
+#endif
@@ -32,10 +32,8 @@
#include <linux/usb.h>
#include <linux/hid.h>
-#include "hid-ids.h"
-
-#ifdef CONFIG_DRAGONRISE_FF
#include "usbhid/usbhid.h"
+#include "hid-dr.h"
struct drff_device {
struct hid_report *report;
@@ -84,7 +82,7 @@ static int drff_play(struct input_dev *dev, void *data,
return 0;
}
-static int drff_init(struct hid_device *hid)
+int drff_init(struct hid_device *hid)
{
struct drff_device *drff;
struct hid_report *report;
@@ -138,60 +136,3 @@ static int drff_init(struct hid_device *hid)
return 0;
}
-#else
-static inline int drff_init(struct hid_device *hid)
-{
- return 0;
-}
-#endif
-
-static int dr_probe(struct hid_device *hdev, const struct hid_device_id *id)
-{
- int ret;
-
- dev_dbg(&hdev->dev, "DragonRise Inc. HID hardware probe...");
-
- ret = hid_parse(hdev);
- if (ret) {
- dev_err(&hdev->dev, "parse failed\n");
- goto err;
- }
-
- ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
- if (ret) {
- dev_err(&hdev->dev, "hw start failed\n");
- goto err;
- }
-
- drff_init(hdev);
-
- return 0;
-err:
- return ret;
-}
-
-static const struct hid_device_id dr_devices[] = {
- { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006), },
- { }
-};
-MODULE_DEVICE_TABLE(hid, dr_devices);
-
-static struct hid_driver dr_driver = {
- .name = "dragonrise",
- .id_table = dr_devices,
- .probe = dr_probe,
-};
-
-static int __init dr_init(void)
-{
- return hid_register_driver(&dr_driver);
-}
-
-static void __exit dr_exit(void)
-{
- hid_unregister_driver(&dr_driver);
-}
-
-module_init(dr_init);
-module_exit(dr_exit);
-MODULE_LICENSE("GPL");