Lines Matching +full:report +full:- +full:error
1 // SPDX-License-Identifier: GPL-2.0-or-later
15 #include "hid-lg.h"
21 * 0 - seems to be command field
22 * 1 - 30 deal with the x axis
23 * 31 -60 deal with the y axis
36 * -127 0 -127 -127 makes the joystick loose on the left,
39 * 0 0 -127 -127 makes the joystick rattle very hard
45 struct hid_report *report; member
52 struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in hid_lg3ff_play()
53 struct hid_report *report = list_entry(report_list->next, struct hid_report, list); in hid_lg3ff_play() local
60 memset(report->field[0]->value, 0, in hid_lg3ff_play()
61 sizeof(__s32) * report->field[0]->report_count); in hid_lg3ff_play()
63 switch (effect->type) { in hid_lg3ff_play()
69 x = effect->u.ramp.start_level; in hid_lg3ff_play()
70 y = effect->u.ramp.end_level; in hid_lg3ff_play()
73 report->field[0]->value[0] = 0x51; in hid_lg3ff_play()
79 report->field[0]->value[1] = (unsigned char)(-x); in hid_lg3ff_play()
80 report->field[0]->value[31] = (unsigned char)(-y); in hid_lg3ff_play()
82 hid_hw_request(hid, report, HID_REQ_SET_REPORT); in hid_lg3ff_play()
90 struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; in hid_lg3ff_set_autocenter()
91 struct hid_report *report = list_entry(report_list->next, struct hid_report, list); in hid_lg3ff_set_autocenter() local
98 report->field[0]->value[0] = 0x51; in hid_lg3ff_set_autocenter()
99 report->field[0]->value[1] = 0x00; in hid_lg3ff_set_autocenter()
100 report->field[0]->value[2] = 0x00; in hid_lg3ff_set_autocenter()
101 report->field[0]->value[3] = 0x7F; in hid_lg3ff_set_autocenter()
102 report->field[0]->value[4] = 0x7F; in hid_lg3ff_set_autocenter()
103 report->field[0]->value[31] = 0x00; in hid_lg3ff_set_autocenter()
104 report->field[0]->value[32] = 0x00; in hid_lg3ff_set_autocenter()
105 report->field[0]->value[33] = 0x7F; in hid_lg3ff_set_autocenter()
106 report->field[0]->value[34] = 0x7F; in hid_lg3ff_set_autocenter()
108 hid_hw_request(hid, report, HID_REQ_SET_REPORT); in hid_lg3ff_set_autocenter()
115 -1
123 int error; in lg3ff_init() local
126 if (list_empty(&hid->inputs)) { in lg3ff_init()
128 return -ENODEV; in lg3ff_init()
130 hidinput = list_entry(hid->inputs.next, struct hid_input, list); in lg3ff_init()
131 dev = hidinput->input; in lg3ff_init()
133 /* Check that the report looks ok */ in lg3ff_init()
135 return -ENODEV; in lg3ff_init()
139 set_bit(ff_bits[i], dev->ffbit); in lg3ff_init()
141 error = input_ff_create_memless(dev, NULL, hid_lg3ff_play); in lg3ff_init()
142 if (error) in lg3ff_init()
143 return error; in lg3ff_init()
145 if (test_bit(FF_AUTOCENTER, dev->ffbit)) in lg3ff_init()
146 dev->ff->set_autocenter = hid_lg3ff_set_autocenter; in lg3ff_init()