Lines Matching refs:field

97 				for (j = 0; j < report->field[i]->maxusage; j++) {  in hidinput_find_key()
98 usage = report->field[i]->usage + j; in hidinput_find_key()
200 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) in hidinput_calc_abs_res() argument
202 __s32 unit_exponent = field->unit_exponent; in hidinput_calc_abs_res()
203 __s32 logical_extents = field->logical_maximum - in hidinput_calc_abs_res()
204 field->logical_minimum; in hidinput_calc_abs_res()
205 __s32 physical_extents = field->physical_maximum - in hidinput_calc_abs_res()
206 field->physical_minimum; in hidinput_calc_abs_res()
227 if (field->unit == 0x11) { /* If centimeters */ in hidinput_calc_abs_res()
230 } else if (field->unit == 0x13) { /* If inches */ in hidinput_calc_abs_res()
248 if (field->unit == 0x14) { /* If degrees */ in hidinput_calc_abs_res()
255 } else if (field->unit != 0x12) { /* If not radians */ in hidinput_calc_abs_res()
444 struct hid_field *field, bool is_percentage) in hidinput_setup_battery() argument
481 min = field->logical_minimum; in hidinput_setup_battery()
482 max = field->logical_maximum; in hidinput_setup_battery()
495 dev->battery_report_id = field->report->id; in hidinput_setup_battery()
503 field->physical == HID_DG_STYLUS; in hidinput_setup_battery()
561 struct hid_field *field, bool is_percentage) in hidinput_setup_battery() argument
575 static bool hidinput_field_in_collection(struct hid_device *device, struct hid_field *field, in hidinput_field_in_collection() argument
580 collection = &device->collection[field->usage->collection_index]; in hidinput_field_in_collection()
585 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, in hidinput_configure_usage() argument
593 field->hidinput = hidinput; in hidinput_configure_usage()
595 if (field->flags & HID_MAIN_ITEM_CONSTANT) in hidinput_configure_usage()
599 if (field->report_count < 1) in hidinput_configure_usage()
603 if (field->report_type == HID_OUTPUT_REPORT && in hidinput_configure_usage()
609 int ret = device->driver->input_mapping(device, hidinput, field, in hidinput_configure_usage()
635 switch (field->application) { in hidinput_configure_usage()
651 if (hidinput_field_in_collection(device, field, in hidinput_configure_usage()
662 switch (field->physical) { in hidinput_configure_usage()
722 if (field->application == HID_GD_SYSTEM_CONTROL) in hidinput_configure_usage()
733 if (field->dpad) { in hidinput_configure_usage()
734 map_abs(field->dpad); in hidinput_configure_usage()
745 if (field->flags & HID_MAIN_ITEM_RELATIVE) in hidinput_configure_usage()
752 if (field->flags & HID_MAIN_ITEM_RELATIVE) { in hidinput_configure_usage()
760 if (field->flags & HID_MAIN_ITEM_RELATIVE) in hidinput_configure_usage()
767 usage->hat_min = field->logical_minimum; in hidinput_configure_usage()
768 usage->hat_max = field->logical_maximum; in hidinput_configure_usage()
777 if (field->application == HID_GD_WIRELESS_RADIO_CTLS) { in hidinput_configure_usage()
780 field->flags |= HID_MAIN_ITEM_RELATIVE; in hidinput_configure_usage()
809 if ((field->application & 0xff) == 0x01) /* Digitizer */ in hidinput_configure_usage()
811 else if ((field->application & 0xff) == 0x02) /* Pen */ in hidinput_configure_usage()
828 switch (field->physical & 0xff) { in hidinput_configure_usage()
836 hidinput_setup_battery(device, HID_INPUT_REPORT, field, false); in hidinput_configure_usage()
1102 hidinput_setup_battery(device, HID_INPUT_REPORT, field, false); in hidinput_configure_usage()
1111 hidinput_setup_battery(device, HID_INPUT_REPORT, field, true); in hidinput_configure_usage()
1169 if (field->report_size == 1) { in hidinput_configure_usage()
1170 if (field->report->type == HID_OUTPUT_REPORT) { in hidinput_configure_usage()
1177 if (field->flags & HID_MAIN_ITEM_RELATIVE) { in hidinput_configure_usage()
1191 device->driver->input_mapped(device, hidinput, field, usage, in hidinput_configure_usage()
1233 int a = field->logical_minimum; in hidinput_configure_usage()
1234 int b = field->logical_maximum; in hidinput_configure_usage()
1237 a = field->logical_minimum = 0; in hidinput_configure_usage()
1238 b = field->logical_maximum = 255; in hidinput_configure_usage()
1241 if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK) in hidinput_configure_usage()
1246 hidinput_calc_abs_res(field, usage->code)); in hidinput_configure_usage()
1260 if (usage->hat_dir && !field->dpad) in hidinput_configure_usage()
1261 field->dpad = usage->code; in hidinput_configure_usage()
1268 if ((usage->type == EV_ABS) && (field->flags & HID_MAIN_ITEM_RELATIVE) && in hidinput_configure_usage()
1318 void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, _… in hidinput_hid_event() argument
1331 if (!field->hidinput) in hidinput_hid_event()
1334 input = field->hidinput->input; in hidinput_hid_event()
1362 int a = field->logical_minimum; in hidinput_hid_event()
1363 int b = field->logical_maximum; in hidinput_hid_event()
1386 if ((usage->type == EV_ABS) && (field->flags & HID_MAIN_ITEM_RELATIVE) && in hidinput_hid_event()
1412 if ((field->flags & HID_MAIN_ITEM_VARIABLE) && in hidinput_hid_event()
1413 (field->logical_minimum < field->logical_maximum)) { in hidinput_hid_event()
1414 if (field->flags & HID_MAIN_ITEM_NULL_STATE && in hidinput_hid_event()
1415 (value < field->logical_minimum || in hidinput_hid_event()
1416 value > field->logical_maximum)) { in hidinput_hid_event()
1421 field->logical_minimum, in hidinput_hid_event()
1422 field->logical_maximum); in hidinput_hid_event()
1435 if (!(field->flags & (HID_MAIN_ITEM_RELATIVE | in hidinput_hid_event()
1437 (field->flags & HID_MAIN_ITEM_VARIABLE) && in hidinput_hid_event()
1438 usage->usage_index < field->maxusage && in hidinput_hid_event()
1439 value == field->value[usage->usage_index]) in hidinput_hid_event()
1449 if ((field->flags & HID_MAIN_ITEM_RELATIVE) && in hidinput_hid_event()
1468 …_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field) in hidinput_find_field() argument
1475 *field = report->field[i]; in hidinput_find_field()
1476 for (j = 0; j < (*field)->maxusage; j++) in hidinput_find_field()
1477 if ((*field)->usage[j].type == type && (*field)->usage[j].code == code) in hidinput_find_field()
1488 struct hid_field *field; in hidinput_get_led_field() local
1495 field = report->field[i]; in hidinput_get_led_field()
1496 for (j = 0; j < field->maxusage; j++) in hidinput_get_led_field()
1497 if (field->usage[j].type == EV_LED) in hidinput_get_led_field()
1498 return field; in hidinput_get_led_field()
1508 struct hid_field *field; in hidinput_count_leds() local
1516 field = report->field[i]; in hidinput_count_leds()
1517 for (j = 0; j < field->maxusage; j++) in hidinput_count_leds()
1518 if (field->usage[j].type == EV_LED && in hidinput_count_leds()
1519 field->value[j]) in hidinput_count_leds()
1531 struct hid_field *field; in hidinput_led_worker() local
1537 field = hidinput_get_led_field(hid); in hidinput_led_worker()
1538 if (!field) in hidinput_led_worker()
1554 report = field->report; in hidinput_led_worker()
1579 struct hid_field *field; in hidinput_input_event() local
1588 if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { in hidinput_input_event()
1593 hid_set_field(field, offset, value); in hidinput_input_event()
1626 report->field[i]->logical_maximum : in __hidinput_change_resolution_multipliers()
1627 report->field[i]->logical_minimum; in __hidinput_change_resolution_multipliers()
1633 if (report->field[i]->report_count != 1) in __hidinput_change_resolution_multipliers()
1636 for (j = 0; j < report->field[i]->maxusage; j++) { in __hidinput_change_resolution_multipliers()
1637 usage = &report->field[i]->usage[j]; in __hidinput_change_resolution_multipliers()
1661 report->field[i]->value[j] = value; in __hidinput_change_resolution_multipliers()
1706 if (rep->field[i]->report_count < 1) in report_features()
1709 for (j = 0; j < rep->field[i]->maxusage; j++) { in report_features()
1710 usage = &rep->field[i]->usage[j]; in report_features()
1715 rep->field[i], false); in report_features()
1718 drv->feature_mapping(hid, rep->field[i], usage); in report_features()
1869 if (report->field[i]->hidinput == hidinput) in hidinput_cleanup_hidinput()
1870 report->field[i]->hidinput = NULL; in hidinput_cleanup_hidinput()
1920 for (j = 0; j < report->field[i]->maxusage; j++) in hidinput_configure_usages()
1921 hidinput_configure_usage(hidinput, report->field[i], in hidinput_configure_usages()
1922 report->field[i]->usage + j); in hidinput_configure_usages()