Lines Matching +full:report +full:- +full:error
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
43 struct hid_report *report; member
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()
83 switch (effect->type) { in tmff_play()
85 x = tmff_scale_s8(effect->u.ramp.start_level, in tmff_play()
86 ff_field->logical_minimum, in tmff_play()
87 ff_field->logical_maximum); in tmff_play()
88 y = tmff_scale_s8(effect->u.ramp.end_level, in tmff_play()
89 ff_field->logical_minimum, in tmff_play()
90 ff_field->logical_maximum); in tmff_play()
93 ff_field->value[0] = x; in tmff_play()
94 ff_field->value[1] = y; in tmff_play()
95 hid_hw_request(hid, tmff->report, HID_REQ_SET_REPORT); in tmff_play()
99 left = tmff_scale_u16(effect->u.rumble.weak_magnitude, in tmff_play()
100 ff_field->logical_minimum, in tmff_play()
101 ff_field->logical_maximum); in tmff_play()
102 right = tmff_scale_u16(effect->u.rumble.strong_magnitude, in tmff_play()
103 ff_field->logical_minimum, in tmff_play()
104 ff_field->logical_maximum); in tmff_play()
106 /* 2-in-1 strong motor is left */ in tmff_play()
107 if (hid->product == THRUSTMASTER_DEVICE_ID_2_IN_1_DT) { in tmff_play()
114 ff_field->value[0] = left; in tmff_play()
115 ff_field->value[1] = right; in tmff_play()
116 hid_hw_request(hid, tmff->report, HID_REQ_SET_REPORT); in tmff_play()
125 struct hid_report *report; in tmff_init() local
129 int error; in tmff_init() local
132 if (list_empty(&hid->inputs)) { in tmff_init()
134 return -ENODEV; in tmff_init()
136 hidinput = list_entry(hid->inputs.next, struct hid_input, list); in tmff_init()
137 input_dev = hidinput->input; in tmff_init()
141 return -ENOMEM; in tmff_init()
143 /* Find the report to use */ in tmff_init()
144 report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in tmff_init()
145 list_for_each_entry(report, report_list, list) { in tmff_init()
148 for (fieldnum = 0; fieldnum < report->maxfield; ++fieldnum) { in tmff_init()
149 struct hid_field *field = report->field[fieldnum]; in tmff_init()
151 if (field->maxusage <= 0) in tmff_init()
154 switch (field->usage[0].hid) { in tmff_init()
156 if (field->report_count < 2) { in tmff_init()
161 if (field->logical_maximum == in tmff_init()
162 field->logical_minimum) { in tmff_init()
167 if (tmff->report && tmff->report != report) { in tmff_init()
168 hid_warn(hid, "ignoring FF field in other report\n"); in tmff_init()
172 if (tmff->ff_field && tmff->ff_field != field) { in tmff_init()
177 tmff->report = report; in tmff_init()
178 tmff->ff_field = field; in tmff_init()
181 set_bit(ff_bits[i], input_dev->ffbit); in tmff_init()
187 field->usage[0].hid); in tmff_init()
193 if (!tmff->report) { in tmff_init()
195 error = -ENODEV; in tmff_init()
199 error = input_ff_create_memless(input_dev, tmff, tmff_play); in tmff_init()
200 if (error) in tmff_init()
208 return error; in tmff_init()
233 tmff_init(hdev, (void *)id->driver_data); in tm_probe()
245 …B_DEVICE(USB_VENDOR_ID_THRUSTMASTER, THRUSTMASTER_DEVICE_ID_2_IN_1_DT), /* Dual Trigger 2-in-1 */
247 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */
249 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324), /* Dual Trigger 3-in-1 (PS3 Mode) */