Lines Matching +full:signed +full:- +full:by
2 * Force feedback support for hid-compliant for some of the devices from
4 * - WingMan Cordless RumblePad
5 * - WingMan Force 3D
7 * Copyright (c) 2002-2004 Johann Deneux
13 * it under the terms of the GNU General Public License as published by
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * Should you need to contact me, the author, you can do so by
27 * e-mail - mail your message to <johann.deneux@it.uu.se>
37 #include "hid-lg.h"
42 const signed short *ff;
45 static const signed short ff_rumble[] = {
47 -1
50 static const signed short ff_joystick[] = {
52 -1
55 static const signed short ff_joystick_ac[] = {
58 -1
74 struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in hid_lgff_play()
75 struct hid_report *report = list_entry(report_list->next, struct hid_report, list); in hid_lgff_play()
81 switch (effect->type) { in hid_lgff_play()
83 x = effect->u.ramp.start_level + 0x7f; /* 0x7f is center */ in hid_lgff_play()
84 y = effect->u.ramp.end_level + 0x7f; in hid_lgff_play()
87 report->field[0]->value[0] = 0x51; in hid_lgff_play()
88 report->field[0]->value[1] = 0x08; in hid_lgff_play()
89 report->field[0]->value[2] = x; in hid_lgff_play()
90 report->field[0]->value[3] = y; in hid_lgff_play()
96 right = effect->u.rumble.strong_magnitude; in hid_lgff_play()
97 left = effect->u.rumble.weak_magnitude; in hid_lgff_play()
102 report->field[0]->value[0] = 0x42; in hid_lgff_play()
103 report->field[0]->value[1] = 0x00; in hid_lgff_play()
104 report->field[0]->value[2] = left; in hid_lgff_play()
105 report->field[0]->value[3] = right; in hid_lgff_play()
116 struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in hid_lgff_set_autocenter()
117 struct hid_report *report = list_entry(report_list->next, struct hid_report, list); in hid_lgff_set_autocenter()
118 __s32 *value = report->field[0]->value; in hid_lgff_set_autocenter()
123 *value++ = magnitude; /* counter-clockwise strength */ in hid_lgff_set_autocenter()
132 struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); in lgff_init()
133 struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in lgff_init()
134 struct input_dev *dev = hidinput->input; in lgff_init()
137 const signed short *ff_bits = ff_joystick; in lgff_init()
144 return -1; in lgff_init()
148 report = list_entry(report_list->next, struct hid_report, list); in lgff_init()
149 field = report->field[0]; in lgff_init()
152 return -1; in lgff_init()
156 if (dev->id.vendor == devices[i].idVendor && in lgff_init()
157 dev->id.product == devices[i].idProduct) { in lgff_init()
164 set_bit(ff_bits[i], dev->ffbit); in lgff_init()
170 if ( test_bit(FF_AUTOCENTER, dev->ffbit) ) in lgff_init()
171 dev->ff->set_autocenter = hid_lgff_set_autocenter; in lgff_init()
173 …pr_info("Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.… in lgff_init()