24 #include <linux/input.h>
26 #include <linux/hid.h>
62 static int hid_lg3ff_play(
struct input_dev *
dev,
void *
data,
65 struct hid_device *hid = input_get_drvdata(dev);
76 switch (effect->
type) {
82 x = effect->
u.
ramp.start_level;
83 y = effect->
u.
ramp.end_level;
86 report->
field[0]->value[0] = 0x51;
92 report->
field[0]->value[1] = (
unsigned char)(-x);
93 report->
field[0]->value[31] = (
unsigned char)(-y);
100 static void hid_lg3ff_set_autocenter(
struct input_dev *
dev,
u16 magnitude)
102 struct hid_device *hid = input_get_drvdata(dev);
111 report->
field[0]->value[0] = 0x51;
112 report->
field[0]->value[1] = 0x00;
113 report->
field[0]->value[2] = 0x00;
114 report->
field[0]->value[3] = 0x7F;
115 report->
field[0]->value[4] = 0x7F;
116 report->
field[0]->value[31] = 0x00;
117 report->
field[0]->value[32] = 0x00;
118 report->
field[0]->value[33] = 0x7F;
119 report->
field[0]->value[34] = 0x7F;
125 static const signed short ff3_joystick_ac[] = {
135 struct input_dev *
dev = hidinput->
input;
138 const signed short *ff_bits = ff3_joystick_ac;
143 if (list_empty(report_list)) {
144 hid_err(hid,
"No output report found\n");
151 hid_err(hid,
"NULL output report\n");
155 field = report->
field[0];
162 for (i = 0; ff_bits[
i] >= 0; i++)
163 set_bit(ff_bits[i], dev->ffbit);
170 dev->ff->set_autocenter = hid_lg3ff_set_autocenter;