24 #include <linux/input.h>
25 #include <linux/slab.h>
27 #include <linux/hid.h>
36 static int play_effect(
struct input_dev *
dev,
void *
data,
39 struct hid_device *hid = input_get_drvdata(dev);
43 strong = effect->
u.
rumble.strong_magnitude;
44 weak = effect->
u.
rumble.weak_magnitude;
47 weak = weak * 0xff / 0xffff;
48 strong = strong * 0xff / 0xffff;
50 lg2ff->
report->field[0]->value[0] = 0x51;
51 lg2ff->
report->field[0]->value[2] = weak;
52 lg2ff->
report->field[0]->value[4] = strong;
54 lg2ff->
report->field[0]->value[0] = 0xf3;
55 lg2ff->
report->field[0]->value[2] = 0x00;
56 lg2ff->
report->field[0]->value[4] = 0x00;
71 struct input_dev *
dev = hidinput->
input;
74 if (list_empty(report_list)) {
75 hid_err(hid,
"no output report found\n");
82 hid_err(hid,
"output report is empty\n");
85 if (report->
field[0]->report_count < 7) {
86 hid_err(hid,
"not enough values in the field\n");
103 report->
field[0]->value[0] = 0xf3;
104 report->
field[0]->value[1] = 0x00;
105 report->
field[0]->value[2] = 0x00;
106 report->
field[0]->value[3] = 0x00;
107 report->
field[0]->value[4] = 0x00;
108 report->
field[0]->value[5] = 0x00;
109 report->
field[0]->value[6] = 0x00;