30 #include <linux/input.h>
31 #include <linux/slab.h>
33 #include <linux/hid.h>
34 #include <linux/module.h>
38 #ifdef CONFIG_DRAGONRISE_FF
45 static int drff_play(
struct input_dev *
dev,
void *
data,
48 struct hid_device *hid = input_get_drvdata(dev);
49 struct drff_device *drff =
data;
52 strong = effect->
u.
rumble.strong_magnitude;
53 weak = effect->
u.
rumble.weak_magnitude;
55 dbg_hid(
"called with 0x%04x 0x%04x", strong, weak);
58 strong = strong * 0xff / 0xffff;
59 weak = weak * 0xff / 0xffff;
67 drff->report->field[0]->value[0] = 0x51;
68 drff->report->field[0]->value[1] = 0x00;
69 drff->report->field[0]->value[2] = weak;
70 drff->report->field[0]->value[4] = strong;
73 drff->report->field[0]->value[0] = 0xfa;
74 drff->report->field[0]->value[1] = 0xfe;
76 drff->report->field[0]->value[0] = 0xf3;
77 drff->report->field[0]->value[1] = 0x00;
80 drff->report->field[0]->value[2] = 0x00;
81 drff->report->field[0]->value[4] = 0x00;
82 dbg_hid(
"running with 0x%02x 0x%02x", strong, weak);
90 struct drff_device *drff;
96 struct input_dev *dev = hidinput->
input;
99 if (list_empty(report_list)) {
100 hid_err(hid,
"no output reports found\n");
106 hid_err(hid,
"no fields in the report\n");
110 if (report->
field[0]->report_count < 7) {
111 hid_err(hid,
"not enough values in the field\n");
115 drff = kzalloc(
sizeof(
struct drff_device),
GFP_KERNEL);
128 drff->report->field[0]->value[0] = 0xf3;
129 drff->report->field[0]->value[1] = 0x00;
130 drff->report->field[0]->value[2] = 0x00;
131 drff->report->field[0]->value[3] = 0x00;
132 drff->report->field[0]->value[4] = 0x00;
133 drff->report->field[0]->value[5] = 0x00;
134 drff->report->field[0]->value[6] = 0x00;
137 hid_info(hid,
"Force Feedback for DragonRise Inc. "
143 static inline int drff_init(
struct hid_device *hid)
207 #define PID0011_RDESC_ORIG_SIZE 101
210 static __u8 pid0011_rdesc_fixed[] = {
245 rdesc = pid0011_rdesc_fixed;
246 *rsize =
sizeof(pid0011_rdesc_fixed);
257 dev_dbg(&hdev->
dev,
"DragonRise Inc. HID hardware probe...");
259 ret = hid_parse(hdev);
261 hid_err(hdev,
"parse failed\n");
267 hid_err(hdev,
"hw start failed\n");
273 ret = drff_init(hdev);
275 dev_err(&hdev->
dev,
"force feedback init failed\n");
295 .name =
"dragonrise",
296 .id_table = dr_devices,
297 .report_fixup = dr_report_fixup,
301 static int __init dr_init(
void)
306 static void __exit dr_exit(
void)