Lines Matching +full:motor +full:- +full:driver

1 // SPDX-License-Identifier: GPL-2.0-or-later
8 * on 2003-01-25 from the Logitech force feedback driver,
23 #include "hid-ids.h"
29 -1
34 -1
52 ret = (in * (maximum - minimum) / 0xffff) + minimum; in tmff_scale_u16()
60 /* Changes values from -0x80 to 0x7f into values from minimum to maximum */
65 ret = (((in + 0x80) * (maximum - minimum)) / 0xff) + minimum; in tmff_scale_s8()
78 struct hid_field *ff_field = tmff->ff_field; in tmff_play()
82 switch (effect->type) { in tmff_play()
84 x = tmff_scale_s8(effect->u.ramp.start_level, in tmff_play()
85 ff_field->logical_minimum, in tmff_play()
86 ff_field->logical_maximum); in tmff_play()
87 y = tmff_scale_s8(effect->u.ramp.end_level, in tmff_play()
88 ff_field->logical_minimum, in tmff_play()
89 ff_field->logical_maximum); in tmff_play()
92 ff_field->value[0] = x; in tmff_play()
93 ff_field->value[1] = y; in tmff_play()
94 hid_hw_request(hid, tmff->report, HID_REQ_SET_REPORT); in tmff_play()
98 left = tmff_scale_u16(effect->u.rumble.weak_magnitude, in tmff_play()
99 ff_field->logical_minimum, in tmff_play()
100 ff_field->logical_maximum); in tmff_play()
101 right = tmff_scale_u16(effect->u.rumble.strong_magnitude, in tmff_play()
102 ff_field->logical_minimum, in tmff_play()
103 ff_field->logical_maximum); in tmff_play()
105 /* 2-in-1 strong motor is left */ in tmff_play()
106 if (hid->product == THRUSTMASTER_DEVICE_ID_2_IN_1_DT) in tmff_play()
110 ff_field->value[0] = left; in tmff_play()
111 ff_field->value[1] = right; in tmff_play()
112 hid_hw_request(hid, tmff->report, HID_REQ_SET_REPORT); in tmff_play()
128 if (list_empty(&hid->inputs)) { in tmff_init()
130 return -ENODEV; in tmff_init()
132 hidinput = list_entry(hid->inputs.next, struct hid_input, list); in tmff_init()
133 input_dev = hidinput->input; in tmff_init()
137 return -ENOMEM; in tmff_init()
140 report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in tmff_init()
144 for (fieldnum = 0; fieldnum < report->maxfield; ++fieldnum) { in tmff_init()
145 struct hid_field *field = report->field[fieldnum]; in tmff_init()
147 if (field->maxusage <= 0) in tmff_init()
150 switch (field->usage[0].hid) { in tmff_init()
152 if (field->report_count < 2) { in tmff_init()
157 if (field->logical_maximum == in tmff_init()
158 field->logical_minimum) { in tmff_init()
163 if (tmff->report && tmff->report != report) { in tmff_init()
168 if (tmff->ff_field && tmff->ff_field != field) { in tmff_init()
173 tmff->report = report; in tmff_init()
174 tmff->ff_field = field; in tmff_init()
177 set_bit(ff_bits[i], input_dev->ffbit); in tmff_init()
183 field->usage[0].hid); in tmff_init()
189 if (!tmff->report) { in tmff_init()
191 error = -ENODEV; in tmff_init()
229 tmff_init(hdev, (void *)id->driver_data); in tm_probe()
241 …B_DEVICE(USB_VENDOR_ID_THRUSTMASTER, THRUSTMASTER_DEVICE_ID_2_IN_1_DT), /* Dual Trigger 2-in-1 */
243 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */
245 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324), /* Dual Trigger 3-in-1 (PS3 Mode) */