24 #include <linux/hid.h>
25 #include <linux/input.h>
27 #include <linux/module.h>
36 static int emsff_play(
struct input_dev *
dev,
void *
data,
39 struct hid_device *hid = input_get_drvdata(dev);
43 weak = effect->
u.
rumble.weak_magnitude;
44 strong = effect->
u.
rumble.strong_magnitude;
46 dbg_hid(
"called with 0x%04x 0x%04x\n", strong, weak);
48 weak = weak * 0xff / 0xffff;
49 strong = strong * 0xff / 0xffff;
51 emsff->
report->field[0]->value[1] = weak;
52 emsff->
report->field[0]->value[2] = strong;
54 dbg_hid(
"running with 0x%02x 0x%02x\n", strong, weak);
68 struct input_dev *
dev = hidinput->
input;
71 if (list_empty(report_list)) {
72 hid_err(hid,
"no output reports found\n");
78 hid_err(hid,
"no fields in the report\n");
82 if (report->
field[0]->report_count < 7) {
83 hid_err(hid,
"not enough values in the field\n");
100 emsff->
report->field[0]->value[0] = 0x01;
101 emsff->
report->field[0]->value[1] = 0x00;
102 emsff->
report->field[0]->value[2] = 0x00;
103 emsff->
report->field[0]->value[3] = 0x00;
104 emsff->
report->field[0]->value[4] = 0x00;
105 emsff->
report->field[0]->value[5] = 0x00;
106 emsff->
report->field[0]->value[6] = 0x00;
118 ret = hid_parse(hdev);
120 hid_err(hdev,
"parse failed\n");
126 hid_err(hdev,
"hw start failed\n");
130 ret = emsff_init(hdev);
132 dev_err(&hdev->
dev,
"force feedback init failed\n");
150 .id_table = ems_devices,
154 static int ems_init(
void)
159 static void ems_exit(
void)