Lines Matching defs:field

109 				for (j = 0; j < report->field[i]->maxusage; j++) {
110 usage = report->field[i]->usage + j;
198 * @field: the HID report field to calculate resolution for
211 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
213 __s32 unit_exponent = field->unit_exponent;
214 __s32 logical_extents = field->logical_maximum -
215 field->logical_minimum;
216 __s32 physical_extents = field->physical_maximum -
217 field->physical_minimum;
238 if (field->unit == 0x11) { /* If centimeters */
241 } else if (field->unit == 0x13) { /* If inches */
258 if (field->unit == 0x14) { /* If degrees */
265 } else if (field->unit != 0x12) { /* If not radians */
392 static bool hidinput_setup_battery(struct hid_device *dev, unsigned report_type, struct hid_field *field)
399 if (field->usage->hid != HID_DC_BATTERYSTRENGTH)
420 min = field->logical_minimum;
421 max = field->logical_maximum;
434 dev->battery_report_id = field->report->id;
460 struct hid_field *field)
470 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
478 field->hidinput = hidinput;
480 if (field->flags & HID_MAIN_ITEM_CONSTANT)
484 if (field->report_count < 1)
488 if (field->report_type == HID_OUTPUT_REPORT &&
494 int ret = device->driver->input_mapping(device, hidinput, field,
520 switch (field->application) {
536 switch (field->physical) {
590 if (field->dpad) {
591 map_abs(field->dpad);
602 if (field->flags & HID_MAIN_ITEM_RELATIVE)
609 if (field->flags & HID_MAIN_ITEM_RELATIVE)
616 usage->hat_min = field->logical_minimum;
617 usage->hat_max = field->logical_maximum;
662 switch (field->physical & 0xff) {
880 if (hidinput_setup_battery(device, HID_INPUT_REPORT, field))
933 if (field->report_size == 1) {
934 if (field->report->type == HID_OUTPUT_REPORT) {
941 if (field->flags & HID_MAIN_ITEM_RELATIVE) {
951 hidinput, field, usage, &bit, &max) < 0)
965 int a = field->logical_minimum;
966 int b = field->logical_maximum;
969 a = field->logical_minimum = 0;
970 b = field->logical_maximum = 255;
973 if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK)
978 hidinput_calc_abs_res(field, usage->code));
992 if (usage->hat_dir && !field->dpad)
993 field->dpad = usage->code;
1000 if ((usage->type == EV_ABS) && (field->flags & HID_MAIN_ITEM_RELATIVE) &&
1016 void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
1021 if (!field->hidinput)
1024 input = field->hidinput->input;
1055 int a = field->logical_minimum;
1056 int b = field->logical_maximum;
1073 if ((usage->type == EV_ABS) && (field->flags & HID_MAIN_ITEM_RELATIVE) &&
1096 if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
1097 (field->logical_minimum < field->logical_maximum) &&
1098 (value < field->logical_minimum ||
1099 value > field->logical_maximum)) {
1110 if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))
1126 int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field)
1133 *field = report->field[i];
1134 for (j = 0; j < (*field)->maxusage; j++)
1135 if ((*field)->usage[j].type == type && (*field)->usage[j].code == code)
1146 struct hid_field *field;
1153 field = report->field[i];
1154 for (j = 0; j < field->maxusage; j++)
1155 if (field->usage[j].type == EV_LED)
1156 return field;
1166 struct hid_field *field;
1174 field = report->field[i];
1175 for (j = 0; j < field->maxusage; j++)
1176 if (field->usage[j].type == EV_LED &&
1177 field->value[j])
1189 struct hid_field *field;
1194 field = hidinput_get_led_field(hid);
1195 if (!field)
1199 * field->report is accessed unlocked regarding HID core. So there might
1204 * field (even garbage). So the remote device will always get a valid
1211 report = field->report;
1236 struct hid_field *field;
1245 if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) {
1246 hid_warn(dev, "event field not found\n");
1250 hid_set_field(field, offset, value);
1281 if (rep->field[i]->report_count < 1)
1284 for (j = 0; j < rep->field[i]->maxusage; j++) {
1286 hidinput_setup_battery(hid, HID_FEATURE_REPORT, rep->field[i]);
1289 drv->feature_mapping(hid, rep->field[i],
1290 rep->field[i]->usage + j);
1380 if (report->field[i]->hidinput == hidinput)
1381 report->field[i]->hidinput = NULL;
1391 * Read all reports and initialize the absolute field values.
1436 for (j = 0; j < report->field[i]->maxusage; j++)
1437 hidinput_configure_usage(hidinput, report->field[i],
1438 report->field[i]->usage + j);